lima icon indicating copy to clipboard operation
lima copied to clipboard

Home directory doesn't get mounted again on reboot

Open thatportugueseguy opened this issue 1 year ago • 7 comments

Description

When rebooting, we lose access to the mount of the host machine home directory (/Users/<user>).

Stopping and starting the vm again seems to fix the issue, it's probably because rebooting skips a few steps that starting and stopping does not, namely:

INFO[0007] [hostagent] Mounting "/Users/ze" on "/Users/ze"

Minimal repro:

INFO[0007] READY. Run `limactl shell debian` to open the shell.

$ limactl shell debian  
ze@lima-debian:/Users/ze/Projects$ sudo reboot

$ limactl shell debian 
bash: line 1: cd: /Users/ze/Projects: No such file or directory
ze@lima-debian:/Users/ze$

Using debian-11 template.

thatportugueseguy avatar Feb 06 '24 18:02 thatportugueseguy

You can reboot the VM in the provisioning phase, but afterwards stoping/starting needs to be done via limactl and not just the VM itself.

I don't think there is anything that can be done about this, so I would prefer to close this issue. Thoughts @lima-vm/maintainers ?

jandubois avatar Feb 06 '24 19:02 jandubois

Wonder if limactl restart would help ?

Otherwise it would require generating the proper mount command for the new filesystems, and adopt to systemd or openrc or what have you. Might not even be possible, for some drivers. Why do we need the reboot? Muscle memory?

afbjorklund avatar Feb 06 '24 20:02 afbjorklund

On a side note, systemctl reboot?

afbjorklund avatar Feb 06 '24 20:02 afbjorklund

The hostagent would have to detect the reboot, and then go through the whole "requirements" processing again once it gets an ssh connections again etc. Seems like a lot of work for something that doesn't seem to have a solid use-case.

Wonder if limactl restart would help ?

I've wanted this a couple of times already, even though I feel it is somewhat redundant.

jandubois avatar Feb 06 '24 20:02 jandubois

Why do we need the reboot? Muscle memory?

yeah, on my part it was just bad form and muscle memory. Looking back at it, it makes sense to use reboot only on provisioning, though i'd say it's not super obvious for newcomers and might lead to situations where it's unclear what the problem is.

thatportugueseguy avatar Feb 11 '24 13:02 thatportugueseguy

Is this about reverse-sshfs? virtiofs? 9p?

AkihiroSuda avatar Feb 12 '24 16:02 AkihiroSuda

Is this about reverse-sshfs?

It is definitely a problem with reverse-sshfs because the mounting is done by the guest-agent. The other 2 are probably fine.

jandubois avatar Feb 12 '24 17:02 jandubois