Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rancher Desktop doesn't start if wsl-vpnkit exists #4966

Closed
tymondouglas opened this issue Jun 16, 2023 · 14 comments
Closed

Rancher Desktop doesn't start if wsl-vpnkit exists #4966

tymondouglas opened this issue Jun 16, 2023 · 14 comments
Labels

Comments

@tymondouglas
Copy link

tymondouglas commented Jun 16, 2023

Actual Behavior

Trying to launch Rancher Desktop in Windows with the WSL distro wsl-vpnkit installed results in 3 instances of Rancher.desktop process being created and eventually it just dies. No window is created. The logfile entry "background" reports that it couldn't launch wsl.
background.log
Error: C:\WINDOWS\system32\wsl.exe exited with code 1 at ChildProcess.<anonymous> (C:\Program Files\Rancher Desktop\resources\app.asar\dist\app\background.js:1:8136) at ChildProcess.emit (node:events:527:28) at ChildProcess._handle.onexit (node:internal/child_process:291:12) { stdout: '', code: 1, command: [ 'C:\\WINDOWS\\system32\\wsl.exe', '--distribution', 'wsl-vpnkit', '--exec', '/bin/wslpath', '-a', '-u', 'C:\\Program Files\\Rancher Desktop\\resources\\resources\\linux\\bin\\docker-buildx' ] }

Steps to Reproduce

  1. Install WSL-VPNKIT as instructed in https://github.com/sakai135/wsl-vpnkit ( setup as distro )
  2. Try to launch Rancher-desktop

Result

Application doesn't launch

Expected Behavior

Application should launch and work just fine. In fact, if i start Rancher Desktop before registering wsl-vpnkit, and then after that register it and run, it works just fine.

Additional Information

WSL-VPNKIT is a very useful tool to fix vpn connectivity issues in corporate environments, in fact it is the only way we managed to make internet work inside wsl after connecting to our corporate vpn.

Rancher Desktop Version

1.8.1

Rancher Desktop K8s Version

1.22.7

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11 22H2

What CPU architecture are you using?

x64

Linux only: what package format did you use to install Rancher Desktop?

None

Windows User Only

Cisco AnyConnect VPN/Forticlient VPN
VMWare CarbonBlack Antirivus

@tymondouglas tymondouglas added the kind/bug Something isn't working label Jun 16, 2023
@s0nea
Copy link

s0nea commented Jun 19, 2023

Hi @tymondouglas,

Thank you for reporting the issue!

I was able to reproduce the issue on my environment. I found the following log messages which might be related:

background.log:

2023-06-19T09:28:36.490Z: Stopping background process Win32 socket proxy.
2023-06-19T09:28:36.973Z: Error starting up: Error: C:\Windows\system32\wsl.exe exited with code 1
    at ChildProcess.<anonymous> (C:\Users\user\AppData\Local\Programs\Rancher Desktop\resources\app.asar\dist\app\background.js:1:8136)
    at ChildProcess.emit (node:events:527:28)
    at ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  stdout: '',
  code: 1,
  command: [
    'C:\\Windows\\system32\\wsl.exe',
    '--distribution',
    'wsl-vpnkit',
    '--exec',
    '/bin/wslpath',
    '-a',
    '-u',
    'C:\\Users\\user\\AppData\\Local\\Programs\\Rancher Desktop\\resources\\resources\\linux\\bin\\docker-buildx'
  ]
}

wsl-helper.wsl-vpnkit.log:

/bin/wslpath: C:\Users\user\AppData\Local\Programs\Rancher Desktop\resources\resources\linux\bin\docker-compose

integrations.log:

2023-06-19T09:28:36.639Z: kubeconfig integration for wsl-vpnkit set to false

I assume the issue needs further investigation.

@Nino-K
Copy link
Member

Nino-K commented Jun 19, 2023

Hi, @tymondouglas Rancher Desktop does not support wsl-vpn kit, and unpredictable behaviors are expected when it's used. If you are using Rancher Desktop behind a VPN please use our built-in (gvisor-based) solutions which you can enable using:

rdctl set --experimental.virtual-machine.networking-tunnel=true

This should allow you to use RD behind a VPN. I'm going to close the issue, however, feel free to re-open if you encounter anything further issues.

@Nino-K Nino-K closed this as completed Jun 19, 2023
@kmcm0
Copy link

kmcm0 commented Jul 6, 2023

This issue shouldnt be closed merely because rancher desktop doesnt use wsl-vpnkit, it still tries by it merely existing. i still need it for my other WSL distros. in my case, vpnkit was already there, and cannot even get rdctl installed without removing vpnkit.
also, this feature is still labeled "experimental"

@doeringp
Copy link

I agree. Rancher Desktop and wsl-vpnkit (for other WSL distros) should be able to coexist.

@Nino-K
Copy link
Member

Nino-K commented Jul 24, 2023

This issue shouldnt be closed merely because rancher desktop doesnt use wsl-vpnkit, it still tries by it merely existing. i still need it for my other WSL distros. in my case, vpnkit was already there, and cannot even get rdctl installed without removing vpnkit. also, this feature is still labeled "experimental"

We have never officially supported wsl-vpnkit and users generally have taken their own approach to get it to work. We don't even have documentation on this. While I understand the feature is marked as experimental, however, it is for sure on its way to becoming our default networking stack in our next upcoming releases. Furthermore, we will be adding a wsl-intergration feature which will enable the routing from other distros to rancher-desktop's namespaced network.

@jandubois
Copy link
Member

I'm going to reopen this issue.

At a minimum we need to detect why Rancher Desktop cannot start when wsl-vpnkit is already running, and provide the user with the information on how to fix that.

Ideally Rancher Desktop and wsl-vpnkit should be able to co-exist, even though Rancher Desktop will not make use of it. It is possible that wsl-vpnkit needs to be changed as well to make this possible, but it is impossible to tell without further investigation.

@huangfeng212
Copy link

Hello, I experienced the same issue. From the background.log, it looks like "wsl-vpnkit" as a distro name is wrongly assembled into some rancher's command and I do find after installing wsl-vpnkit, my "wsl -l" shows:

Windows Subsystem for Linux Distributions:
rancher-desktop (Default)
wsl-vpnkit
rancher-desktop-data

So the wsl-vpnkit gets between the rancher-desktop and rancher-desktop-data in the list, and I guess somewhere in the rancher's script assumes the list order that rancher-desktop-data will always follow rancher-desktop.
I unregistered wsl-vpnkit and then the rancher can start.

@geodis-tmoreau
Copy link

I have the same issue... took me hours to find this was because of vpnkit, after having tried to reinstall rancher-desktop several times (without success).

This should be documented, at least I think.

@nunix
Copy link

nunix commented Oct 5, 2023

This issue is due to the wsl-vpnkit distro WSL config:

cat /etc/wsl.conf
[boot]
systemd=false

[automount]
enabled=false

[network]
generateHosts=false
generateResolvConf=true

[interop]
enabled=true
appendWindowsPath=false

As set in the config file, the automount feature is disabled, therefore there's no Windows mounts (i.e. /mnt/c) which will cause the error @s0nea described.

I'm not sure about the reason behind not mounting the Windows FS, but a first test could be to enable the automount in the wsl-vpnkit distro.

Hope this helps

@mook-as
Copy link
Contributor

mook-as commented Oct 5, 2023

If it's to do with not having the mounts, #5642 may fix it. Thanks for narrowing that down!

@jandubois
Copy link
Member

This seems to have the same root cause as #4560, for which a fix is currently being tested for 1.11. I'm going to close this issue as a duplicate for now.

@doeringp
Copy link

doeringp commented Oct 6, 2023

I can confirm that in the latest build of Rancher Desktop from the main branch the problem is gone.

@jandubois
Copy link
Member

I can confirm that in the latest build of Rancher Desktop from the main branch the problem is gone.

Thank you for confirming!

@geodis-tmoreau
Copy link

Cool! thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

10 participants