abiosoft / colima

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

New Colima installations do never come up properly #685

Open obfischer opened 1 year ago

obfischer commented 1 year ago

Description

We use Colima for quite a long time, but when we, our team, tried to setup Colima again, no one can get Colima working. As I can see and describe it, it seems so, that QEMU is not able to start properly.

Version

Colima Version: 0.5.4 Lima Version: 0.15.0 Qemu Version: 7.2.0

Operating System

Output of colima status

The command does not return properly.

uid096801@nuewx0096801 ~ % colima status
FATA[0074] error retrieving current runtime: empty value

Reproduction Steps

  1. colima start --cpu 2 --memory 8 --disk 80 --arch x86_64 --verbose

Expected behaviour

Normal startup of Colima as one year agon ;-)

Additional context

Here is the output of `colima start --cpu 2 --memory 8 --disk 80 --arch x86_64 --verbose``

INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] preparing network ...                         context=vm
INFO[0000] starting ...                                  context=vm
> Using the existing instance "colima"
> [hostagent] Starting QEMU (hint: to watch the boot progress, see "/Users/uid096801/.lima/colima/serial.log")
> SSH Local Port: 50999
> [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 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"
> did not receive an event with the "running" status
FATA[0600] error starting vm: error at 'starting': exit status 1
uid096801@nuewx0096801 ~ %

Here is the to ~/.lima/colima/serial:

uid096801@nuewx0096801 ~ % tail -f /Users/uid096801/.lima/colima/serial.log
BdsDxe: failed to load Boot0001 "UEFI QEMU QEMU CD-ROM " from PciRoot(0x0)/Pci(0x1,0x0)/Scsi(0x0,0x0): Not Found
BdsDxe: failed to load Boot0002 "UEFI Misc Device" from PciRoot(0x0)/Pci(0x9,0x0): Not Found

>>Start PXE over IPv4.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0003 "UEFI PXEv4 (MAC:52555505EB74)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(52555505EB74,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0): Not Found

>>Start PXE over IPv6.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0004 "UEFI PXEv6 (MAC:52555505EB74)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(52555505EB74,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000): Not Found

>>Start HTTP Boot over IPv4...
  Error: Could not retrieve NBP file size from HTTP server.

  Error: Server response timeout.
BdsDxe: failed to load Boot0005 "UEFI HTTPv4 (MAC:52555505EB74)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(52555505EB74,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)/Uri(): Not Found

>>Start HTTP Boot over IPv6.
  Error: Could not retrieve NBP file size from HTTP server.

  Error: Unexpected network error.
BdsDxe: failed to load Boot0006 "UEFI HTTPv6 (MAC:52555505EB74)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(52555505EB74,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000)/Uri(): Not Found

>>Start PXE over IPv4.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0007 "UEFI PXEv4 (MAC:5A94EFF12CEB)" from PciRoot(0x0)/Pci(0x8,0x0)/MAC(5A94EFF12CEB,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0): Not Found

>>Start PXE over IPv6.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0008 "UEFI PXEv6 (MAC:5A94EFF12CEB)" from PciRoot(0x0)/Pci(0x8,0x0)/MAC(5A94EFF12CEB,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000): Not Found

>>Start HTTP Boot over IPv4...
  Error: Could not retrieve NBP file size from HTTP server.

  Error: Server response timeout.
BdsDxe: failed to load Boot0009 "UEFI HTTPv4 (MAC:5A94EFF12CEB)" from PciRoot(0x0)/Pci(0x8,0x0)/MAC(5A94EFF12CEB,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0)/Uri(): Not Found

>>Start HTTP Boot over IPv6.
...

Then the following appears in serial.log:

UEFI Interactive Shell v2.2
EDK II
UEFI v2.70 (EDK II, 0x00010000)
Mapping table
     BLK0: Alias(s):
          PciRoot(0x0)/Pci(0x1,0x0)/Scsi(0x0,0x0)
     BLK1: Alias(s):
          PciRoot(0x0)/Pci(0x9,0x0)
     BLK2: Alias(s):
          PciRoot(0x0)/Pci(0x9,0x0)/HD(2,MBR,0x5603A7B4,0x148,0xB40)
Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
Shell>

Here is also our lima.yaml, taken from ~/.lima/colima:

vmType: qemu
arch: x86_64
images:
    - location: /Users/uid096801/Downloads/alpine-lima-clm-3.16.2-x86_64.iso
      arch: x86_64
      digest: sha512:7231f12b7f1bbb24976b6619af1948dead9835e951f84b92f01cd4f6b5eb4121dee2c683351fc3f4a7a6dea0f6f55a44368049099218eb2b94337d5de5f03c4f

cpus: 2
memory: 8GiB
disk: 80GiB
mounts:
    - location: "~"
      writable: true
    - location: /tmp/colima
      writable: true
mountType: reverse-sshfs
containerd:
    system: false
    user: false
dns:
    - 192.168.107.1
firmware:
    legacyBIOS: false
hostResolver:
    enabled: false
    hosts:
        host.docker.internal: host.lima.internal
portForwards:
    - guestPortRange:
        - 0
        - 0
      guestSocket: /var/run/docker.sock
      hostPortRange:
        - 0
        - 0
      hostSocket: /Users/uid096801/.colima/default/docker.sock
      proto: tcp
    - guestPortRange:
        - 0
        - 0
      guestSocket: /var/run/docker.sock
      hostPortRange:
        - 0
        - 0
      hostSocket: /Users/uid096801/.colima/docker.sock
      proto: tcp
    - guestIPMustBeZero: true
      guestIP: 0.0.0.0
      guestPortRange:
        - 1
        - 65535
      hostIP: 0.0.0.0
      hostPortRange:
        - 1
        - 65535
      proto: tcp
    - guestIP: 127.0.0.1
      guestPortRange:
        - 1
        - 65535
      hostIP: 127.0.0.1
      hostPortRange:
        - 1
        - 65535
      proto: tcp
provision:
    - mode: system
      script: sysctl -w fs.inotify.max_user_watches=1048576
    - mode: user
      script: sudo usermod -aG docker $USER
    - mode: system
      script: grep -q "^rc_env_allow" /etc/rc.conf || echo 'rc_env_allow="*"' >> /etc/rc.conf
    - mode: system
      script: |
        #!/usr/bin/env sh

        FILE=/etc/network/interfaces
        BACKUP="$FILE.bak"

        # this only happens one in the beginning
        if [ ! -f "$BACKUP" ]; then
            cp "$FILE" "$BACKUP"
        fi

        # reset the network file
        cp "$BACKUP" "$FILE"

        written() (
            grep -q "^auto ${1}" "${FILE}"
        )

        vmnet() (
            IFACE="col0"

            if written $IFACE; then exit 0; fi

            cat >>$FILE <<EOF
        auto $IFACE
        iface $IFACE inet dhcp

        EOF
        )

        gvproxy() (
            IFACE=$(ifconfig -a | grep 'HWaddr 5A:94:EF:F1:2C:EB' | awk -F' ' '{print $1}')

            if written $IFACE; then exit; fi

            cat >>$FILE <<EOF
        auto $IFACE
        iface $IFACE inet static
          address 192.168.107.2
          netmask 255.255.255.0
          gateway 192.168.107.1
          metric 200

        EOF
        )

        vmnet
        gvproxy
        service networking restart
    - mode: system
      script: mkmntdirs && mount -a
    - mode: system
      script: readlink /sbin/fstrim || fstrim -a

We, our hole team, relies on on colima, as it is the only way we know to run an Oracle DB under M1.

We would be happy to support you with as many coffees as you would like.

obfischer commented 1 year ago

I tried to install Colima via Homebrew on a Apple MacBook Air M1 without any problems. The MacBook is running Ventura 13.2.1.

enavarrocu commented 1 year ago

@obfischer Not sure if this is your issue, but the sha512 of your lima.yaml does not match mine. I manually download (https://github.com/abiosoft/alpine-lima/releases/download/colima-v0.5.0-2/alpine-lima-clm-3.16.2-x86_64.iso) and correspond to the sha512 that is in my lima.yaml

abiosoft commented 1 year ago

I am actually not able to reproduce this.

Can you try the development version brew install --head colima?

@obfischer Not sure if this is your issue, but the sha512 of your lima.yaml does not match mine. I manually download (https://github.com/abiosoft/alpine-lima/releases/download/colima-v0.5.0-2/alpine-lima-clm-3.16.2-x86_64.iso) and correspond to the sha512 that is in my lima.yaml

I noticed the same as well. Looks like you have a local cache of the image, maybe try downloading again.

kinglywork commented 1 year ago

same issue here...

my versions: mac os: 13.4.1 colima: 0.5.5 HEAD-627c4fd lima: stable 0.16.0 (bottled), HEAD docker: 24.0.4 qemu: 8.0.3

miguelvr commented 10 months ago

this fixed it for me:

brew reinstall -f --force-bottle qemu
obfischer commented 9 months ago

Hi all,

sorry for not taking part for a long time in the dicussion. Meanwhile I reinstalled my machine and everything works fine now.

@miguelvr Next time, if this occurs again, I will give it a try

rvullriede commented 7 months ago

Same problem here. Reinstall didn't help. macOS: 14.4.1 colima: 0.6.8 qemu: 9.0.0 docker: 25.0.2, build 29cf629

HBdsDxe: failed to load Boot0001 "UEFI QEMU QEMU CD-ROM " from PciRoot(0x0)/Pci(0x1,0x0)/Scsi(0x0,0x0): Not Found
BdsDxe: failed to load Boot0002 "UEFI Misc Device" from PciRoot(0x0)/Pci(0xC,0x0): Not Found

>>Start PXE over IPv4.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0003 "UEFI PXEv4 (MAC:5255551E7A24)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(5255551E7A24,0x1)/IPv4(0.0.0.0,0x0,DHCP,0.0.0.0,0.0.0.0,0.0.0.0): Not Found

>>Start PXE over IPv6.
  PXE-E16: No valid offer received.
BdsDxe: failed to load Boot0004 "UEFI PXEv6 (MAC:5255551E7A24)" from PciRoot(0x0)/Pci(0x2,0x0)/MAC(5255551E7A24,0x1)/IPv6(0000:0000:0000:0000:0000:0000:0000:0000,0x0,Static,0000:0000:0000:0000:0000:0000:0000:0000,0x40,0000:0000:0000:0000:0000:0000:0000:0000): Not Found

>>Start HTTP Boot over IPv4.....