lima-vm / lima

Linux virtual machines, with a focus on running containers
https://lima-vm.io/
Apache License 2.0
15.02k stars 585 forks source link

User folder not shared #755

Open noahgaertner opened 2 years ago

noahgaertner commented 2 years ago

Description

Hi, When I call lima ls in my home directory, I get an empty list, despite having files and folders in my user directory. In addition, if I try to call lima from any subfolder of my home directory or cd into any such subdirectory I get a No such file or directory error. Is there some way to fix this?

afbjorklund commented 2 years ago

Which example did you use ? Were there any errors ?

noahgaertner commented 2 years ago

I just used the standard limactl start with the default config. It looks like fuse isn't letting me mount a nonempty directory for whatever reason, but IDK how to fix that (or, well, how to tell lima to output the nonempty mount option) Here's the output when I run that if that's helpful:

INFO[0000] Using the existing instance "default"
INFO[0000] Attempting to download the nerdctl archive from "https://github.com/containerd/nerdctl/releases/download/v0.17.1/nerdctl-full-0.17.1-linux-arm64.tar.gz"  digest="sha256:b773a0db178af9d0963b7c84df88ee434e0c1986fe7491dc1de3231e071e3921"
INFO[0000] Using cache "/Users/noahgaertner/Library/Caches/lima/download/by-url-sha256/ec04f07c11877cda079581d4ac1865088c83d3c1e8be89b1adb61756f716ad77/data"
INFO[0001] [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/noahgaertner/.lima/default/serial.log")
INFO[0001] SSH Local Port: 60022
INFO[0001] [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
INFO[0021] [hostagent] The essential requirement 1 of 5 is satisfied
INFO[0021] [hostagent] Waiting for the essential requirement 2 of 5: "user session is ready for ssh"
INFO[0021] [hostagent] The essential requirement 2 of 5 is satisfied
INFO[0021] [hostagent] Waiting for the essential requirement 3 of 5: "sshfs binary to be installed"
INFO[0021] [hostagent] The essential requirement 3 of 5 is satisfied
INFO[0021] [hostagent] Waiting for the essential requirement 4 of 5: "/etc/fuse.conf to contain \"user_allow_other\""
INFO[0022] [hostagent] The essential requirement 4 of 5 is satisfied
INFO[0022] [hostagent] Waiting for the essential requirement 5 of 5: "the guest agent to be running"
INFO[0022] [hostagent] The essential requirement 5 of 5 is satisfied
INFO[0022] [hostagent] Mounting "/Users/noahgaertner"
INFO[0022] [hostagent] fuse: mountpoint is not empty
INFO[0022] [hostagent] fuse: if you are sure this is safe, use the 'nonempty' mount option
osWARN[0053] [hostagent] failed to confirm whether /Users/noahgaertner [remote] is successfully mounted
INFO[0053] [hostagent] Mounting "/tmp/lima"
INFO[0053] [hostagent] Waiting for the optional requirement 1 of 2: "systemd must be available"
INFO[0053] [hostagent] Forwarding "/run/lima-guestagent.sock" (guest) to "/Users/noahgaertner/.lima/default/ga.sock" (host)
INFO[0054] [hostagent] The optional requirement 1 of 2 is satisfied
INFO[0054] [hostagent] Waiting for the optional requirement 2 of 2: "containerd binaries to be installed"
INFO[0054] [hostagent] Not forwarding TCP 127.0.0.53:53
INFO[0054] [hostagent] Not forwarding TCP 0.0.0.0:22
INFO[0054] [hostagent] Not forwarding TCP [::]:22
INFO[0054] [hostagent] The optional requirement 2 of 2 is satisfied
INFO[0054] [hostagent] Waiting for the final requirement 1 of 1: "boot scripts must have finished"
INFO[0054] [hostagent] The final requirement 1 of 1 is satisfied
INFO[0054] READY. Run `lima` to open the shell.
afbjorklund commented 2 years ago

The mountpoint would be /Users/noahgaertner, you might want to look in there (with shell) for any clues ?

Sometimes there is a problem if setting up a container to run at boot, and then starting to write files to the external file system before it has been properly mounted (since the sshfs runs later in the boot process, there is a race window open there)

This should not happen when using named volumes or for files local (to the VM), only for the remote host files.

afbjorklund commented 2 years ago

how to tell lima to output the nonempty mount option

If the first mount fails, lima should try again with nonempty

https://github.com/lima-vm/lima/blob/master/pkg/hostagent/mount.go#L66

The errors should be in the log file, for the hostagent. (ha.stderr.log)

noahgaertner commented 2 years ago

The mountpoint would be /Users/noahgaertner, you might want to look in there (with shell) for any clues ?

What exactly would I be looking for? That's just my homedir.

noahgaertner commented 2 years ago

how to tell lima to output the nonempty mount option

If the first mount fails, lima should try again with nonempty

https://github.com/lima-vm/lima/blob/master/pkg/hostagent/mount.go#L66

The errors should be in the log file, for the hostagent. (ha.stderr.log)

Here's that output, if it's helpful

{"level":"debug","msg":"firmware candidates = [/opt/homebrew/share/qemu/edk2-aarch64-code.fd /usr/share/AAVMF/AAVMF_CODE.fd /usr/share/qemu-efi-aarch64/QEMU_EFI.fd]","time":"2022-03-27T15:22:00-04:00"}
{"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-03-27T15:22:00-04:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing aes128-gcm@openssh.com and aes256-gcm@openssh.com","time":"2022-03-27T15:22:00-04:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/noahgaertner/.lima/default/serial.log\")","time":"2022-03-27T15:22:00-04:00"}
{"level":"debug","msg":"qCmd.Args: [/opt/homebrew/bin/qemu-system-aarch64 -cpu host -machine virt,accel=hvf,highmem=off -smp 4,sockets=1,cores=4,threads=1 -m 4096 -drive if=pflash,format=raw,readonly=on,file=/opt/homebrew/share/qemu/edk2-aarch64-code.fd -boot order=c,splash-time=0,menu=on -drive file=/Users/noahgaertner/.lima/default/diffdisk,if=virtio -cdrom /Users/noahgaertner/.lima/default/cidata.iso -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:60022-:22 -device virtio-net-pci,netdev=net0,mac=52:55:55:80:f8:c3 -device virtio-rng-pci -display none -vga none -device ramfb -device qemu-xhci,id=usb-bus -device usb-kbd,bus=usb-bus.0 -device usb-mouse,bus=usb-bus.0 -parallel none -chardev socket,id=char-serial,path=/Users/noahgaertner/.lima/default/serial.sock,server=on,wait=off,logfile=/Users/noahgaertner/.lima/default/serial.log -serial chardev:char-serial -chardev socket,id=char-qmp,path=/Users/noahgaertner/.lima/default/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-default -pidfile /Users/noahgaertner/.lima/default/qemu.pid]","time":"2022-03-27T15:22:00-04:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2022-03-27T15:22:00-04:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2022-03-27T15:22:01-04:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/bash]","time":"2022-03-27T15:22:01-04:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"\", err=\u003cnil\u003e","time":"2022-03-27T15:22:21-04:00"}
{"level":"info","msg":"The essential requirement 1 of 5 is satisfied","time":"2022-03-27T15:22:21-04:00"}
{"level":"info","msg":"Waiting for the essential requirement 2 of 5: \"user session is ready for ssh\"","time":"2022-03-27T15:22:21-04:00"}
{"level":"debug","msg":"executing script \"user session is ready for ssh\"","time":"2022-03-27T15:22:21-04:00"}
{"level":"debug","msg":"executing ssh for script \"user session is ready for ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/bash]","time":"2022-03-27T15:22:21-04:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"+ timeout 30s bash -c 'until sudo diff -q /run/lima-ssh-ready /mnt/lima-cidata/meta-data 2\u003e/dev/null; do sleep 3; done'\\n\", err=\u003cnil\u003e","time":"2022-03-27T15:22:22-04:00"}
{"level":"info","msg":"The essential requirement 2 of 5 is satisfied","time":"2022-03-27T15:22:22-04:00"}
{"level":"info","msg":"Waiting for the essential requirement 3 of 5: \"sshfs binary to be installed\"","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing script \"sshfs binary to be installed\"","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing ssh for script \"sshfs binary to be installed\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/bash]","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"stdout=\"/usr/bin/sshfs\\n\", stderr=\"+ timeout 30s bash -c 'until command -v sshfs; do sleep 3; done'\\n\", err=\u003cnil\u003e","time":"2022-03-27T15:22:22-04:00"}
{"level":"info","msg":"The essential requirement 3 of 5 is satisfied","time":"2022-03-27T15:22:22-04:00"}
{"level":"info","msg":"Waiting for the essential requirement 4 of 5: \"/etc/fuse.conf to contain \\\"user_allow_other\\\"\"","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing script \"/etc/fuse.conf to contain \\\"user_allow_other\\\"\"","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing ssh for script \"/etc/fuse.conf to contain \\\"user_allow_other\\\"\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/bash]","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"+ timeout 30s bash -c 'until grep -q ^user_allow_other /etc/fuse.conf; do sleep 3; done'\\n\", err=\u003cnil\u003e","time":"2022-03-27T15:22:22-04:00"}
{"level":"info","msg":"The essential requirement 4 of 5 is satisfied","time":"2022-03-27T15:22:22-04:00"}
{"level":"info","msg":"Waiting for the essential requirement 5 of 5: \"the guest agent to be running\"","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing script \"the guest agent to be running\"","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing ssh for script \"the guest agent to be running\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/bash]","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"+ sock=/run/lima-guestagent.sock\\n+ timeout 30s bash -c 'until [ -S \\\"/run/lima-guestagent.sock\\\" ]; do sleep 3; done'\\n\", err=\u003cnil\u003e","time":"2022-03-27T15:22:22-04:00"}
{"level":"info","msg":"The essential requirement 5 of 5 is satisfied","time":"2022-03-27T15:22:22-04:00"}
{"level":"info","msg":"Mounting \"/Users/noahgaertner\"","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing ssh for preparing sshfs: /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- mkdir -p /Users/noahgaertner]","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing ssh for remote sshfs: /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- sshfs :/Users/noahgaertner /Users/noahgaertner -o slave -o ro -o allow_other]","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"starting sftp server for /Users/noahgaertner","time":"2022-03-27T15:22:22-04:00"}
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
{"level":"debug","msg":"generated script \"wait-for-remote-ready\" with map map[Dir:/Users/noahgaertner MaxTrial:30]: \"#!/bin/sh\\nset -eu\\ndir=\\\"/Users/noahgaertner\\\"\\nmax_trial=\\\"30\\\"\\nLANG=C\\nLC_ALL=C\\nexport LANG LC_ALL\\ni=0\\nwhile : ; do\\n  # FIXME: not really robust\\n  if mount | grep \\\"on ${dir}\\\" | egrep -qw \\\"fuse.sshfs|osxfuse\\\"; then\\n    echo '{\\\"return\\\":{}}'\\n    exit 0\\n  fi\\n  sleep 1\\n  if [ $i -ge ${max_trial} ]; then\\n    echo \u003e\u00262 \\\"sshfs does not seem to be mounted on ${dir}\\\"\\n    exit 1\\n  fi\\n  i=$((i + 1))\\ndone\\n\"","time":"2022-03-27T15:22:22-04:00"}
{"error":"EOF","level":"debug","msg":"sftp server for /Users/noahgaertner exited with EOF (negligible)","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executing ssh for script \"wait-for-remote-ready\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/sh]","time":"2022-03-27T15:22:22-04:00"}
{"level":"debug","msg":"executed script \"wait-for-remote-ready\", stdout=\"\", stderr=\"sshfs does not seem to be mounted on /Users/noahgaertner\\n\", err=failed to execute script \"wait-for-remote-ready\": stdout=\"\", stderr=\"sshfs does not seem to be mounted on /Users/noahgaertner\\n\": exit status 1","time":"2022-03-27T15:22:54-04:00"}
{"error":"failed to execute script \"wait-for-remote-ready\": stdout=\"\", stderr=\"sshfs does not seem to be mounted on /Users/noahgaertner\\n\": exit status 1","level":"warning","msg":"failed to confirm whether /Users/noahgaertner [remote] is successfully mounted","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"Mounting \"/tmp/lima\"","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing ssh for preparing sshfs: /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- mkdir -p /tmp/lima]","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing ssh for remote sshfs: /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- sshfs :/tmp/lima /tmp/lima -o slave -o allow_other]","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"starting sftp server for /tmp/lima","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"generated script \"wait-for-remote-ready\" with map map[Dir:/tmp/lima MaxTrial:30]: \"#!/bin/sh\\nset -eu\\ndir=\\\"/tmp/lima\\\"\\nmax_trial=\\\"30\\\"\\nLANG=C\\nLC_ALL=C\\nexport LANG LC_ALL\\ni=0\\nwhile : ; do\\n  # FIXME: not really robust\\n  if mount | grep \\\"on ${dir}\\\" | egrep -qw \\\"fuse.sshfs|osxfuse\\\"; then\\n    echo '{\\\"return\\\":{}}'\\n    exit 0\\n  fi\\n  sleep 1\\n  if [ $i -ge ${max_trial} ]; then\\n    echo \u003e\u00262 \\\"sshfs does not seem to be mounted on ${dir}\\\"\\n    exit 1\\n  fi\\n  i=$((i + 1))\\ndone\\n\"","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing ssh for script \"wait-for-remote-ready\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/sh]","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executed script \"wait-for-remote-ready\", stdout=\"{\\\"return\\\":{}}\\n\", stderr=\"\", err=\u003cnil\u003e","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"Waiting for the optional requirement 1 of 2: \"systemd must be available\"","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"Forwarding unix sockets","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing script \"systemd must be available\"","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"Forwarding \"/run/lima-guestagent.sock\" (guest) to \"/Users/noahgaertner/.lima/default/ga.sock\" (host)","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing ssh for script \"systemd must be available\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/bash]","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"guest agent info: \u0026{LocalPorts:[{IP:127.0.0.53 Port:53} {IP:0.0.0.0 Port:22} {IP::: Port:22}]}","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"+ command -v systemctl\\n\", err=\u003cnil\u003e","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"The optional requirement 1 of 2 is satisfied","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"guest agent event: {Time:2022-03-27 19:22:54.658999293 +0000 UTC LocalPortsAdded:[{IP:127.0.0.53 Port:53} {IP:0.0.0.0 Port:22} {IP::: Port:22}] LocalPortsRemoved:[] Errors:[]}","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"Waiting for the optional requirement 2 of 2: \"containerd binaries to be installed\"","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"Not forwarding TCP 127.0.0.53:53","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"Not forwarding TCP 0.0.0.0:22","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing script \"containerd binaries to be installed\"","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"Not forwarding TCP [::]:22","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing ssh for script \"containerd binaries to be installed\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/bash]","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"stdout=\"/usr/local/bin/nerdctl\\n\", stderr=\"+ timeout 30s bash -c 'until command -v nerdctl; do sleep 3; done'\\n\", err=\u003cnil\u003e","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"The optional requirement 2 of 2 is satisfied","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"Waiting for the final requirement 1 of 1: \"boot scripts must have finished\"","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing script \"boot scripts must have finished\"","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"executing ssh for script \"boot scripts must have finished\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/noahgaertner/.lima/_config/user\" -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o NoHostAuthenticationForLocalhost=yes -o GSSAPIAuthentication=no -o PreferredAuthentications=publickey -o Compression=no -o BatchMode=yes -o IdentitiesOnly=yes -o Ciphers=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=noahgaertner -o ControlMaster=auto -o ControlPath=\"/Users/noahgaertner/.lima/default/ssh.sock\" -o ControlPersist=5m -p 60022 127.0.0.1 -- /bin/bash]","time":"2022-03-27T15:22:54-04:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"+ timeout 30s bash -c 'until sudo diff -q /run/lima-boot-done /mnt/lima-cidata/meta-data 2\u003e/dev/null; do sleep 3; done'\\n\", err=\u003cnil\u003e","time":"2022-03-27T15:22:54-04:00"}
{"level":"info","msg":"The final requirement 1 of 1 is satisfied","time":"2022-03-27T15:22:54-04:00"}
afbjorklund commented 2 years ago

That's just my homedir.

On your host, that is your homedir. On the guest (VM), it is supposed to be just an empty directory (a mountpoint)

Now, fusermount is supposed to be able to mount anyway (using nonempty) - but it could be interesting?

arayariquelmes commented 2 years ago

Same issue here, mounting my home directory lima not sharing my folder on a second start:

INFO[0000] Using the existing instance "docker"         
INFO[0000] [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/sarayar/.lima/docker/serial.log") 
INFO[0000] SSH Local Port: 51941                        
INFO[0000] [hostagent] Waiting for the essential requirement 1 of 5: "ssh" 
INFO[0020] [hostagent] The essential requirement 1 of 5 is satisfied 
INFO[0020] [hostagent] Waiting for the essential requirement 2 of 5: "user session is ready for ssh" 
INFO[0032] [hostagent] Waiting for the essential requirement 2 of 5: "user session is ready for ssh" 
INFO[0032] [hostagent] The essential requirement 2 of 5 is satisfied 
INFO[0032] [hostagent] Waiting for the essential requirement 3 of 5: "sshfs binary to be installed" 
INFO[0033] [hostagent] The essential requirement 3 of 5 is satisfied 
INFO[0033] [hostagent] Waiting for the essential requirement 4 of 5: "/etc/fuse.conf to contain \"user_allow_other\"" 
INFO[0033] [hostagent] The essential requirement 4 of 5 is satisfied 
INFO[0033] [hostagent] Waiting for the essential requirement 5 of 5: "the guest agent to be running" 
INFO[0033] [hostagent] The essential requirement 5 of 5 is satisfied 
INFO[0033] [hostagent] Mounting "/Users/sarayar"        
INFO[0033] [hostagent] fuse: mountpoint is not empty    
INFO[0033] [hostagent] fuse: if you are sure this is safe, use the 'nonempty' mount option 

WARN[0064] [hostagent] failed to confirm whether /Users/sarayar [remote] is successfully mounted 
INFO[0064] [hostagent] Mounting "/tmp/lima"             
INFO[0064] [hostagent] Waiting for the optional requirement 1 of 1: "user probe 1/1" 
INFO[0064] [hostagent] Forwarding "/run/user/501/docker.sock" (guest) to "/Users/sarayar/.lima/docker/sock/docker.sock" (host) 
INFO[0064] [hostagent] Forwarding "/run/lima-guestagent.sock" (guest) to "/Users/sarayar/.lima/docker/ga.sock" (host) 
INFO[0064] [hostagent] The optional requirement 1 of 1 is satisfied 
INFO[0065] [hostagent] Waiting for the final requirement 1 of 1: "boot scripts must have finished" 
INFO[0065] [hostagent] Not forwarding TCP 127.0.0.53:53 
INFO[0065] [hostagent] Not forwarding TCP 0.0.0.0:22    
INFO[0065] [hostagent] Not forwarding TCP [::]:22       
INFO[0065] [hostagent] The final requirement 1 of 1 is satisfied

I noticed that the issue appear when you used volumes on docker. if you use a volume on docker, shutdown and start lima again the issue occurs.

shoppingjaws commented 2 years ago

I faced the same issue. limactl start -o nonempty doesn't work. I know this is not proper way. Anyway, recreating lima vm instance solves this problem. FYI: https://dockerbook.tw/docs/alternatives/lima/

AkihiroSuda commented 2 years ago

Perhaps we should mount readonly tmpfs on SSHFS mount points to keep them empty

afbjorklund commented 2 years ago

Why is -o nonempty not working ?

shoppingjaws commented 2 years ago

Why is -o nonempty not working ? is this wrong command option?

limactl start docker -o nonempty
FATA[0000] unknown shorthand flag: 'o' in -o
afbjorklund commented 2 years ago

is this wrong command option?

It is a mount option, not a lima option.

https://github.com/lima-vm/lima/blob/v0.9.2/pkg/hostagent/mount.go#L68