Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error starting with --network-address #458

Open
1 of 3 tasks
liaden opened this issue Oct 27, 2022 · 57 comments · Fixed by #459
Open
1 of 3 tasks

Error starting with --network-address #458

liaden opened this issue Oct 27, 2022 · 57 comments · Fixed by #459

Comments

@liaden
Copy link

liaden commented Oct 27, 2022

Description

Attempting to start --network-address fails. Additional starts without the flag fail with a different error message. Removing ~/.colima allows for a successful start, without the network address.

Version

Colima Version: 0.4.6
Lima Version: 0.12.0, 0.13.0
Qemu Version: 7.1.0

Operating System

  • macOS Intel
  • macOS M1
  • Linux

Reproduction Steps

  1. colima start --network-address

Expected behaviour

Colima starts correctly.

Additional context

First start:

INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
WARN[0015] error starting network: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status default], output: "time=\"2022-10-27T09:57:15-04:00\" level=fatal msg=\"pid file not found: stat /Users/joel.johnson/.colima/default/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
INFO[0015] creating and starting ...                     context=vm
WARN[0015] error setting up routable IP address: vmnet ptp socket file not found: stat /Users/joel.johnson/.colima/default/daemon/vmnet.ptp: no such file or directory
> Using cache "/Users/joel.johnson/Library/Caches/lima/download/by-url-sha256/e9bac04e9bdb31be4d3de1506d97eb60d59d9ad1a2d97f2b21f760e06f3e4408/data"
> [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/joel.johnson/.lima/colima/serial.log")
> SSH Local Port: 57347
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] QEMU has exited
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/joel.johnson/.lima/colima/ha.stderr.log")
FATA[0017] error starting vm: error at 'creating and starting': exit status 1

ha.stderr.log:

{"level":"debug","msg":"Creating iso file /Users/joel.johnson/.lima/colima/cidata.iso","time":"2022-10-27T09:57:15-04:00"}
{"level":"debug","msg":"Using /var/folders/1n/fvnyc01554s0240g36s382jh6nvfqs/T/diskfs_iso413631167 as workspace","time":"2022-10-27T09:57:15-04:00"}
{"level":"debug","msg":"firmware candidates = [/Users/joel.johnson/.local/share/qemu/edk2-aarch64-code.fd /Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/share/qemu/edk2-aarch64-code.fd /usr/share/AAVMF/AAVMF_CODE.fd /usr/share/qemu-efi-aarch64/QEMU_EFI.fd]","time":"2022-10-27T09:57:17-04:00"}
{"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-10-27T09:57:17-04:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-10-27T09:57:17-04:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/joel.johnson/.lima/colima/serial.log\")","time":"2022-10-27T09:57:17-04:00"}
{"level":"debug","msg":"qCmd.Args: [/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/bin/qemu-system-aarch64 -m 2048 -cpu host -machine virt,accel=hvf,highmem=off -smp 2,sockets=1,cores=2,threads=1 -drive if=pflash,format=raw,readonly=on,file=/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/share/qemu/edk2-aarch64-code.fd -boot order=d,splash-time=0,menu=on -drive file=/Users/joel.johnson/.lima/colima/basedisk,media=cdrom,readonly=on -drive file=/Users/joel.johnson/.lima/colima/diffdisk,if=virtio,discard=on -cdrom /Users/joel.johnson/.lima/colima/cidata.iso -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:57347-:22 -device virtio-net-pci,netdev=net0,mac=52:55:55:56:07:0a -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/joel.johnson/.lima/colima/serial.sock,server=on,wait=off,logfile=/Users/joel.johnson/.lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-qmp,path=/Users/joel.johnson/.lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-colima -pidfile /Users/joel.johnson/.lima/colima/qemu.pid]","time":"2022-10-27T09:57:17-04:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2022-10-27T09:57:17-04:00"}
{"level":"debug","msg":"qemu[stderr]: time=\"2022-10-27T09:57:17-04:00\" level=fatal msg=\"dial unix /Users/joel.johnson/.colima/default/daemon/gvproxy.sock: connect: no such file or directory\"","time":"2022-10-27T09:57:17-04:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2022-10-27T09:57:17-04:00"}
{"error":"exit status 1","level":"info","msg":"QEMU has exited","time":"2022-10-27T09:57:17-04:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/joel.johnson/.lima/_config/user\" -o IdentityFile=\"/Users/joel.johnson/.ssh/id_ed25519\" -o IdentityFile=\"/Users/joel.johnson/.ssh/id_rsa\" -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=\"^[email protected],[email protected]\" -o User=lima -o ControlMaster=auto -o ControlPath=\"/Users/joel.johnson/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 57347 127.0.0.1 -- /bin/bash]","time":"2022-10-27T09:57:17-04:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 57347: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 57347: Connection refused\\r\\n\": exit status 255","time":"2022-10-27T09:57:17-04:00"}

Second start:

INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
WARN[0015] error starting network: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status default], output: "time=\"2022-10-27T10:01:35-04:00\" level=fatal msg=\"pid file not found: stat /Users/joel.johnson/.colima/default/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
WARN[0015] error setting up routable IP address: vmnet ptp socket file not found: stat /Users/joel.johnson/.colima/default/daemon/vmnet.ptp: no such file or directory
INFO[0015] starting ...                                  context=vm
> Using the existing instance "colima"
> [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/joel.johnson/.lima/colima/serial.log")
> SSH Local Port: 57370
> [hostagent] QEMU has exited
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/joel.johnson/.lima/colima/ha.stderr.log")
FATA[0017] error starting vm: error at 'starting': exit status 1

which is obviously due to the colima.yaml being updated with the --network-address flag.

@abiosoft
Copy link
Owner

Are you on macOS Ventura as well? If yes, we can close this in favour of #457

@abiosoft
Copy link
Owner

Can you kindly try with the current development version?

brew install --HEAD colima

@liaden
Copy link
Author

liaden commented Oct 30, 2022

@abiosoft I am not on Ventura. It still errors after upgrading. Results are below.

console logging:

TRAC[0000] cmd ["limactl" "info"]
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
INFO[0000] starting colima
INFO[0000] runtime: docker
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
INFO[0000] preparing network ...                         context=vm
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "start" "default" "--vmnet" "--gvproxy" "--verbose"]
TRAC[0000] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0003] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0006] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0009] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0012] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0015] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
WARN[0015] error starting network: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status default], output: "time=\"2022-10-30T12:42:10-04:00\" level=fatal msg=\"pid file not found: stat /Users/joel.johnson/.colima/default/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
WARN[0015] error setting up routable IP address: vmnet socket file not found: stat /Users/joel.johnson/.colima/default/daemon/vmnet.sock: no such file or directory
INFO[0015] starting ...                                  context=vm
TRAC[0015] cmd ["limactl" "start" "colima"]
> Using the existing instance "colima"
> [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/joel.johnson/.lima/colima/serial.log")
> SSH Local Port: 51585
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] QEMU has exited
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/joel.johnson/.lima/colima/ha.stderr.log")
FATA[0017] error starting vm: error at 'starting': exit status 1

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

{"level":"debug","msg":"Creating iso file /Users/joel.johnson/.lima/colima/cidata.iso","time":"2022-10-30T12:42:10-04:00"}
{"level":"debug","msg":"Using /var/folders/1n/fvnyc01554s0240g36s382jh6nvfqs/T/diskfs_iso3203651481 as workspace","time":"2022-10-30T12:42:10-04:00"}
{"level":"debug","msg":"firmware candidates = [/Users/joel.johnson/.local/share/qemu/edk2-aarch64-code.fd /Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/share/qemu/edk2-aarch64-code.fd /usr/share/AAVMF/AAVMF_CODE.fd /usr/share/qemu-efi-aarch64/QEMU_EFI.fd]","time":"2022-10-30T12:42:11-04:00"}
{"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-10-30T12:42:11-04:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-10-30T12:42:11-04:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/joel.johnson/.lima/colima/serial.log\")","time":"2022-10-30T12:42:11-04:00"}
{"level":"debug","msg":"qCmd.Args: [/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/bin/qemu-system-aarch64 -m 2048 -cpu host -machine virt,accel=hvf,highmem=off -smp 2,sockets=1,cores=2,threads=1 -drive if=pflash,format=raw,readonly=on,file=/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/share/qemu/edk2-aarch64-code.fd -boot order=d,splash-time=0,menu=on -drive file=/Users/joel.johnson/.lima/colima/basedisk,media=cdrom,readonly=on -drive file=/Users/joel.johnson/.lima/colima/diffdisk,if=virtio,discard=on -cdrom /Users/joel.johnson/.lima/colima/cidata.iso -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:51585-:22 -device virtio-net-pci,netdev=net0,mac=52:55:55:56:07:0a -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/joel.johnson/.lima/colima/serial.sock,server=on,wait=off,logfile=/Users/joel.johnson/.lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-qmp,path=/Users/joel.johnson/.lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-colima -pidfile /Users/joel.johnson/.lima/colima/qemu.pid]","time":"2022-10-30T12:42:11-04:00"}
{"level":"debug","msg":"qemu[stderr]: time=\"2022-10-30T12:42:12-04:00\" level=fatal msg=\"error connecting to gvproxy socket: dial unix /Users/joel.johnson/.colima/default/daemon/gvproxy.sock: connect: no such file or directory\"","time":"2022-10-30T12:42:12-04:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2022-10-30T12:42:12-04:00"}
{"error":"exit status 1","level":"info","msg":"QEMU has exited","time":"2022-10-30T12:42:12-04:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2022-10-30T12:42:12-04:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/joel.johnson/.lima/_config/user\" -o IdentityFile=\"/Users/joel.johnson/.ssh/id_ed25519\" -o IdentityFile=\"/Users/joel.johnson/.ssh/id_rsa\" -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=\"^[email protected],[email protected]\" -o User=lima -o ControlMaster=auto -o ControlPath=\"/Users/joel.johnson/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 51585 127.0.0.1 -- /bin/bash]","time":"2022-10-30T12:42:12-04:00"}

@abiosoft
Copy link
Owner

This is very strange.

Can you start again with network address to reproduce the error and share the contents of the daemon directory?

ls -lah ~/.colima/default/daemon

@liaden
Copy link
Author

liaden commented Oct 31, 2022

ls -lah ~/.colima/default/daemon

total 4.0K
drwxr-xr-x 3 joel.johnson 387623102   96 Oct 30 12:41 .
drwxr-xr-x 4 joel.johnson 387623102  128 Oct 30 12:39 ..
-rw-r--r-- 1 joel.johnson 387623102 1.6K Oct 30 12:41 daemon.log

cat ~/.colima/default/daemon/daemon.log

time="2022-10-30T12:39:30-04:00" level=info msg="- - - - - - - - - - - - - - -"
time="2022-10-30T12:39:30-04:00" level=info msg="daemon started by colima"
time="2022-10-30T12:39:30-04:00" level=info msg="Run `pkill -F /Users/joel.johnson/.colima/default/daemon/daemon.pid` to kill the daemon"
time="2022-10-30T12:39:30-04:00" level=info msg="waiting for clients..."
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
time="2022-10-30T12:39:30-04:00" level=error msg="error starting vmnet: error running vmnet: exit status 1"
time="2022-10-30T12:39:30-04:00" level=info msg="terminate signal received"
time="2022-10-30T12:39:30-04:00" level=fatal msg="context canceled"
time="2022-10-30T12:41:55-04:00" level=info msg="- - - - - - - - - - - - - - -"
time="2022-10-30T12:41:55-04:00" level=info msg="daemon started by colima"
time="2022-10-30T12:41:55-04:00" level=info msg="Run `pkill -F /Users/joel.johnson/.colima/default/daemon/daemon.pid` to kill the daemon"
time="2022-10-30T12:41:55-04:00" level=info msg="waiting for clients..."
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
time="2022-10-30T12:41:55-04:00" level=error msg="error starting vmnet: error running vmnet: exit status 1"
time="2022-10-30T12:41:55-04:00" level=info msg="terminate signal received"
time="2022-10-30T12:41:55-04:00" level=fatal msg="context canceled"

@abiosoft
Copy link
Owner

abiosoft commented Nov 1, 2022

Does it prompt you for a password for setting up network?
Can you deleted the permission file and the extracted network files, then try again?

sudo rm -r /etc/sudoers.d/colima /opt/colima

@liaden
Copy link
Author

liaden commented Nov 1, 2022

It did not prompt me for sudo. It has before, but even after the suggested command, it is not prompting.

@abiosoft
Copy link
Owner

abiosoft commented Nov 1, 2022

Oops, I made a typo in the command. I've fixed it now.

@Rajendraladkat1919
Copy link

Hey can you do one thing.

  1. Just uninstall the colima and docker cli.
  2. remove all .docker , .limb, .colima from the host machine.
  3. install the latest colima and docker-cli usging brew.
  4. colima start --network-address
  5. Above command will prompt you for the password.

@liaden
Copy link
Author

liaden commented Nov 10, 2022

Reran with the above steps plus removing /etc/sudoers.d/colima and /opt/colima. It failed same as before, but it did prompt for sudo.

STDOUT:

TRAC[0000] cmd ["limactl" "info"]
TRAC[0000] cmd ["limactl" "list" "colima" "--json"]
TRAC[0000] error retrieving running instance: error retrieving instance: unexpected end of JSON input
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] dependencies missing for setting up reachable IP address  context=vm
INFO[0000] sudo password may be required                 context=vm
TRAC[0000] cmd int ["sudo" "mkdir" "-p" "/etc/sudoers.d"]
Password:
TRAC[0008] cmd int ["sudo" "sh" "-c" "cat > /etc/sudoers.d/colima"]
TRAC[0008] cmd int ["sudo" "mkdir" "-p" "/opt/colima"]
TRAC[0008] cmd int ["sudo" "sh" "-c" "cd /opt/colima && tar xfz /var/folders/1n/fvnyc01554s0240g36s382jh6nvfqs/T/vmnet.tar.gz2890914088 2>/dev/null"]
TRAC[0008] cmd int ["sudo" "mkdir" "-p" "/opt/colima/run"]
TRAC[0008] cmd ["ln" "-sf" "/opt/homebrew/bin/colima" "/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/bin/qemu-system-aarch64"]
TRAC[0008] cmd ["ln" "-sf" "/opt/homebrew/bin/colima" "/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/bin/qemu-system-x86_64"]
TRAC[0008] cmd ["ln" "-sf" "/opt/homebrew/share" "/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/share"]
TRAC[0008] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0008] cmd ["/opt/homebrew/bin/colima" "daemon" "start" "default" "--vmnet" "--gvproxy" "--verbose"]
TRAC[0008] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0011] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0014] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0017] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0020] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
TRAC[0023] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "default"]
WARN[0023] error setting up network dependencies: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status default], output: "time=\"2022-11-10T13:49:37-05:00\" level=fatal msg=\"pid file not found: stat /Users/joel.johnson/.colima/default/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
INFO[0023] creating and starting ...                     context=vm
WARN[0023] error setting up routable IP address: vmnet socket file not found: stat /Users/joel.johnson/.colima/default/daemon/vmnet.sock: no such file or directory
TRAC[0023] cmd ["limactl" "start" "--tty=false" "/var/folders/1n/fvnyc01554s0240g36s382jh6nvfqs/T/colima.yaml"]
> Terminal is not available, proceeding without opening an editor
> "Attempting to download the image from \"https://github.com/abiosoft/alpine-lima/releases/download/colima-v0.4.5-1/alpine-lima-clm-3.16.2-aarch64.iso\"" digest="sha512:a79cdb3de4b297ddbc944f9f5de18ea34697b122facc94c7048324267929c19c4502fee8d2495f11f77867e2629dc721feed487affc96025212b0cccd49b28d1"
> Using cache "/Users/joel.johnson/Library/Caches/lima/download/by-url-sha256/e9bac04e9bdb31be4d3de1506d97eb60d59d9ad1a2d97f2b21f760e06f3e4408/data"
> [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/joel.johnson/.lima/colima/serial.log")
> SSH Local Port: 64794
> [hostagent] QEMU has exited
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/joel.johnson/.lima/colima/ha.stderr.log")
FATA[0026] error starting vm: error at 'creating and starting': exit status 1

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

{"level":"debug","msg":"executing [ssh-keygen -t ed25519 -q -N  -f /Users/joel.johnson/.lima/_config/user]","time":"2022-11-10T13:49:38-05:00"}
{"level":"debug","msg":"Creating iso file /Users/joel.johnson/.lima/colima/cidata.iso","time":"2022-11-10T13:49:38-05:00"}
{"level":"debug","msg":"Using /var/folders/1n/fvnyc01554s0240g36s382jh6nvfqs/T/diskfs_iso2155425194 as workspace","time":"2022-11-10T13:49:38-05:00"}
{"level":"debug","msg":"firmware candidates = [/Users/joel.johnson/.local/share/qemu/edk2-aarch64-code.fd /Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/share/qemu/edk2-aarch64-code.fd /usr/share/AAVMF/AAVMF_CODE.fd /usr/share/qemu-efi-aarch64/QEMU_EFI.fd]","time":"2022-11-10T13:49:39-05:00"}
{"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-11-10T13:49:39-05:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing [email protected] and [email protected]","time":"2022-11-10T13:49:39-05:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/joel.johnson/.lima/colima/serial.log\")","time":"2022-11-10T13:49:39-05:00"}
{"level":"debug","msg":"qCmd.Args: [/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/bin/qemu-system-aarch64 -m 2048 -cpu host -machine virt,accel=hvf,highmem=off -smp 2,sockets=1,cores=2,threads=1 -drive if=pflash,format=raw,readonly=on,file=/Users/joel.johnson/.colima/_wrapper/3a9197e1ca3cd2da076da2b473d7a7eb118e2cca/share/qemu/edk2-aarch64-code.fd -boot order=d,splash-time=0,menu=on -drive file=/Users/joel.johnson/.lima/colima/basedisk,media=cdrom,readonly=on -drive file=/Users/joel.johnson/.lima/colima/diffdisk,if=virtio,discard=on -cdrom /Users/joel.johnson/.lima/colima/cidata.iso -netdev user,id=net0,net=192.168.5.0/24,dhcpstart=192.168.5.15,hostfwd=tcp:127.0.0.1:64794-:22 -device virtio-net-pci,netdev=net0,mac=52:55:55:56:07:0a -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/joel.johnson/.lima/colima/serial.sock,server=on,wait=off,logfile=/Users/joel.johnson/.lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-qmp,path=/Users/joel.johnson/.lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-colima -pidfile /Users/joel.johnson/.lima/colima/qemu.pid]","time":"2022-11-10T13:49:39-05:00"}
{"level":"debug","msg":"qemu[stderr]: time=\"2022-11-10T13:49:39-05:00\" level=fatal msg=\"error connecting to gvproxy socket: dial unix /Users/joel.johnson/.colima/default/daemon/gvproxy.sock: connect: no such file or directory\"","time":"2022-11-10T13:49:39-05:00"}
{"error":"exit status 1","level":"info","msg":"QEMU has exited","time":"2022-11-10T13:49:39-05:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2022-11-10T13:49:39-05:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2022-11-10T13:49:39-05:00"}

~/.colima/default/daemon/daemon.log

time="2022-11-10T13:49:22-05:00" level=info msg="- - - - - - - - - - - - - - -"
time="2022-11-10T13:49:22-05:00" level=info msg="daemon started by colima"
time="2022-11-10T13:49:22-05:00" level=info msg="Run `pkill -F /Users/joel.johnson/.colima/default/daemon/daemon.pid` to kill the daemon"
time="2022-11-10T13:49:22-05:00" level=info msg="Using search domains: [omada.me omadahealth.net]"
time="2022-11-10T13:49:22-05:00" level=info msg="waiting for clients..."
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
time="2022-11-10T13:49:22-05:00" level=error msg="error starting vmnet: error running vmnet: exit status 1"
time="2022-11-10T13:49:22-05:00" level=info msg="terminate signal received"
time="2022-11-10T13:49:22-05:00" level=fatal msg="context canceled"

@codrutpopescu
Copy link

I have the same issue on Ventura M1. The colima version with --HEAD option colima does start but there is no IP address assigned.

@codrutpopescu
Copy link

Here is my daemon.log if it helps:

time="2022-11-11T21:40:10+01:00" level=info msg="- - - - - - - - - - - - - - -"
time="2022-11-11T21:40:10+01:00" level=info msg="daemon started by colima"
time="2022-11-11T21:40:10+01:00" level=info msg="Run `pkill -F /Users/codrut/.colima/oraxe/daemon/daemon.pid` to kill the daemon"
time="2022-11-11T21:40:10+01:00" level=info msg="waiting for clients..."
dyld[41864]: Library not loaded: /opt/colima/lib/libvdeplug.3.dylib
  Referenced from: <E0AE3F70-E540-36C8-9DA8-6846A194A2E7> /opt/colima/bin/vde_vmnet
  Reason: tried: '/opt/colima/lib/libvdeplug.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64e', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/colima/lib/libvdeplug.3.dylib' (no such file), '/opt/colima/lib/libvdeplug.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64e', need 'arm64')), '/usr/local/lib/libvdeplug.3.dylib' (no such file), '/usr/lib/libvdeplug.3.dylib' (no such file, not in dyld cache)
time="2022-11-11T21:40:10+01:00" level=error msg="error starting vmnet: error running vmnet: signal: abort trap"
time="2022-11-11T21:40:10+01:00" level=info msg="terminate signal received"
time="2022-11-11T21:40:10+01:00" level=fatal msg="context canceled"

@rfay
Copy link
Contributor

rfay commented Nov 11, 2022

Reason: tried: '/opt/colima/lib/libvdeplug.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64e', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/colima/lib/libvdeplug.3.dylib' (no such file), '/opt/colima/lib/libvdeplug.3.dylib' (mach-o file, but is an incompatible architecture (have 'arm64e', need 'arm64')), '/usr/local/lib/libvdeplug.3.dylib' (no such file), '/usr/lib/libvdeplug.3.dylib' (no such file, not in dyld cache)

You just can't run that image, as it has an incompatible architecture, whatever arm64e is.

Really, oracle mysql image isn't going to work for you on an arm64 (mac M1) machine.

@codrutpopescu
Copy link

codrutpopescu commented Nov 11, 2022

Sorry, the above error is without installing using --HEAD.
I am not using mysql. This is simply colima. Here are the steps:

brew uninstall colima docker docker-compose qemu
brew autoremove
brew cleanup
sudo rm -rf /opt/colima
rm -rf .docker .lima .colima

brew install --HEAD colima docker docker-compose
colima start --arch x86_64 --memory 4 --network-address oraxe

colima list
PROFILE    STATUS     ARCH      CPUS    MEMORY    DISK     RUNTIME    ADDRESS
oraxe      Running    x86_64    2       4GiB      60GiB    docker     

as you can see there is no IP address assigned

cat .colima/oraxe/daemon/daemon.log
time="2022-11-11T22:27:34+01:00" level=info msg="- - - - - - - - - - - - - - -"
time="2022-11-11T22:27:34+01:00" level=info msg="daemon started by colima"
time="2022-11-11T22:27:34+01:00" level=info msg="Run `pkill -F /Users/codrut/.colima/oraxe/daemon/daemon.pid` to kill the daemon"
time="2022-11-11T22:27:34+01:00" level=info msg="waiting for clients..."
on_accept(): vmnet_return_t VMNET_INVALID_ARGUMENT
vmnet_write: Undefined error: 0
time="2022-11-11T22:27:37+01:00" level=info msg="new connection from  to /Users/codrut/.colima/oraxe/daemon/gvproxy.sock"

@rfay
Copy link
Contributor

rfay commented Nov 11, 2022

Sorry, I did read it wrong, usually this is seen with oracle. But the problem is the same. You seem to be trying to use an architecture arm64e, please change that in your config file to arm64. AFAIK arm64e not even a valid architecture. (I guess I saw "oraexe" and thought I read oracle).

To recreate your situation, rename the .colima folder to .colima.bak and the lima folder to .lima.bak and then go through your process.

@abiosoft
Copy link
Owner

@altitudedashboard the error you shared should be gone with --HEAD.

Can you try starting with --network-driver slirp and see if it's same behaviour (using the --HEAD version)?

@codrutpopescu
Copy link

@abiosoft This works! Thank you!
Steps followed:
clean everything:

brew uninstall qemu lima colima docker docker-compose
brew autoremove
brew cleanup
sudo rm -rf /opt/colima
rm -rf /opt/homebrew/etc/gnutls
rm -rf /opt/homebrew/etc/unbound
rm -rf .lima .colima .docker

starts from scratch:

brew install qemu lima docker docker-compose
mkdir -p ~/.docker/cli-plugins
ln -sfn /opt/homebrew/opt/docker-compose/bin/docker-compose ~/.docker/cli-plugins/docker-compose
brew install --HEAD colima
colima start --arch x86_64 --memory 4 --network-driver slirp --network-address oraxe
colima list                                                                         
PROFILE    STATUS     ARCH      CPUS    MEMORY    DISK     RUNTIME    ADDRESS
oraxe      Running    x86_64    2       4GiB      60GiB    docker     192.168.106.2

@codrutpopescu
Copy link

The above seems to work intermittently, as today trying to start colima doesn't revel an IP address

@sparhomenko
Copy link

sparhomenko commented Nov 14, 2022

Have the same problem on the latest (13.0.1) macOS and M1.

$ colima stop
$ colima delete -f
$ brew uninstall colima
$ brew autoremove
$ sudo rm -rf .lima .colima /etc/sudoers.d/colima /opt/colima
$ brew install --HEAD colima
$ colima start --network-address
$ colima list
PROFILE    STATUS     ARCH       CPUS    MEMORY    DISK     RUNTIME    ADDRESS
default    Running    aarch64    2       2GiB      60GiB    docker
$ cat ~/.colima/default/daemon/daemon.log
...
on_accept(): vmnet_return_t VMNET_INVALID_ARGUMENT
vmnet_write: Undefined error: 0

Having the same error with all combinations of runtimes and network drivers (--runtime containerd --network-driver slirp, --runtime docker --network-driver slirp, --runtime containerd --network-driver gvproxy, --runtime docker --network-driver gvproxy).

@codrutpopescu
Copy link

just try also with the latest colima version:

brew install --HEAD colima

and also perform a reinstall of qemu after colima as it might fix some bugs

brew reinstall qemu

@abiosoft
Copy link
Owner

@sparhomenko kindly use the --HEAD version. macOS Ventura has broken network address assignment in v0.4.6.

@sparhomenko
Copy link

Apologies, I should have mentioned that I was already using HEAD with the latest commit:

$ brew upgrade colima
Warning: colima HEAD-412d01b already installed

Reinstalling qemu also doesn't help (I was actually already doing that as brew autoremove removed qemu and brew install --HEAD colima reinstalled it).
Perhaps there are any additional debug logs I can enable to provide more information?

@melnyk-viktor
Copy link

melnyk-viktor commented Dec 7, 2022

Having a similar problem...
Clearing and reinstalling/updating (with dependencies) didn't help.

@godfrey-philip
Copy link

I am also having the same problem, my logs are exactly the same however wiping the directories and reinstalling from HEAD works "intermittently" as described above but to the negative. Meaning: if I blow it all away and start over sometimes it errors out completely and sometimes it starts with no routable IP, I am not able to get a valid IP at all.

@jhult
Copy link

jhult commented Dec 30, 2022

It seems like there may be an issue with the default profile.

If I run the following (profile = main), I can get --network-address to work.

brew remove colima
brew install --HEAD colima
colima delete default
colima start --runtime containerd --network-address main
colima list
PROFILE    STATUS     ARCH       CPUS    MEMORY    DISK     RUNTIME       ADDRESS
main       Running    aarch64    2       2GiB      60GiB    containerd    192.168.106.4

If I don't specify a profile name and start Colima (colima start --runtime containerd --network-address), then it throws this error:

INFO[0000] starting colima
INFO[0000] runtime: containerd
INFO[0000] preparing network ...                         context=vm
WARN[0015] error starting network: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status default], output: "time=\"2022-12-29T17:29:16-06:00\" level=fatal msg=\"pid file not found: stat /Users/jonathan/.colima/default/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
INFO[0015] creating and starting ...                     context=vm
WARN[0015] error setting up reachable IP address: vmnet socket file not found: stat /Users/jonathan/.colima/default/daemon/vmnet.sock: no such file or directory

@PARENTELF
Copy link

PARENTELF commented Jan 3, 2023

Hello folks,

Version:
Colima Version: HEAD-fe625fb
Lima Version: limactl version 0.14.2
Qemu Version: 7.2.0

Operating System
macOS Apple M2 (ventura 13.1)

I would like to have some advices to solve the issue about the option --network-address, I have tried all the possibilities, a clean installation and all the stuff described above.

but I'm still getting this information :

  cat .colima/default/daemon/daemon.log
  
  time="2022-11-11T22:27:34+01:00" level=info msg="- - - - - - - - - - - - - - -"
  time="2022-11-11T22:27:34+01:00" level=info msg="daemon started by colima"
  time="2022-11-11T22:27:34+01:00" level=info msg="Run `pkill -F /Users/XXX/.colima/default/daemon/daemon.pid` to kill the daemon"
  time="2022-11-11T22:27:34+01:00" level=info msg="waiting for clients..."
  on_accept(): vmnet_return_t VMNET_INVALID_ARGUMENT
  
  vmnet_write: Undefined error: 0

and no attribution of IP is made.

Thanks in advance.

@abiosoft
Copy link
Owner

abiosoft commented Jan 3, 2023

@PARENTELF I am struggling with properly reproducing this as well.

It seems to happen (for me) in one of the following scenarios.

  • Having another virtual machine software running that is utilising vmnet networking, e.g. VMWare, Parallel, UTMApp
  • Changing network connections (wired or wifi)

The main issue is that the behaviour is not consistent, it works most time but when it breaks I am usually unable to resolve it until a macOS restart.

Since you are on macOS 13 Ventura, you can give the VZ driver a try --vm-type vz. While VZ is more experimental, the network address is more stable.

colima delete # required for switching vm types
colima start --vm-type vz --network-address

PS: kindly update to latest head as it includes a fix to a regression introduced in HEAD-fe625fb

@PARENTELF
Copy link

PARENTELF commented Jan 3, 2023

Hello thanks for your quick reply,

Colima updated: colima version HEAD-ed49fef

when I add this extra option :--vm-type vz, I fall into the following case:

note: after the installation of colima I have give a restart.

hostagent] [VZ] - vm state change: running
> [hostagent] 2023/01/03 14:54:33 tcpproxy: for incoming conn 127.0.0.1:49378, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: no route
> [hostagent] Waiting for the essential requirement 1 of 3: "ssh"
> [hostagent] 2023/01/03 14:54:43 tcpproxy: for incoming conn 127.0.0.1:49379, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: connection was refused

wich is also related #533

thanks!

@abiosoft
Copy link
Owner

abiosoft commented Jan 3, 2023

when I add this extra option :--vm-type vz, I fall into the following case:

note: after the installation of colima I have give a restart.

hostagent] [VZ] - vm state change: running
> [hostagent] 2023/01/03 14:54:33 tcpproxy: for incoming conn 127.0.0.1:49378, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: no route
> [hostagent] Waiting for the essential requirement 1 of 3: "ssh"
> [hostagent] 2023/01/03 14:54:43 tcpproxy: for incoming conn 127.0.0.1:49379, error dialing "192.168.5.15:22": connect tcp 192.168.5.15:22: connection was refused

@PARENTELF this is not "an issue" except it got stuck.
It's due to the VM booting and ssh server not yet running, you can disregard it.

@xdubx
Copy link

xdubx commented Feb 2, 2023

Hi same problem. on a m1 mac os v.12
after clean install like codrutP mentioned. I get an ip adress on the vm. After stop and start i get the error the docker pid. is not in the directory. I only at the first run get a password promt.

`
user@SIT-SMBP-C2FR2D ~ % colima start oraxe --very-verbose
TRAC[0000] cmd ["limactl" "info"]
TRAC[0000] cmd ["limactl" "list" "colima-oraxe" "--json"]
INFO[0000] starting colima [profile=oraxe]
INFO[0000] runtime: docker
TRAC[0000] cmd ["limactl" "list" "colima-oraxe" "--json"]
INFO[0000] preparing network ... context=vm
INFO[0000] dependencies missing for setting up reachable IP address context=vm
INFO[0000] sudo password may be required context=vm
TRAC[0000] cmd int ["sudo" "mkdir" "-p" "/etc/sudoers.d"]
Password:
TRAC[0010] cmd int ["sudo" "sh" "-c" "cat > /etc/sudoers.d/colima"]
TRAC[0010] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "oraxe"]
TRAC[0010] cmd ["/opt/homebrew/bin/colima" "daemon" "start" "oraxe" "--vmnet" "--verbose"]
TRAC[0010] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "oraxe"]
TRAC[0013] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "oraxe"]
TRAC[0017] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "oraxe"]
TRAC[0020] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "oraxe"]
TRAC[0023] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "oraxe"]
TRAC[0026] cmd ["/opt/homebrew/bin/colima" "daemon" "status" "oraxe"]
WARN[0026] error setting up network dependencies: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status oraxe], output: "time="2023-02-02T11:29:58+01:00" level=fatal msg="pid file not found: stat /Users/user/.colima/oraxe/daemon/daemon.pid: no such file or directory"", err: "exit status 1" context=vm
WARN[0026] error setting up reachable IP address: vmnet socket file not found: stat /Users/user/.colima/oraxe/daemon/vmnet.sock: no such file or directory
INFO[0026] starting ... context=vm
TRAC[0026] cmd ["limactl" "start" "colima-oraxe"]

Using the existing instance "colima-oraxe"
[hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/user/.lima/colima-oraxe/serial.log")
SSH Local Port: 57052
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] Waiting for the essential requirement 1 of 5: "ssh"
[hostagent] The essential requirement 1 of 5 is satisfied
[hostagent] Waiting for the essential requirement 2 of 5: "user session is ready for ssh"
[hostagent] The essential requirement 2 of 5 is satisfied
[hostagent] Waiting for the essential requirement 3 of 5: "sshfs binary to be installed"
[hostagent] The essential requirement 3 of 5 is satisfied
[hostagent] Waiting for the essential requirement 4 of 5: "/etc/fuse.conf (/etc/fuse3.conf) to contain "user_allow_other""
[hostagent] The essential requirement 4 of 5 is satisfied
[hostagent] Waiting for the essential requirement 5 of 5: "the guest agent to be running"
[hostagent] The essential requirement 5 of 5 is satisfied
[hostagent] Mounting "/Users/user” on "/Users/user”
[hostagent] Mounting "/tmp/colima-oraxe" on "/tmp/colima-oraxe"
[hostagent] Waiting for the final requirement 1 of 1: "boot scripts must have finished"
[hostagent] Forwarding "/var/run/docker.sock" (guest) to "/Users/user/.colima/oraxe/docker.sock" (host)
[hostagent] Forwarding "/run/lima-guestagent.sock" (guest) to "/Users/user/.lima/colima-oraxe/ga.sock" (host)
[hostagent] The final requirement 1 of 1 is satisfied
READY. Run limactl shell colima-oraxe to open the shell.
TRAC[0068] cmd ["lima" "sudo" "cat" "/etc/hosts"]
TRAC[0068] cmd ["lima" "sudo" "cat" "/etc/hosts"]
INFO[0068] provisioning ... context=docker
TRAC[0068] cmd ["lima" "sudo" "mkdir" "-p" "/etc/docker"]
TRAC[0068] cmd int ["lima" "sudo" "sh" "-c" "cat > /etc/docker/daemon.json"]
TRAC[0068] cmd ["docker" "context" "inspect" "colima-oraxe"]
TRAC[0068] cmd ["docker" "context" "create" "colima-oraxe" "--description" "colima [profile=oraxe]" "--docker" "host=unix:https:///Users/user/.colima/oraxe/docker.sock"]
colima-oraxe
Successfully created context "colima-oraxe"
TRAC[0068] cmd ["docker" "context" "use" "colima-oraxe"]
colima-oraxe
Current context is now "colima-oraxe"
Warning: DOCKER_HOST environment variable overrides the active context. To use "colima-oraxe", either set the global --context flag, or unset DOCKER_HOST environment variable.
INFO[0068] starting ... context=docker
TRAC[0068] cmd ["lima" "sudo" "service" "docker" "start"]

  • /var/log/docker.log: creating file
  • /var/log/docker.log: correcting owner
  • Starting Docker Daemon ... [ ok ]
    TRAC[0068] cmd ["lima" "sudo" "docker" "info"]
    TRAC[0074] cmd ["lima" "sudo" "docker" "info"]
    TRAC[0074] cmd ["lima" "sudo" "cat" "/etc/colima/colima.json"]
    TRAC[0074] cmd ["lima" "sudo" "mkdir" "-p" "/etc/colima"]
    TRAC[0074] cmd ["lima" "sudo" "mkdir" "-p" "/etc/colima"]
    TRAC[0074] cmd int ["lima" "sudo" "sh" "-c" "cat > /etc/colima/colima.json"]
    TRAC[0074] cmd ["lima" "sudo" "cat" "/etc/colima/colima.json"]
    TRAC[0074] cmd ["lima" "sudo" "mkdir" "-p" "/etc/colima"]
    TRAC[0074] cmd ["lima" "sudo" "mkdir" "-p" "/etc/colima"]
    TRAC[0074] cmd int ["lima" "sudo" "sh" "-c" "cat > /etc/colima/colima.json"]
    INFO[0074] done
    TRAC[0074] cmd ["limactl" "list" "--json"]
    TRAC[0074] cmd ["limactl" "show-ssh" "--format" "config" "colima-oraxe"]
    TRAC[0074] cmd ["limactl" "list" "colima-oraxe" "--json"]
    `

After restart.
`
PROFILE STATUS ARCH CPUS MEMORY DISK RUNTIME ADDRESS

oraxe Running x86_64 2 2GiB 60GiB docker
`

deamon.log
time="2023-02-02T11:20:16+01:00" level=info msg="- - - - - - - - - - - - - - -" time="2023-02-02T11:20:16+01:00" level=info msg="daemon started by colima" time="2023-02-02T11:20:16+01:00" level=info msg="Run/usr/bin/pkill -F /Users/user/.colima/oraxe/daemon/daemon.pidto kill the daemon" pidfile_open: Resource temporarily unavailable time="2023-02-02T11:20:16+01:00" level=error msg="error starting vmnet: error running vmnet: exit status 1" time="2023-02-02T11:20:16+01:00" level=info msg="terminate signal received" time="2023-02-02T11:20:16+01:00" level=fatal msg="context canceled" time="2023-02-02T11:23:09+01:00" level=info msg="- - - - - - - - - - - - - - -"

@guillemurano
Copy link

guillemurano commented Feb 9, 2023

> colima delete default

This doesn't work for me either

% colima delete default
are you sure you want to delete colima and all settings? [y/N] y
INFO[0002] deleting colima                              
INFO[0002] done                   
% colima start --runtime containerd --network-address main
INFO[0000] starting colima [profile=main]               
INFO[0000] runtime: containerd                          
INFO[0000] preparing network ...                         context=vm
INFO[0003] creating and starting ...                     context=vm
INFO[0055] provisioning ...                              context=containerd
INFO[0055] starting ...                                  context=containerd
INFO[0060] done   
% colima list
PROFILE    STATUS     ARCH       CPUS    MEMORY    DISK     RUNTIME       ADDRESS
main       Running    aarch64    2       2GiB      60GiB    containerd                                        

I also tried % colima start --network-address --network-driver slirp without success

@ryanplusplus
Copy link

We were having this issue and discovered that having a multipass VM running causes this behavior. I assume that other VM hosts could cause a similar conflict.

@kewilson
Copy link

same thing happens on intel mac .. posted in 449 as well.

This is after I removed & reinstalled everything per the suggestions in this and 449, think there was another around vmnet.

colima version
colima version HEAD-fff2ddd
git commit: fff2ddd76045fd31432a3a69321bf1f13e7fad1d

runtime: docker
arch: x86_64
client: v23.0.1
server: v20.10.20

regular network driver

colima start --arch x86_64 --network-address
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] preparing network ...                         context=vm
INFO[0000] dependencies missing for setting up reachable IP address  context=vm
INFO[0000] sudo password may be required                 context=vm
Password:
WARN[0027] error setting up network dependencies: error at 'preparing network': error running [/usr/local/bin/colima daemon status default], output: "time=\"2023-03-21T14:12:48-05:00\" level=fatal msg=\"pid file not found: stat /Users/SNIPPED/.colima/default/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
INFO[0027] creating and starting ...                     context=vm
WARN[0027] error setting up reachable IP address: vmnet socket file not found: stat /Users/SNIPPED/.colima/default/daemon/vmnet.sock: no such file or directory 
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 1 of 5: "ssh"
> [hostagent] Waiting for the essential requirement 2 of 5: "user session is ready for ssh"
> did not receive an event with the "running" status
FATA[0628] error starting vm: error at 'creating and starting': exit status 1

slirp driver

colima start --arch x86_64 --network-address --network-driver slirp
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] preparing network ...                         context=vm
INFO[0000] dependencies missing for setting up reachable IP address  context=vm
INFO[0000] sudo password may be required                 context=vm
Password:
WARN[0025] error setting up network dependencies: error at 'preparing network': error running [/usr/local/bin/colima daemon status default], output: "time=\"2023-03-21T14:33:04-05:00\" level=fatal msg=\"pid file not found: stat /Users/SNIPPED/.colima/default/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
INFO[0025] creating and starting ...                     context=vm
WARN[0025] error setting up reachable IP address: vmnet socket file not found: stat /Users/SNIPPED/.colima/default/daemon/vmnet.sock: no such file or directory 
INFO[0046] provisioning ...                              context=docker
INFO[0046] starting ...                                  context=docker
INFO[0052] done                                         

colima status
INFO[0000] colima is running using QEMU                 
INFO[0000] arch: x86_64                                 
INFO[0000] runtime: docker                              
INFO[0000] mountType: sshfs                             
INFO[0000] socket: unix:https:///Users/SNIPPED/.colima/default/docker.sock 

colima list
PROFILE    STATUS     ARCH      CPUS    MEMORY    DISK     RUNTIME    ADDRESS
default    Running    x86_64    2       2GiB      60GiB    docker     

@abiosoft
Copy link
Owner

abiosoft commented Apr 2, 2023

Can anyone try the latest development version brew install --head colima and see if the issue still persists?

Thanks.

@DezzardHD
Copy link

Hi @abiosoft ,
I followed the instructions of codRutP.
Same error message as before.

Specs:
Apple MacBook Pro M1
Ventura 13.0.1 (22A400)
❯ docker --version
Docker version 23.0.2, build 569dd73db1
❯ colima --version
colima version HEAD-65ee3d2

@act28
Copy link

act28 commented Apr 4, 2023

Same issue when running multiple instance with -p flag on MacBook Pro M1 Ventura 13.2.1 using stock default.yaml

tcpproxy: for incoming conn 127.0.0.1:64218, error dialing "192.168.5.15:22": connect tcp 192.168.5.15: no route

Tried using --network-address, same issue.

@jandresen99
Copy link

Hi!
I have the same error when using --network-address

colima start --network-address
INFO[0000] starting colima                              
INFO[0000] runtime: docker                              
INFO[0000] preparing network ...                         context=vm
WARN[0016] error starting network: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status default], output: "time=\"2023-04-10T23:27:19-03:00\" level=fatal msg=\"pid file not found: stat /Users/jandresen/.colima/default/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
WARN[0016] error setting up reachable IP address: vmnet socket file not found: stat /Users/jandresen/.colima/default/daemon/vmnet.sock: no such file or directory 
INFO[0016] starting ...                                  context=vm
INFO[0039] provisioning ...                              context=docker
INFO[0040] starting ...                                  context=docker
INFO[0046] done                                         

colima list
PROFILE    STATUS     ARCH       CPUS    MEMORY    DISK     RUNTIME    ADDRESS
default    Running    aarch64    2       2GiB      60GiB    docker     

I am running macOS Monterey 12.4 on an M1 Mac.

@DezzardHD
Copy link

I managed to get it working three weeks ago using the instructions posted by codrutP.

Previously, I had tried using Colima by installing Docker, Docker Compose, and then Colima via Homebrew. Starting Colima resulted in the following error message:

❯ colima start --edit oraxe
INFO[0000] editing in vim
INFO[0023] starting colima [profile=oraxe]
INFO[0023] runtime: docker
INFO[0023] preparing network ...                         context=vm
öWARN[0038] error starting network: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status oraxe], output: "time=\"2023-04-25T16:50:13+02:00\" level=fatal msg=\"pid file not found: stat /Users/user/.colima/oraxe/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
WARN[0038] disk size cannot be reduced, ignoring...      context=vm
WARN[0038] error setting up reachable IP address: vmnet socket file not found: stat /Users/user/.colima/oraxe/daemon/vmnet.sock: no such file or directory
INFO[0038] starting ...                                  context=vm
> [hostagent] Shutting down the host agent
> [hostagent] failed to exit SSH master
> [hostagent] Shutting down QEMU with ACPI
> [hostagent] failed to open the QMP socket "/Users/user/.lima/colima-oraxe/qmp.sock", forcibly killing QEMU
> [hostagent] QEMU has already exited
> exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see "/Users/user/.lima/colima-oraxe/ha.stderr.log")
FATA[0039] error starting vm: error at 'starting': exit status 1

After that, I followed the above-mentioned instructions, which led to:

❯ colima start --edit oraxe
INFO[0000] editing in vim
colima is currently running, restart to apply changes? [y/N] y
INFO[0051] stopping colima [profile=oraxe]
INFO[0051] stopping ...                                  context=docker
INFO[0052] stopping ...                                  context=vm
INFO[0057] done
INFO[0061] starting colima [profile=oraxe]
INFO[0061] runtime: docker
INFO[0061] preparing network ...                         context=vm
WARN[0076] error starting network: error at 'preparing network': error running [/opt/homebrew/bin/colima daemon status oraxe], output: "time=\"2023-04-25T17:02:38+02:00\" level=fatal msg=\"pid file not found: stat /Users/user/.colima/oraxe/daemon/daemon.pid: no such file or directory\"", err: "exit status 1"  context=vm
WARN[0076] disk size cannot be reduced, ignoring...      context=vm
WARN[0076] error setting up reachable IP address: vmnet socket file not found: stat /Users/user/.colima/oraxe/daemon/vmnet.sock: no such file or directory
INFO[0076] starting ...                                  context=vm
INFO[0128] provisioning ...                              context=docker
INFO[0128] starting ...                                  context=docker
INFO[0134] done

Three weeks ago, I was confused about the warning ('error setting up reachable IP address: [...]'), thinking that my Docker containers wouldn't function because of it. However, it turned out that they functioned without any problems.

Today, I reinstalled Colima due to an issue running docker login. For some reason, Docker was unable to connect to Docker Hub for authentication. After a fresh install of Colima, I was able to resolve my issue with docker login.
I don't know how to recreate the problem.

Regarding issue #458: I would like colima to work right out of the box when installing it via brew install. Instead I had to follow the above mentioned instructions.

PS: I used --edit instead of --network-address for setting network.address to true.

@OksiBlack
Copy link

For me the issue persists M1 Ventura, latest colima version

WARN[0181] error setting up reachable IP address: vmnet socket file not found: stat /.../.colima/default/daemon/vmnet.sock: no such file or directory

Instructions havent changed the result.

@ejames17
Copy link

Same for me @OksiBlack

@madpah
Copy link

madpah commented Aug 17, 2023

Certainly not the fix, but this works as a workaround for me when colima status shows no Network Address:

  1. Start your colima VM with whatever command you are using (ensuring you include --network-address option
    (Wait for it to start)
    I confirm it's started with no network address by running:
> 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] address:
INFO[0000] socket: unix:https:///Users/username/.colima/default/docker.sock
  1. On my Mac, there should now be a network bridge adapter created - mine is always bridge100 - grab it's IP address by running:
> ifconfig bridge100 | grep "inet "
	inet 192.168.106.1 netmask 0xffffff00 broadcast 192.168.106.255
  1. colima ssh

(you are now in SSH inside VM)

  1. sudo su -
  2. Edit the file /etc/network/interfaces so that it looks similar to the below, using the IP address returned in step 2 as the value for gateway:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto col0
iface col0 inet static
   address 192.168.106.2
   netmask 255.255.255.0
   gateway 192.168.106.1
  1. Run ifdown col0
  2. Run ifup col0
  3. Exit ssh in colima by pressing CTRL + D twice

This results in the VM having the IP 192.168.106.2 - validated by again running colima status:

> 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] address: 192.168.106.2
INFO[0000] socket: unix:https:///Users/username/.colima/default/docker.sock

@ejames17
Copy link

@madpah Thanks for the workaround. I did a factory reset and its been hold steady for now. Some others using the trellis project have similar issues. Ill refer back here.

@foxted
Copy link

foxted commented Aug 29, 2023

Trying all the solution suggested above, still having that issue. Though I tried limactl start and it can boot without issues. I tried the command I found in daemon.log and it works as well, but colima start --network-address does not:

Here's my daemon.log:

time="2023-08-29T14:19:36-07:00" 
level=info msg="- - - - - - - - - - - - - - -"
time="2023-08-29T14:19:36-07:00" level=info msg="daemon started by colima"
time="2023-08-29T14:19:36-07:00" level=info msg="Run `/usr/bin/pkill -F /Users/t944521/.colima/default/daemon/daemon.pid` to kill the daemon"
time="2023-08-29T14:19:36-07:00" level=trace msg="cmd int [\"sudo\" \"/opt/colima/bin/socket_vmnet\" \"--vmnet-mode\" \"shared\" \"--socket-group\" \"staff\" \"--vmnet-gateway\" \"192.168.106.1\" \"--vmnet-dhcp-end\" \"192.168.106.254\" \"--pidfile\" \"/opt/colima/run/vmnet-default.pid\" \"/Users/t944521/.colima/default/daemon/vmnet.sock\"]"
sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper
sudo: a password is required
time="2023-08-29T14:19:36-07:00" level=error msg="error starting vmnet: error running vmnet: exit status 1"
time="2023-08-29T14:19:36-07:00" level=info msg="terminate signal received"
time="2023-08-29T14:19:36-07:00" level=fatal msg="context canceled"

limactl start colima yields:

INFO[0000] Using the existing instance "colima"
INFO[0000] QEMU binary "/opt/homebrew/bin/qemu-system-aarch64" seems properly signed with the "com.apple.security.hypervisor" entitlement
INFO[0000] [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/t944521/.lima/colima/serial*.log")
INFO[0000] SSH Local Port: 52644
INFO[0000] [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 (/etc/fuse3.conf) to contain \"user_allow_other\""
INFO[0021] [hostagent] The essential requirement 4 of 5 is satisfied
INFO[0021] [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/t944521" on "/Users/t944521"
INFO[0022] [hostagent] Mounting "/tmp/colima" on "/tmp/colima"
INFO[0022] [hostagent] Waiting for the final requirement 1 of 1: "boot scripts must have finished"
INFO[0022] [hostagent] Forwarding "/var/run/docker.sock" (guest) to "/Users/t944521/.colima/default/docker.sock" (host)
INFO[0022] [hostagent] Forwarding "/var/run/docker.sock" (guest) to "/Users/t944521/.colima/docker.sock" (host)
INFO[0022] [hostagent] The final requirement 1 of 1 is satisfied
INFO[0022] READY. Run `limactl shell colima` to open the shell.

@jamhed
Copy link

jamhed commented Sep 30, 2023

Hello guys,

To whom it may concern:

colima version 0.5.5, arch: aarch64, macbook air m2, vz/virtiofs

With --network-address option set, colima starts a virtual machine, and bridges col0 interface with bridge100, which has ip address 192.168.106.1. It seems that bridge100 interface is a special one used for "internet sharing", which means that there should be a DHCP server running. However, if for some reason "internet sharing" is disabled, then there is no DHCP server on bridge100 interface, and therefore, lima's virtual machine is unable to acquire IP address, and therefore k3s kubernetes fails to start, which causes colima error "The connection to the server 127.0.0.1:6443 was refused - did you specify the right host or port?"

The solution is to start dhcp server on bridge100 serving 192.168.106.* range, e.g., dnsmasq, which might require disabling macos builtin server bootps.plist, due to port conflict.

@tzookb
Copy link

tzookb commented Dec 27, 2023

@jamhed can you share what commands we actually need?

or any other solutions?

@madpah
Copy link

madpah commented Jan 12, 2024

I've had to revise my solution to run this command inside the colima VM (after sudo):

ip address add 192.168.106.2/24 broadcast + dev col0

@norrs
Copy link

norrs commented Mar 12, 2024

So there seems to be multiple issues in the project regarding regarding creating a colima VM and successfully obtain a IPv4 address after --network-address is enabled during creation.

@norrs doing some research:

After reading source code for colima, and trying a million things mentions in all various issues..
I find hint from the comment here in this issue #458 (comment) which lead me on path to research if VM actaully got an IPv4 address from the dhcp server and if there was possible firewall issues. This lead me to the great issue over at lima-vm at lima-vm/lima#1259 and further into lima-vm/socket_vmnet#18 (comment) which seems to confirm my suspect.

  • Disabled firewall 😱
  • Everything works and it obtains an IPv4 address inside the VM on interface col0 that is reachable from the host when using virtual machine type vz ( $ colima start --vm-type vz --network-address ).
  • It sadly fails for qemu ($ colima start --arch=x86_64 --network-address) 😢

Screenshot 2024-03-12 at 02 18 06

You really want a firewall and not disable it, and bootpd should not really be blocked according to the description here, so this sounds like a Apple bug as mentioned in the socket_vmnet issue.

Executing the following commands below would add a firewall rule for bootpd and allow the VM to obtain an IPv4 address over DHCP.

$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --add /usr/libexec/bootpd
$ sudo /usr/libexec/ApplicationFirewall/socketfilterfw --unblock /usr/libexec/bootpd

However, you might be blocked due to MDM (mobile device management) in your company if you are unlucky: lima-vm/socket_vmnet#18 (comment) and lima-vm/socket_vmnet#18 (comment) .

This issue seems to already be documented in lima-vm/socket_vmnet:README.

FYI @abiosoft - hope it helps clearing up errors others are experiencing.

For everyone else: This is also a good link for introduction on how lima under the hood does networking: https://lima-vm.io/docs/config/network/

And my background story and 😴 researching:

I had this working on Friday, I believe I did a required system upgrade due to policy on the computer during the weekend (and probably had colima running in the background) and ended up with Sonoma 14.4 on my newly freshly aquired Mac Pro M3. After reboot I noticed my VMs under colima did not receive an IPv4 addresses.

@Silvanoc
Copy link

Silvanoc commented Apr 8, 2024

It is sort of weird that I'm observing something completely different from what @norrs is reporting in this comment. I wonder if we're observing completely different issues or the same issue with different manifestations due to slight differences in our set-ups.

These are the observed differences.

Everything works and it obtains an IPv4 address inside the VM on interface col0 that is reachable from the host when using virtual machine type vz ( $ colima start --vm-type vz --network-address ).

In my case for VZ fails because the interface col0 is not even being created...

It sadly fails for qemu ($ colima start --arch=x86_64 --network-address)

In my case for QEMU it works perfectly.

My setup:

  • Apple M1 processor
  • MacOS Sonoma 14.4.1
  • Colima 0.6.8
  • socket_vmnet 1.1.4

To see how to reproduce the issue, click here

VZ

Command line

colima --profile test-net delete -f ; sleep 5 ; colima start --profile test-net --network-address --arch x86_64 --vm-type vz && colima --profile test-net ssh ip link ; colima --profile test-net status

Output

INFO[0000] deleting colima [profile=test-net]
INFO[0000] done
INFO[0000] starting colima [profile=test-net]
INFO[0000] runtime: docker
INFO[0000] creating and starting ...                     context=vm
INFO[0102] provisioning ...                              context=docker
INFO[0104] starting ...                                  context=docker
INFO[0215] done
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
  link/ether 52:55:55:ce:b3:5a brd ff:ff:ff:ff:ff:ff
3: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
  link/ether 02:42:9b:d1:eb:ee brd ff:ff:ff:ff:ff:ff
INFO[0000] colima [profile=test-net] is running using macOS Virtualization.Framework
INFO[0000] arch: x86_64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:https:///Users/[...]/.colima/test-net/docker.sock

QEMU

Command line

colima --profile test-net delete -f ; sleep 5 ; colima start --profile test-net --network-address --arch x86_64 --vm-type qemu && colima --profile test-net ssh ip link ; colima --profile test-net status

Output

INFO[0000] deleting colima [profile=test-net]
INFO[0000] deleting ...                                  context=docker
INFO[0001] done
INFO[0000] starting colima [profile=test-net]
INFO[0000] runtime: docker
INFO[0001] creating and starting ...                     context=vm
INFO[0100] provisioning ...                              context=docker
INFO[0102] starting ...                                  context=docker
INFO[0209] done
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
  link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
  link/ether 52:55:55:ce:b3:5a brd ff:ff:ff:ff:ff:ff
3: col0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT group default qlen 1000
  link/ether 52:55:55:95:bc:04 brd ff:ff:ff:ff:ff:ff
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
  link/ether 02:42:2d:62:04:ef brd ff:ff:ff:ff:ff:ff
INFO[0000] colima [profile=test-net] is running using QEMU
INFO[0000] arch: x86_64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0001] address: 192.168.106.4
INFO[0001] socket: unix:https:///Users/[...]/.colima/test-net/docker.sock

@sudeeshjohn
Copy link

It is sort of weird that I'm observing something completely different from what @norrs is reporting in this comment. I wonder if we're observing completely different issues or the same issue with different manifestations due to slight differences in our set-ups.

same here. IP address is not showing up for colima start --network-address --arch x86_64 --vm-type vz

@greycr0w
Copy link

M1 Sonoma 14.5
On my side, this was introduced when I stopped colima to test something out.

I was able to fix it with the following steps:

  1. Uninstall colima
  2. Install --HEAD version: brew install --HEAD colima
  3. Restart docker daemon
  4. Execute with --vm-type vz

@Silvanoc
Copy link

After having reported here that colima start --arch=x86_64 --network-address was working fine for me, now it has stopped working 🤦

@Silvanoc
Copy link

@abiosoft I have just tried brew install --head colima as you propose in a quite old comment. So I'm using now c3a31ed and I am still having difficulties to run colima start --arch=x86_64 --network-address on an M1 MacBook.

The reported error message is error calling fd_connect: fd_connect: dial unix /Users/[...]/.colima/test-net/daemon/vmnet.sock: connect: connection refused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.