abiosoft / colima

Container runtimes on macOS (and Linux) with minimal setup
MIT License
19.51k stars 393 forks source link

Failed to when colima start #329

Closed shibd closed 2 years ago

shibd commented 2 years ago

Describe the Issue

When I start colima I get the following error.

➜  colima cat ha.stderr.log
{"level":"info","msg":"Replacing \"http_proxy\" value \"http://127.0.0.1:7890\" with \"http://192.168.5.2:7890\"","time":"2022-06-11T08:37:44+08:00"}
{"level":"info","msg":"Replacing \"https_proxy\" value \"http://127.0.0.1:7890\" with \"http://192.168.5.2:7890\"","time":"2022-06-11T08:37:44+08:00"}
{"level":"debug","msg":"firmware candidates = [/Users/baozi/.local/share/qemu/edk2-x86_64-code.fd /Users/baozi/.colima/_wrapper/share/qemu/edk2-x86_64-code.fd /usr/share/OVMF/OVMF_CODE.fd /usr/share/qemu/ovmf-x86_64-code.bin /usr/share/edk2-ovmf/x64/OVMF_CODE.fd]","time":"2022-06-11T08:37:44+08:00"}
{"level":"debug","msg":"OpenSSH version 8.6.1 detected","time":"2022-06-11T08:37:44+08:00"}
{"level":"debug","msg":"AES accelerator seems available, prioritizing aes128-gcm@openssh.com and aes256-gcm@openssh.com","time":"2022-06-11T08:37:44+08:00"}
{"level":"info","msg":"Starting QEMU (hint: to watch the boot progress, see \"/Users/baozi/.lima/colima/serial.log\")","time":"2022-06-11T08:37:44+08:00"}
{"level":"debug","msg":"qCmd.Args: [/Users/baozi/.colima/_wrapper/bin/qemu-system-x86_64 -m 2048 -cpu host -machine q35,accel=hvf -smp 2,sockets=1,cores=2,threads=1 -drive if=pflash,format=raw,readonly=on,file=/Users/baozi/.colima/_wrapper/share/qemu/edk2-x86_64-code.fd -boot order=d,splash-time=0,menu=on -drive file=/Users/baozi/.lima/colima/basedisk,media=cdrom,readonly=on -drive file=/Users/baozi/.lima/colima/diffdisk,if=virtio -cdrom /Users/baozi/.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:62849-:22 -device virtio-net-pci,netdev=net0,mac=52:55:55:9d:26:19 -device virtio-rng-pci -display none -device virtio-vga -device virtio-keyboard-pci -device virtio-mouse-pci -parallel none -chardev socket,id=char-serial,path=/Users/baozi/.lima/colima/serial.sock,server=on,wait=off,logfile=/Users/baozi/.lima/colima/serial.log -serial chardev:char-serial -chardev socket,id=char-qmp,path=/Users/baozi/.lima/colima/qmp.sock,server=on,wait=off -qmp chardev:char-qmp -name lima-colima -pidfile /Users/baozi/.lima/colima/qemu.pid]","time":"2022-06-11T08:37:44+08:00"}
{"level":"info","msg":"Waiting for the essential requirement 1 of 5: \"ssh\"","time":"2022-06-11T08:37:44+08:00"}
{"level":"debug","msg":"executing script \"ssh\"","time":"2022-06-11T08:37:44+08:00"}
{"level":"debug","msg":"executing ssh for script \"ssh\": /usr/bin/ssh [ssh -F /dev/null -o IdentityFile=\"/Users/baozi/.lima/_config/user\" -o IdentityFile=\"/Users/baozi/.ssh/github\" -o IdentityFile=\"/Users/baozi/.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=\"^aes128-gcm@openssh.com,aes256-gcm@openssh.com\" -o User=baozi -o ControlMaster=auto -o ControlPath=\"/Users/baozi/.lima/colima/ssh.sock\" -o ControlPersist=5m -p 62849 127.0.0.1 -- /bin/bash]","time":"2022-06-11T08:37:44+08:00"}
{"level":"debug","msg":"qemu[stderr]: qemu-system-x86_64: Unknown Error","time":"2022-06-11T08:37:44+08:00"}
{"level":"debug","msg":"stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 62849: Connection refused\\r\\n\", err=failed to execute script \"ssh\": stdout=\"\", stderr=\"ssh: connect to host 127.0.0.1 port 62849: Connection refused\\r\\n\": exit status 255","time":"2022-06-11T08:37:44+08:00"}
{"error":null,"level":"info","msg":"QEMU has exited","time":"2022-06-11T08:37:44+08:00"}

Version

Colima Version:

colima version 0.4.2

Lima Version:

limactl version 0.11.0

Qemu Version

qemu-img version 7.0.0

Operating System

To Reproduce

Steps to reproduce the behavior:

  1. colima start
    > msg="[hostagent] Replacing \"https_proxy\" value \"http://127.0.0.1:7890\" with \"http://192.168.5.2:7890\""
    > msg="[hostagent] Starting QEMU (hint: to watch the boot progress, see \"/Users/baozi/.lima/colima/serial.log\")"
    > msg="SSH Local Port: 62929"
    > msg="[hostagent] Waiting for the essential requirement 1 of 5: \"ssh\""
    > msg="[hostagent] QEMU has exited"
    > msg="exiting, status={Running:false Degraded:false Exiting:true Errors:[] SSHLocalPort:0} (hint: see \"/Users/baozi/.lima/colima/ha.stderr.log\")"
    FATA[0000] error starting vm: error at 'starting': exit status 1

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

Add any other context about the problem here.

abiosoft commented 2 years ago

I can see you're on m1 Mac but qemu-system-x86_64 is being used instead of qemu-system-aarch64. Are you using iTerm in Intel mode (Rosetta2) when running colima?

Looks similar to https://github.com/abiosoft/colima/issues/204#issuecomment-1083220386.

shibd commented 2 years ago

@abiosoft Thanks, I installed the limactl of X86_64. I try to solve this way: https://github.com/lima-vm/lima/issues/543#issuecomment-1052076572

But I have a new problem when starting colima. I recive this error:

colima start --arch x86_64
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] starting ...                                  context=vm
> msg="[hostagent] Overriding \"http_proxy\" value \"http://127.0.0.1:7890\" with \"127.0.0.1:7890\" from limactl process environment"
> msg="[hostagent] Overriding \"https_proxy\" value \"http://127.0.0.1:7890\" with \"127.0.0.1:7890\" from limactl process environment"
> msg="[hostagent] Replacing \"http_proxy\" value \"127.0.0.1:7890\" with \"192.168.5.2:7890\""
> msg="[hostagent] Replacing \"https_proxy\" value \"127.0.0.1:7890\" with \"192.168.5.2:7890\""
> msg="[hostagent] could not find firmware for \"/Users/baozi/.colima/_wrapper/bin/qemu-system-x86_64\" (hint: try setting `firmware.legacyBIOS` to `true`)" fields.level=fatal
> msg="host agent process has exited: exit status 1"
FATA[0000] error starting vm: error at 'starting': exit status 1
shibd commented 2 years ago

@abiosoft Thanks, I installed the limactl of X86_64. I try to solve this way: lima-vm/lima#543 (comment)

But I have new problem, when starting colima. I review this error:

colima start --arch x86_64
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] starting ...                                  context=vm
> msg="[hostagent] Overriding \"http_proxy\" value \"http://127.0.0.1:7890\" with \"127.0.0.1:7890\" from limactl process environment"
> msg="[hostagent] Overriding \"https_proxy\" value \"http://127.0.0.1:7890\" with \"127.0.0.1:7890\" from limactl process environment"
> msg="[hostagent] Replacing \"http_proxy\" value \"127.0.0.1:7890\" with \"192.168.5.2:7890\""
> msg="[hostagent] Replacing \"https_proxy\" value \"127.0.0.1:7890\" with \"192.168.5.2:7890\""
> msg="[hostagent] could not find firmware for \"/Users/baozi/.colima/_wrapper/bin/qemu-system-x86_64\" (hint: try setting `firmware.legacyBIOS` to `true`)" fields.level=fatal
> msg="host agent process has exited: exit status 1"
FATA[0000] error starting vm: error at 'starting': exit status 1

/Users/baozi/.colima/_wrapper/bin/qemu-system-x86_64 is exist.

shibd commented 2 years ago

If I don't use --arch param, I also get the following error

colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] creating and starting ...                     context=vm
> msg="[hostagent] Overriding \"http_proxy\" value \"http://127.0.0.1:7890\" with \"127.0.0.1:7890\" from limactl process environment"
> msg="[hostagent] Overriding \"https_proxy\" value \"http://127.0.0.1:7890\" with \"127.0.0.1:7890\" from limactl process environment"
> msg="[hostagent] Replacing \"http_proxy\" value \"127.0.0.1:7890\" with \"192.168.5.2:7890\""
> msg="[hostagent] Replacing \"https_proxy\" value \"127.0.0.1:7890\" with \"192.168.5.2:7890\""
> msg="[hostagent] could not find firmware for \"aarch64\" (hint: try copying the \"edk-/Users/baozi/.colima/_wrapper/bin/qemu-system-aarch64-code.fd\" firmware to $HOME/.local/share/qemu/)" fields.level=fatal
> msg="host agent process has exited: exit status 1"
FATA[0000] error starting vm: error at 'creating and starting': exit status 1
abiosoft commented 2 years ago

Do you have android-sdk installed? Can you install the head version brew install --head colima and see if it works?

shibd commented 2 years ago

Do you have android-sdk installed? Can you install the head version brew install --head colima and see if it works?

It doesn't seem to work. Do you need to confirm my configuration or version, thanks

colima version
colima version HEAD-3f244a9
git commit: 3f244a943b8b6e869f7c3857c00b7e5a6ed0801b
colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] starting ...                                  context=vm
> [hostagent] Overriding "http_proxy" value "http://127.0.0.1:7890" with "127.0.0.1:7890" from limactl process environment
> [hostagent] Overriding "https_proxy" value "http://127.0.0.1:7890" with "127.0.0.1:7890" from limactl process environment
> [hostagent] Replacing "http_proxy" value "127.0.0.1:7890" with "192.168.5.2:7890"
> [hostagent] Replacing "https_proxy" value "127.0.0.1:7890" with "192.168.5.2:7890"
> "[hostagent] could not find firmware for \"aarch64\" (hint: try copying the \"edk-/Users/baozi/.colima/_wrapper/bin/qemu-system-aarch64-code.fd\" firmware to $HOME/.local/share/qemu/)" fields.level=fatal
> host agent process has exited: exit status 1
FATA[0000] error starting vm: error at 'starting': exit status 1
shibd commented 2 years ago

Why could not find firmware for \"aarch64\

abiosoft commented 2 years ago

This is likely your issue https://github.com/abiosoft/colima/issues/331#issuecomment-1153311995. Is your homebrew installation aarch64?