abiosoft / abiosoft/colima

Cannot mount writable volume with vz, virtiofs

Offen
#841 2 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Go
Sterne
30.8k
Forks
613
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Description

Do `docker run` with `-v` option, and got creating mount space error.

### Version

Colima Version:0.5.6
Lima Version:0.18.0
Qemu Version:8.1.2

### Operating System

- [ ] macOS Intel <= 12 (Monterrey)
- [ ] macOS Intel >= 13 (Ventura)
- [ ] macOS M1 <= 12 (Monterrey)
- [X] macOS M1 >= 13 (Ventura)
- [ ] Linux

### Output of `colima status`

```
INFO[0000] colima is running using macOS Virtualization.Framework
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:///Users/mopeneko/.colima/default/docker.sock
```

### Reproduction Steps

1. Mount a directory with:

```
mounts:
- location: ~/projects
writable: true
```

2.Start colima:

```
$ colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] starting ... context=vm
> ash: cd: line 0: can't cd to /Users/mopeneko/projects: No such file or directory
> stat: can't stat '/proc/sys/fs/binfmt_misc/qemu-x86_64': No such file or directory
WARN[0022] unable to disable qemu x86_84 emulation: exit status 1
INFO[0022] provisioning ... context=docker
INFO[0022] starting ... context=docker
INFO[0028] done
```

3. Execute `docker run` with mounting volume, then an error occured:

```
$ docker run -it -v $(pwd)/a:/a:rw ubuntu:latest /bin/bash
docker: Error response from daemon: error while creating mount source path '/Users/mopeneko/projects/a': mkdir /Users/mopeneko/projects: operation not permitted.
ERRO[0000] error waiting for container:
```

### Expected behaviour

- Start container successfully with mounting volumes
- Read / Write to mounted directory from a container

### Additional context

`~/.lima/colima/serialv.log`

```
[ 0.479610] rtc-efi rtc-efi.0: registered as rtc0
[ 0.479956] rtc-efi rtc-efi.0: setting system clock to 2023-11-06T02:49:59 UTC (1699238999)
[ 0.491779] registered taskstats version 1
[ 0.491908] Loading compiled-in X.509 certificates
[ 0.496971] Loaded X.509 cert 'alpinelinux.org: Alpine Linux kernel key: 87fa969a47f3e2a6aa35859eb932a17c95abcd82'
[ 0.497302] zswap: loaded using pool lzo/zbud
[ 0.497617] Key type .fscrypt registered
[ 0.497655] Key type fscrypt-provisioning registered
[ 0.501640] Freeing unused kernel memory: 2752K
[ 0.532182] Run /init as init process
[ 0.546388] Alpine Init 3.8.1-r0
[ 0.546624] Loading boot drivers...
[ 0.553079] loop: module loaded
[ 0.554699] squashfs: version 4.0 (2009/01/31) Phillip Lougher
[ 0.559387] SCSI subsystem initialized
[ 0.572315] ACPI: bus type USB registered
[ 0.572408] usbcore: registered new interface driver usbfs
[ 0.572479] usbcore: registered new interface driver hub
[ 0.572540] usbcore: registered new device driver usb
[ 0.574564] usbcore: registered new interface driver usb-storage
[ 0.586362] ACPI: bus type drm_connector registered
[ 0.594849] Loading boot drivers: ok.
[ 0.596125] Mounting boot media...
[ 0.610101] xhci_hcd 0000:00:11.0: xHCI Host Controller
[ 0.610146] xhci_hcd 0000:00:11.0: new USB bus registered, assigned bus number 1
[ 0.610292] xhci_hcd 0000:00:11.0: hcc params 0x02600001 hci version 0x110 quirks 0x0000000000000010
[ 0.610688] xhci_hcd 0000:00:11.0: xHCI Host Controller
[ 0.610737] xhci_hcd 0000:00:11.0: new USB bus registered, assigned bus number 2
[ 0.610786] xhci_hcd 0000:00:11.0: Host supports USB 3.1 Enhanced SuperSpeed
[ 0.610965] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002, bcdDevice= 6.01
[ 0.611019] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.611045] usb usb1: Product: xHCI Host Controller
[ 0.611060] usb usb1: Manufacturer: Linux 6.1.55-0-virt xhci-hcd
[ 0.611084] usb usb1: SerialNumber: 0000:00:11.0
[ 0.611222] hub 1-0:1.0: USB hub found
[ 0.611284] hub 1-0:1.0: 8 ports detected
[ 0.611628] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[ 0.611785] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003, bcdDevice= 6.01
[ 0.611820] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[ 0.611838] usb usb2: Product: xHCI Host Controller
[ 0.611861] usb usb2: Manufacturer: Linux 6.1.55-0-virt xhci-hcd
[ 0.611885] usb usb2: SerialNumber: 0000:00:11.0
[ 0.611990] hub 2-0:1.0: USB hub found
[ 0.612054] hub 2-0:1.0: 8 ports detected
[ 0.614693] fuse: init (API version 7.37)
[ 0.619225] virtio_blk virtio2: 1/0/0 default/read/poll queues
[ 0.619607] virtio_blk virtio2: [vda] 125829120 512-byte logical blocks (64.4 GB/60.0 GiB)
[ 0.619926] vda: vda1
[ 0.620088] virtio_blk virtio3: 1/0/0 default/read/poll queues
[ 0.620362] virtio_blk virtio3: [vdb] 74376 512-byte logical blocks (38.1 MB/36.3 MiB)
[ 0.738962] EXT4-fs (vda1): orphan cleanup on readonly fs
[ 0.739611] EXT4-fs (vda1): mounted filesystem with ordered data mode. Quota mode: none.
[ 0.743813] EXT4-fs (vda1): unmounting filesystem.
[ 0.904964] usb 1-1: new full-speed USB device number 2 using xhci_hcd
[ 1.085879] usb 1-1: New USB device found, idVendor=05ac, idProduct=8105, bcdDevice= 0.00
[ 1.086126] usb 1-1: New USB device strings: Mfr=2, Product=3, SerialNumber=0
[ 1.086211] usb 1-1: Product: Virtual USB Keyboard
[ 1.086261] usb 1-1: Manufacturer: Apple Inc.
[ 1.091487] hid: raw HID events driver (C) Jiri Kosina
[ 1.093878] usbcore: registered new interface driver usbhid
[ 1.093984] usbhid: USB HID core driver
[ 1.095706] usbcore: registered new interface driver usbkbd
[ 1.097868] input: Apple Inc. Virtual USB Keyboard as /devices/pci0000:00/0000:00:11.0/usb1/1-1/1-1:1.0/0003:05AC:8105.0001/input/input0
[ 1.161488] hid-generic 0003:05AC:8105.0001: input,hidraw0: USB HID v1.10 Keyboard [Apple Inc. Virtual USB Keyboard] on usb-0000:00:11.0-1/input0
[ 1.232028] usb 2-1: new SuperSpeed USB device number 2 using xhci_hcd
[ 1.271981] usb 2-1: New USB device found, idVendor=05ac, idProduct=1503, bcdDevice= 0.00
[ 1.272058] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1.272105] usb 2-1: Product: Virtual USB Mass Storage Device
[ 1.272143] usb 2-1: Manufacturer: Apple Inc.
[ 1.272641] usb-storage 2-1:1.0: USB Mass Storage device detected
[ 1.273077] scsi host0: usb-storage 2-1:1.0
[ 1.274665] usbcore: registered new interface driver uas
[ 1.422925] usb 1-2: new full-speed USB device number 3 using xhci_hcd
[ 1.604698] usb 1-2: New USB device found, idVendor=05ac, idProduct=8106, bcdDevice= 0.00
[ 1.604848] usb 1-2: New USB device strings: Mfr=2, Product=3, SerialNumber=0
[ 1.604901] usb 1-2: Product: Virtual USB Digitizer
[ 1.604926] usb 1-2: Manufacturer: Apple Inc.
[ 1.606042] input: Apple Inc. Virtual USB Digitizer as /devices/pci0000:00/0000:00:11.0/usb1/1-2/1-2:1.0/0003:05AC:8106.0002/input/input1
[ 1.606264] hid-generic 0003:05AC:8106.0002: input,hidraw1: USB HID v1.10 Mouse [Apple Inc. Virtual USB Digitizer] on usb-0000:00:11.0-2/input0
[ 2.336469] scsi 0:0:0:0: Direct-Access Apple Virtual Disk 1 PQ: 0 ANSI: 6
[ 2.337977] sd 0:0:0:0: [sda] 610768 512-byte logical blocks: (313 MB/298 MiB)
[ 2.338301] sd 0:0:0:0: [sda] Write Protect is on
[ 2.338557] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 2.349214] sda: sda1 sda2 sda3
[ 2.349705] sd 0:0:0:0: [sda] Attached SCSI disk
[ 2.418176] Mounting boot media: ok.
[ 2.419587] Loading user settings from /media/sda/alpine.apkovl.tar.gz...
[ 4.377025] Loading user settings from /media/sda/alpine.apkovl.tar.gz: ok.
[ 4.391957] Installing packages to root filesystem...
[ 5.648322] Installing packages to root filesystem: ok.

Welcome to Alpine Linux 3.18

Kernel 6.1.55-0-virt on an aarch64 (/dev/hvc0)

colima login:
```

`~/.lima/colima/ha.stderr.log`

```
{"level":"debug","msg":"Creating iso file /Users/mopeneko/.lima/colima/cidata.iso","time":"2023-11-06T11:49:56+09:00"}
{"level":"debug","msg":"Using /var/folders/vp/hf92801n27j5mt3szkqbqh9h0000gn/T/diskfs_iso3736860871 as workspace","time":"2023-11-06T11:49:56+09:00"}
{"level":"debug","msg":"Failed to detect CPU features. Assuming that AES acceleration is available on this Apple silicon.","time":"2023-11-06T11:49:56+09:00"}
{"level":"debug","msg":"OpenSSH version 9.4.1 detected","time":"2023-11-06T11:49:56+09:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing aes128-gcm@openssh.com and aes256-gcm@openssh.com","time":"2023-11-06T11:49:56+09:00"}
{"level":"info","msg":"hostagent socket created at /Users/mopeneko/.lima/colima/ha.sock","time":"2023-11-06T11:49:56+09:00"}
{"level":"info","msg":"Starting VZ (hint: to watch the boot progress, see \"/Users/mopeneko/.lima/colima/serial*.log\")","time":"2023-11-06T11:49:56+09:00"}
{"level":"debug","msg":"Using search domains: [flets-east.jp]","time":"2023-11-06T11:49:56+09:00"}
{"level":"info","msg":"new connection from to ","time":"2023-11-06T11:49:57+09:00"}
{"level":"info","msg":"Setting up Rosetta share","time":"2023-11-06T11:49:57+09:00"}
{"level":"debug","msg":"[VZ] - vm state change: \"VirtualMachineStateStarting\"","time":"2023-11-06T11:49:57+09:00"}
{"level":"info","msg":"[VZ] - vm state change: running","time":"2023-11-06T11:49:57+09:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 3: \"ssh\"","time":"2023-11-06T11:49:57+09:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2023-11-06T11:49:57+09:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/mopeneko/.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=mopeneko -o ControlMaster=auto -o ControlPath=\"/Users/mopeneko/.lima/colima/ssh.sock\" -o ControlPersist=yes -p 55907 127.0.0.1 -- /bin/bash]","time":"2023-11-06T11:49:57+09:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 55907: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 55907: Connection refused\\r\\n\": exit status 255","time":"2023-11-06T11:49:57+09:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 3: \"ssh\"","time":"2023-11-06T11:50:07+09:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2023-11-06T11:50:07+09:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/mopeneko/.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=mopeneko -o ControlMaster=auto -o ControlPath=\"/Users/mopeneko/.lima/colima/ssh.sock\" -o ControlPersist=yes -p 55907 127.0.0.1 -- /bin/bash]","time":"2023-11-06T11:50:07+09:00"}
2023/11/06 11:50:08 tcpproxy: for incoming conn 127.0.0.1:55909, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: connection was refused
{"level":"debug","msg":"stdout=\"\", stderr=\"kex_exchange_identification: read: Connection reset by peer\\r\\nConnection reset by 127.0.0.1 port 55907\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"kex_exchange_identification: read: Connection reset by peer\\r\\nConnection reset by 127.0.0.1 port 55907\\r\\n\": exit status 255","time":"2023-11-06T11:50:08+09:00"}
{"level":"error","msg":"dhcp: unhandled message type: RELEASE","time":"2023-11-06T11:50:10+09:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 3: \"ssh\"","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/mopeneko/.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=mopeneko -o ControlMaster=auto -o ControlPath=\"/Users/mopeneko/.lima/colima/ssh.sock\" -o ControlPersist=yes -p 55907 127.0.0.1 -- /bin/bash]","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"\", err=\u003cnil\u003e","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"The essential requirement 1 of 3 is satisfied","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"Waiting for the essential requirement 2 of 3: \"user session is ready for ssh\"","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"executing script \"user session is ready for ssh\"","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"executing ssh for script \"user session is ready for ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/mopeneko/.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=mopeneko -o ControlMaster=auto -o ControlPath=\"/Users/mopeneko/.lima/colima/ssh.sock\" -o ControlPersist=yes -p 55907 127.0.0.1 -- /bin/bash]","time":"2023-11-06T11:50:18+09: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":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"The essential requirement 2 of 3 is satisfied","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"Waiting for the essential requirement 3 of 3: \"the guest agent to be running\"","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"executing script \"the guest agent to be running\"","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"executing ssh for script \"the guest agent to be running\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/mopeneko/.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=mopeneko -o ControlMaster=auto -o ControlPath=\"/Users/mopeneko/.lima/colima/ssh.sock\" -o ControlPersist=yes -p 55907 127.0.0.1 -- /bin/bash]","time":"2023-11-06T11:50:18+09: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":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"The essential requirement 3 of 3 is satisfied","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"Waiting for the final requirement 1 of 1: \"boot scripts must have finished\"","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"executing script \"boot scripts must have finished\"","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"Forwarding unix sockets","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"Forwarding \"/var/run/docker.sock\" (guest) to \"/Users/mopeneko/.colima/default/docker.sock\" (host)","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"executing ssh for script \"boot scripts must have finished\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/mopeneko/.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=mopeneko -o ControlMaster=auto -o ControlPath=\"/Users/mopeneko/.lima/colima/ssh.sock\" -o ControlPersist=yes -p 55907 127.0.0.1 -- /bin/bash]","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"Forwarding \"/var/run/docker.sock\" (guest) to \"/Users/mopeneko/.colima/docker.sock\" (host)","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"Forwarding \"/run/lima-guestagent.sock\" (guest) to \"/Users/mopeneko/.lima/colima/ga.sock\" (host)","time":"2023-11-06T11:50:18+09: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":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"The final requirement 1 of 1 is satisfied","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"guest agent info: \u0026{LocalPorts:[{IP:0.0.0.0 Port:22} {IP::: Port:22}]}","time":"2023-11-06T11:50:18+09:00"}
{"level":"debug","msg":"guest agent event: {Time:2023-11-06 02:50:17.954327755 +0000 UTC LocalPortsAdded:[{IP:0.0.0.0 Port:22} {IP::: Port:22}] LocalPortsRemoved:[] Errors:[]}","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"Not forwarding TCP 0.0.0.0:22","time":"2023-11-06T11:50:18+09:00"}
{"level":"info","msg":"Not forwarding TCP [::]:22","time":"2023-11-06T11:50:18+09:00"}

```

`~/.lima/colima/ha.stdout.log`

```
{"time":"2023-11-06T11:49:57.11504+09:00","status":{"sshLocalPort":55907}}
{"time":"2023-11-06T11:50:18.366432+09:00","status":{"running":true,"sshLocalPort":55907}}

```

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.