rancher-desktop: "Starting virtual machine" step fails due to SSH socket path being too long.

Rancher Desktop shows the “Starting virtual machine” until timeout.

~/Library/Application\ Support/rancher-desktop/lima/0/ha.stderr.log contains the following lines:

{"level":"debug","msg":"stdout=\"\", stderr=\"unix_listener: path \\\"/Users/od.andreas.zitzelsberger/Library/Application Support/rancher-desktop/lima/0/ssh.sock.Rcl2KoI2X03Sbknt\\\" too long for Unix domain socket\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"unix_listener: path \\\"/Users/XXXXXXXXXXXXXXXXXXXXXXXX/Library/Application Support/rancher-desktop/lima/0/ssh.sock.Rcl2KoI2X03Sbknt\\\" too long for Unix domain socket\\r\\n\": exit status 255","time":"2021-10-14T15:28:04+02:00"}

with XXXXXXXXXXXXXXXXXXXXXXXX being my user name. Please note that the path /Users/XXXXXXXXXXXXXXXXXXXXXXXX/Library/Application Support/rancher-desktop/lima/0/ssh.sock.Rcl2KoI2X03Sbknt has 109 characters. The path length for Unix Domain Sockets is limited to 108 characters (Linux) or 104 characters (Mac). Unfortunately, my user name is managed and cannot be changed. While the user name is long, I believe it’s length is not uncommon.

To Reproduce

  • Start Rancher Desktop on a Mac with a user name that has 21 characters or more.

Result Rancher Desktop shows the “Starting virtual machine” until timeout.

Expected behaviour Rancher Desktop starts up properly.

Screenshots grafik

Setup (please complete the following information):

  • macOS 11.6
  • Rancher Desktop 0.6.0
  • Kubernetes 1.21.5

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 2
  • Comments: 39 (8 by maintainers)

Commits related to this issue

Most upvoted comments

It should be possible to work around it now, even though it is not automatic.

I’ve just moved the lima home directory to ~/.rdlima:

$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Please try that and let me know if it fixes the issue for you!

Please keep the bug open though, because I think RD should do something like this automatically, but I don’t know when we will get around to it.

It should be possible to work around it now, even though it is not automatic.

I’ve just moved the lima home directory to ~/.rdlima:

$ mv ~/Library/Application\ Support/rancher-desktop/lima ~/.rdlima
$ ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Please try that and let me know if it fixes the issue for you!

Please keep the bug open though, because I think RD should do something like this automatically, but I don’t know when we will get around to it.

This still works as of Feb 7, 2023.

I had some trouble with https://github.com/rancher-sandbox/rancher-desktop/issues/797#issuecomment-996510877, so I post here all my steps. I hope this will help you.

Reset Rancher Desktop: “Troubleshooting / Factory Reset”, close Rancher Desktop or run the following steps before you start Rancher Desktop!

rm -r ~/.rdlima
rm -r ~/Library/Application\ Support/rancher-desktop
mkdir ~/.rdlima
mkdir ~/Library/Application\ Support/rancher-desktop
ln -s ~/.rdlima ~/Library/Application\ Support/rancher-desktop/lima

Restart Rancher Desktop Check Rancher Desktop logs Check some context

kubectl config get-contexts
CURRENT   NAME                                                               CLUSTER                                                            AUTHINFO                                                           NAMESPACE
*         rancher-desktop                                                    rancher-desktop                                                    rancher-desktop                           
 
kubectl config use-context rancher-desktop
 
docker context ls
NAME                DESCRIPTION                               DOCKER ENDPOINT                                      ERROR
default *           Current DOCKER_HOST based configuration   unix:///Users/<username>/.rd/docker.sock

Restart Rancher Desktop

docker context ls
NAME              DESCRIPTION                               DOCKER ENDPOINT                                      ERROR
default *         Current DOCKER_HOST based configuration   unix:///Users/<username>/.rd/docker.sock  
rancher-desktop   Rancher Desktop moby context              unix:///Users/<username>/.rd/docker.sock  
Warning: DOCKER_HOST environment variable overrides the active context. To use a context, either set the global --context flag, or unset DOCKER_HOST environment variable.

Docker default context can be set by export environment variable DOCKER_HOST=unix:///Users/<username>/.rd/docker.sock

reopen shell

So have fun

Hi, Reset kubernetes button inside the Troubleshooting section worked for me (mac m1)

I can confirm that the work around works for me. Thanks!

Still occurs on 1.10.0.

Two and a half years later and users still have to find this thread and then apply the manual fix in order to get Rancher Desktop running on their machine if their username is longer than 21 characters.

Unfortunately true. 😞 The problem is that we have a huge number of open issues, so problems with a simple workaround don’t get prioritized.

Hi, Reset kubernetes button inside the Troubleshooting section worked for me (mac m1)

Following an upgrade to Rancher 1.14.1, I encountered a similar issue. The workaround to move lima did not resolve. Resetting k8s (and deleting the containers) worked. I’m not currently using k8s so this was okay for me, but might be a show-stopper for anyone who does?

My username is 3 characters, so I think that my problem might be different (I was not seeing the error about the Unix path limit).

@anthonyrea I just heard from somebody last week that it still works. What is the error you are seeing? If you still get the same message as before, then you haven’t created the symlink correctly.

@jandubois’s workaround did not work today for version 1.8.1 on MacOS M1.

instance name \\"0\\" too long: "/Users/xxxxxxxxxxxx.xxxxxxxxxxxx/Library/Application Support/rancher-desktop/lima/0/ssh.sock.1234567890123456" must be less than UNIX_PATH_MAX=104 characters, but is 109

Any workarounds for this issue that still work in the newest version?