abiosoft / colima

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

Unable to Launch Colima on Rocky Linux 9.* #979

Closed mattbucci closed 5 months ago

mattbucci commented 5 months ago

Description

RH based distros require lima to be set to legacy bios mode per https://github.com/lima-vm/lima/discussions/1917

Colima doesn't seem to have any legacyBios related config parameters which affect this setting: https://github.com/abiosoft/colima/blob/9b0809d0ed9ad3ff1e57c405f27324e6298ca04f/environment/vm/lima/yaml.go#L357

As a test I added the following

--- a/environment/vm/lima/yaml.go
+++ b/environment/vm/lima/yaml.go
@@ -48,6 +48,10 @@ func newConf(ctx context.Context, conf config.Config) (l Config, err error) {
                }
        }

+       if true {
+               l.Firmware.LegacyBIOS = true;
+       }
+

colima now starts correctly

I propose adding a LegacyBIOS parameter to the config file which sets this lima config appropriately and would be happy to PR it if it makes sense to you https://github.com/abiosoft/colima/blob/9b0809d0ed9ad3ff1e57c405f27324e6298ca04f/config/config.go#L71

Version

Rocky Linux release 9.3 (Blue Onyx)

colima version v0.6.8 git commit: 9b0809d0ed9ad3ff1e57c405f27324e6298ca04f

runtime: containerd arch: x86_64 client: v1.7.0 server: 1.6.28 limactl version 0.20.1-12-g8af695d qemu-img version 8.0.0 (qemu-kvm-8.0.0-16.el9_3.3) Copyright (c) 2003-2022 Fabrice Bellard and the QEMU Project developers

Operating System

Output of colima status

After above fix: INFO[0000] colima is running using QEMU INFO[0000] arch: x86_64 INFO[0000] runtime: containerd INFO[0000] mountType: sshfs

Reproduction Steps

  1. run colima start on rocky os 9
  2. colima failed to start
  3. Log files show the below error
{"level":"fatal","msg":"could not find firmware for \"/usr/libexec/qemu-kvm\" (hint: try setting `firmware.legacyBIOS` to `true`)","time":"2023-10-14T10:35:03+02:00"}

Expected behaviour

On RH based distros I should be able to set legacyBIOS either manually or it should be automatically set by colima so that lima can start correctly.

Additional context

No response

mattbucci commented 5 months ago

I'm closing this while legacyBios is not an available flag it should only be needed on Centos and not Rocky or Alma as per https://github.com/lima-vm/lima/discussions/1917#discussioncomment-7280204

You should be able to run sudo dnf install edk2-aarch64 or sudo dnf install edk2-ovmf

You will also need to symlink so the files are found

sudo ln -s /usr/share/edk2/ovmf/OVMF_CODE.fd /usr/share/OVMF/OVMF_CODE.fd

You can find expected paths here: https://github.com/lima-vm/lima/blob/243cdc583946be0c76d9d4f0327b41c2d9e02e74/pkg/qemu/qemu.go#L1140