rancher-sandbox / rancher-desktop

Container Management and Kubernetes on the Desktop
https://rancherdesktop.io
Apache License 2.0
5.84k stars 272 forks source link

Can't run privileged service on Windows 11 #4946

Closed s0nea closed 1 year ago

s0nea commented 1 year ago

Actual Behavior

I installed the Rancher Desktop msi from https://github.com/rancher-sandbox/rancher-desktop/actions/runs/5250335611 on Windows 11. I did the installation as an administrator. I did a factory reset before and made sure all configuration files from previous installation in AppData are gone.

After the installation I started the application and checked the rdctl list-settings output. At first it reported:

 "ingress": {
      "localhostOnly": false
    }

I waited some time for RD starting up. Once RD was done with starting all the services, I checked the rdctl list-settings output again and noticed:

 "ingress": {
      "localhostOnly": true
    }

I also checked:

PS C:\Users\admin1> rdctl shell
/ # ps ax |grep privileged
  295 root      0:00 supervise-daemon rancher-desktop-guestagent --start --stdout /mnt/c/Users/admin1/AppData/Local/rancher-desktop/logs/rancher-desktop-guestagent.log --stderr /mnt/c/Users/admin1/AppData/Local/rancher-desktop/logs/rancher-desktop-guestagent.log --respawn-delay 5 --respawn-max 0 --respawn-period 1800 /usr/local/bin/rancher-desktop-guestagent -- -kubernetes=true -iptables=true -privilegedService=false -k8sServiceListenerAddr=127.0.0.1 -debug
  296 root      0:00 /usr/local/bin/rancher-desktop-guestagent -kubernetes=true -iptables=true -privilegedService=false -k8sServiceListenerAddr=127.0.0.1 -debug
 5872 root      0:00 grep privileged

I found the following in the wsl-helper log:

Error: could not detect WSL2 VM: could not find WSL2 VM ID: <no error>
Error: could not detect WSL2 VM: could not find WSL2 VM ID: could not dial VM C85B2EC4-3672-4B0D-B498-3E1FDCFE676C: could not dial Hyper-V socket: connect(c85b2ec4-3672-4b0d-b498-3e1fdcfe676c:016a6eb7-facb-11e6-bd58-64006a7986d3) failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Error: could not detect WSL2 VM: could not find WSL2 VM ID: could not dial VM C85B2EC4-3672-4B0D-B498-3E1FDCFE676C: could not dial Hyper-V socket: connect(c85b2ec4-3672-4b0d-b498-3e1fdcfe676c:016a6eb7-facb-11e6-bd58-64006a7986d3) failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
Error: could not detect WSL2 VM: could not find WSL2 VM ID: could not dial VM C85B2EC4-3672-4B0D-B498-3E1FDCFE676C: could not dial Hyper-V socket: connect(c85b2ec4-3672-4b0d-b498-3e1fdcfe676c:016a6eb7-facb-11e6-bd58-64006a7986d3) failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
time="2023-06-13T10:11:02+02:00" level=info msg="Got WSL2 VM" guid=c85b2ec4-3672-4b0d-b498-3e1fdcfe676c
time="2023-06-13T10:11:02+02:00" level=info msg=Listening endpoint="npipe:////./pipe/docker_engine"

Steps to Reproduce

  1. Install Rancher Desktop Setup.msi from https://github.com/rancher-sandbox/rancher-desktop/actions/runs/5250335611 on Windows 11 as an administrator
  2. Start RD
  3. Check rdctl list-settings during and after startup

Result

RD configured with privilegedService=false.

Expected Behavior

Should run privilegedService=false if the installation was done by an administrator.

Additional Information

No response

Rancher Desktop Version

latest

Rancher Desktop K8s Version

1.26.5

Which container engine are you using?

moby (docker cli)

What operating system are you using?

Windows

Operating System / Build Version

Windows 11

What CPU architecture are you using?

x64

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

None

Windows User Only

No response

rak-phillip commented 1 year ago

Still investigating but not able to repro at this point.

Ingress remains unchanged after starting

 "ingress": {
      "localhostOnly": false
    }

rdctl shell output

> rdctl shell
/ # ps ax |grep privileged
  291 root      0:00 supervise-daemon rancher-desktop-guestagent --start --stdout /mnt/c/Users/phillip/AppData/Local/rancher-desktop/logs/rancher-desktop-guestagent.log --stderr /mnt/c/Users/phillip/AppData/Local/rancher-desktop/logs/rancher-desktop-guestagent.log --respawn-delay 5 --respawn-max 0 --respawn-period 1800 /usr/local/bin/rancher-desktop-guestagent -- -adminInstall=true -kubernetes=true -iptables=false -privilegedService=true -docker=true -containerd=false -k8sServiceListenerAddr=0.0.0.0 -debug
  292 root      0:00 /usr/local/bin/rancher-desktop-guestagent -adminInstall=true -kubernetes=true -iptables=false -privilegedService=true -docker=true -containerd=false -k8sServiceListenerAddr=0.0.0.0 -debug
 4453 root      0:00 grep privileged

WSL Helper Log

Error: could not detect WSL2 VM: could not find WSL2 VM ID: could not dial VM FEAC96D7-F781-4CFE-BF2C-B46822A5A56D: could not dial Hyper-V socket: connect(feac96d7-f781-4cfe-bf2c-b46822a5a56d:016a6eb7-facb-11e6-bd58-64006a7986d3) failed: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
time="2023-06-13T09:27:38-07:00" level=info msg="Got WSL2 VM" guid=feac96d7-f781-4cfe-bf2c-b46822a5a56d
time="2023-06-13T09:27:38-07:00" level=info msg=Listening endpoint="npipe:////./pipe/docker_engine"
s0nea commented 1 year ago

It seems like the issue is related to my environment. I'm closing the issue for now. I'll re-open it if necessary.