Errors on 9p mounts
Host environment
- Operating system: macOS (Monterey 12.3.1 (21E258))
- OS/kernel version:
uname -a
:Darwin maximiliano 21.4.0 Darwin Kernel Version 21.4.0: Fri Mar 18 00:47:26 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T8101 arm64 arm Darwin
- Architecture: M1
- QEMU flavor:
qemu-system-aarch64
- QEMU version:
7.0.0
- QEMU command line:
/nix/store/67gzpihsnrn8wmpy0c8yxqzvhq4mxd9w-qemu-7.0.0/bin/qemu-system-aarch64 \ -m 3072 \ -cpu host \ -machine virt,accel=hvf,highmem=off \ -smp 4,sockets=1,cores=4,threads=1 \ -drive if=pflash,format=raw,readonly=on,file=/nix/store/67gzpihsnrn8wmpy0c8yxqzvhq4mxd9w-qemu-7.0.0/share/qemu/edk2-aarch64-code.fd \ -boot order=c,splash-time=0,menu=on \ -drive file=/Users/carlos/.lima/docker/diffdisk,if=virtio \ -cdrom /Users/carlos/.lima/docker/cidata.iso \ -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:55173-:22 \ -device virtio-net-pci,netdev=net0,mac=52:55:55:9b:ca:a6 \ -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/carlos/.lima/docker/serial.sock,server=on,wait=off,logfile=/Users/carlos/.lima/docker/serial.log \ -serial chardev:char-serial \ -virtfs local,mount_tag=mount0,path=/Users/carlos,security_model=mapped-xattr \ -chardev socket,id=char-qmp,path=/Users/carlos/.lima/docker/qmp.sock,server=on,wait=off \ -qmp chardev:char-qmp \ -name lima-docker \ -pidfile /Users/carlos/.lima/docker/qemu.pid
Emulated/Virtualized environment
- Operating system: Ubuntu 22.04
- OS/kernel version:
Linux lima-docker 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:57:31 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
- Architecture:
aarch64
Description of problem
I'm trying to run Docker VMs with Lima, which uses QEMU. I'm trying to expose my home directory on macOS to the Ubuntu VM using 9p
. This is how the mount point looks like inside the Ubuntu VM:
root@lima-docker:~# mount | grep Users
mount0 on /Users/carlos type 9p (rw,relatime,dirsync,fscache,cachetag=4294894070,access=user,trans=virtio,version=9p2000.u)
root@lima-docker:~#
The problem I'm seeing is that doing an ls -l /Users/carlos
gives a "Timer expired" error, and no output:
root@lima-docker:~# ls -l /Users/carlos
ls: reading directory '/Users/carlos': Timer expired
total 0
Under strace
, it seems that the timer error is raised by the getdents64
system call:
root@lima-docker:~# strace -f ls -l /Users/carlos
[..]
openat(AT_FDCWD, "/Users/carlos", O_RDONLY|O_NONBLOCK|O_CLOEXEC|O_DIRECTORY) = 3
newfstatat(3, "", {st_mode=S_IFDIR|0755, st_size=1984, ...}, AT_EMPTY_PATH) = 0
mmap(NULL, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xffffa16bf000
getdents64(3, 0xffffa16bf040, 131072) = -1 ETIME (Timer expired)
[..]
I've also tried the 9p2000.L
protocol instead, and the results are a bit better. I do get a directory listing, but I see "xxx" errors:
root@lima-docker:~# ls -l /Users/carlos
ls: /Users/carlos: Network dropped connection on reset
ls: /Users/carlos/Music: Network dropped connection on reset
ls: /Users/carlos/Pictures: Network dropped connection on reset
ls: /Users/carlos/Desktop: Network dropped connection on reset
ls: /Users/carlos/Library: Network dropped connection on reset
ls: /Users/carlos/Public: Network dropped connection on reset
ls: /Users/carlos/Movies: Network dropped connection on reset
ls: /Users/carlos/Applications: Network dropped connection on reset
ls: /Users/carlos/Dropbox: Network dropped connection on reset
ls: /Users/carlos/Maildir: Network dropped connection on reset
ls: /Users/carlos/Documents: Network dropped connection on reset
ls: /Users/carlos/Downloads: Network dropped connection on reset
total 0
drwx------ 5 carlos dialout 160 Dec 6 10:31 Applications
drwx------ 4 carlos dialout 128 Apr 28 14:40 Desktop
drwx------ 12 carlos dialout 384 Apr 30 08:44 Documents
drwx------ 164 carlos dialout 5248 Apr 29 13:50 Downloads
drwx------ 8 carlos dialout 256 Sep 4 2021 Dropbox
drwx------ 82 carlos dialout 2624 Apr 8 14:05 Library
drwxr-xr-x 3 carlos dialout 96 Nov 12 12:28 Maildir
drwx------ 4 carlos dialout 128 Jul 19 2021 Movies
drwx------ 4 carlos dialout 128 Aug 19 2021 Music
drwx------ 4 carlos dialout 128 Jul 19 2021 Pictures
drwxr-xr-x 4 carlos dialout 128 Jul 19 2021 Public
The errors in this case seem to come from the lgetxattr
system call:
root@lima-docker:~# strace -f ls -l /Users/carlos
[..]
statx(AT_FDCWD, "/Users/carlos/Downloads", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW, STATX_MODE|STATX_NLINK|STATX_UID|STATX_GID|STATX_MTIME|STATX_SIZE, {stx_mask=STATX_BASIC_STATS|STATX_MNT_ID, stx_attributes=0, stx_mode=S_IFDIR|0700, stx_size=5248, ...}) = 0
lgetxattr("/Users/carlos/Downloads", "security.selinux", 0xaaaaec72da70, 255) = -1 ENETRESET (Network dropped connection on reset)
write(2, "ls: ", 4ls: ) = 4
write(2, "/Users/carlos/Downloads", 23/Users/carlos/Downloads) = 23
write(2, ": Network dropped connection on "..., 37: Network dropped connection on reset) = 37
[..]
I've reported this to the Lima folks at https://github.com/lima-vm/lima/issues/831, and they suggested opening an issue here. Any ideas?
Steps to reproduce
- If you have Lima installed (I'm using version 0.10.0):
limactl start --name=docker ./lima-templates/docker.yaml