This message was deleted.
# rancher-desktop
a
This message was deleted.
f
Lima uses
lima
as the internal username when the host username is not valid on Linux. This is not an issue and works fine.
The problem here is the space in the username, which seems to be a problem when passing a filename to
ssh
, even though the filename is quoted.
No, that isn't the issue either; it may be a problem with the allowed keys.
w
Is there a way to regenerate the keys used in
Copy code
/Users/wenmingcao 1/Library/Application Support/rancher-desktop/lima/_config/user
f
There should be no need to regenerate it; I suspect it isn't setup correctly inside the VM. I'm just trying to figure out how to best debug this. Do you have
socat
installed on the machine? Or can you install it with
brew install socat
?
w
I will install it
f
Ok, thanks! So you can get a root shell like this:
Copy code
$ cd ~/Library/Application\ Support/rancher-desktop/lima/0/
$ socat -,echo=0,icanon=0 unix-connect:serial.sock
root
Welcome to Alpine!

[...]
lima-rancher-desktop:~#
There will be no prompt after running
socat
, but it is waiting for a username, so you have to type
root
and Enter
Then check if the
authorized_keys
file exists (but use
lima.linux
instead of
jan.linux
):
Copy code
lima-rancher-desktop:~# ls -la /home/jan.linux/.ssh
total 12
drwx------    2 jan      jan           4096 Jun 29 00:36 .
drwxr-xr-x    4 jan      jan           4096 Jun 29 16:48 ..
-rw-------    1 jan      jan             92 Jun 29 00:36 authorized_keys
Let me know if the file exists (and is non-empty)
w
Thank you. I will report back after I get socat installed and checked the keys for the lima user
f
The content of
authorized_keys
should be identical to the
user.pub
file on the host
Copy code
lima-rancher-desktop:~# cat /home/jan.linux/.ssh/authorized_keys
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILqESOec8Hf8PFT7Ptz6z9NexbzCsARBXCV6yUNibreG jan@mactop
Copy code
$ cat ~/Library/Application\ Support/rancher-desktop/lima/_config/user.pub
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAILqESOec8Hf8PFT7Ptz6z9NexbzCsARBXCV6yUNibreG jan@mactop
w
I got socat installed and there is no lima user in the home dir
Copy code
lima-rancher-desktop:~# ls -la /home/lima.linux/.ssh
ls: /home/lima.linux/.ssh: No such file or directory
lima-rancher-desktop:~# cd /home
lima-rancher-desktop:/home# ls -al
total 4
drwxr-xr-x  2 root   root     4096 Jun 28 17:45 .
drwxr-xr-x  21 root   root      420 Jun 28 18:57 ..
lima-rancher-desktop:/home#
f
Can you run
cat /var/log/lima-init.log
and create a text snippet to attach it here?
It should look like this:
Copy code
lima-rancher-desktop:~# cat /var/log/lima-init.log
+ export 'LIMA_CIDATA_MNT=/mnt/lima-cidata'
+ '[' --local '!=' --local ]
+ ln -s /var/log/lima-init.log /var/log/cloud-init-output.log
+ LIMA_CIDATA_DEV=/dev/disk/by-label/cidata
+ mkdir -p -m 700 /mnt/lima-cidata
+ mount -o 'ro,mode=0700,dmode=0700,overriderockperm,exec,uid=0' /dev/disk/by-label/cidata /mnt/lima-cidata
+ . /mnt/lima-cidata/lima.env
[...]
There should be a section when the user is created; see if there are any errors around there:
Copy code
+ hostname lima-0
+ LIMA_CIDATA_HOMEDIR=/home/jan.linux
+ useradd --home-dir /home/jan.linux --create-home --uid 501 jan
+ echo 'jan ALL=(ALL) NOPASSWD:ALL'
+ LIMA_CIDATA_SSHDIR=/home/jan.linux/.ssh
+ mkdir -p -m 700 /home/jan.linux/.ssh
+ awk '/ssh-authorized-keys/ {flag=1; next} /^ *$/ {flag=0} flag {sub(/^ +- /, ""); gsub("\"", ""); print $0}' /mnt/lima-cidata/user-data
+ id -g jan
+ LIMA_CIDATA_GID=1000
+ chown -R 501:1000 /home/jan.linux/.ssh
+ chmod 600 /home/jan.linux/.ssh/authorized_keys
I see the problem; it is the mountpoint of the user directory containing a space that is throwing an error earlier, so the whole rest of the init script is skipped 😞
This will need to be fixed in Lima itself.
w
Ah and the space is not escaped. A workaround would be to rename that path to not have a space?
f
I'm not sure if there is a workaround; I'll let you know if I think of something
w
Awesome thank you
f
So I tried to work around this problem by creating a symlink to the user directory without a space, and using that as the
HOME
directory, but that didn't work properly either. So I'm out of ideas for now, beyond creating another username without a space in it, which is a bit drastic.
I'll try to fix this in Lima, so it should work correctly in the next release.
w
Ok thank you for your efforts. Would this be in the next release of rancher-desktop or of lima?
f
First it has to be fixed in Lima, and then Rancher Desktop will import Lima (it doesn't have to be a release, but should at least be merged to
master
)
Once it is in Lima, it will be possible to change the version embedded in Rancher Desktop, but that is not really a supported scenario. But I can describe what to do, if that is something you want to try instead of waiting for the official release (which will not happen until the end of July or so).
I've created Mountpoints cannot include whitespace · Issue #933 · lima-vm/lima for the Lima issue, but it turns out to be more effort than a quick fix because parts need to changed in yet another repo, so I'll leave this for another day.
w
Thank you. I will follow this issue
@fast-garage-66093 any chance that you've been able to fix this issue? The github issue is still open
f
I've been on vacation most of August and just came back on Friday. It looks like nobody else has fixed this, so it is still on my (by now quite huge) todo pile...
w
@fast-garage-66093 any chance that you've been able to take a look at this ticket? My coworker is still not able to use it
f
Sorry, it somehow got bumped off my radar 😞 and looks like nobody else has picked it up either. Will try to take another look
a
webhook