colima icon indicating copy to clipboard operation
colima copied to clipboard

colima start does not honor default config, but then overwrites it

Open pangdaxing23 opened this issue 1 year ago • 8 comments

Description

The vz VM type does not work on my M3 Mac, so I must use qemu. My config at ~/.config/default/colima.yaml has vmType: qemu so that when I run colima start I should use the qemu VM type. Instead it goes with the vz type, and overwrites the config file as well. It also fails for this same reason when running brew services start colima, and indeed overwrites the config too. I am able to run colima start --edit, see that it has already overwritten the vmType, edit it to qemu, then exit and it will work, but a simple colima start fails. The only way I have ever gotten it to work in brew services temporarily is to run colima delete then reinstall colima, but it breaks again after some time, and I am not sure what triggers it, possibly a reboot.

Version

colima version 0.6.8 git commit: 9b0809d0ed9ad3ff1e57c405f27324e6298ca04f limactl version 0.20.1 qemu-img version 8.2.1

Operating System

  • [ ] macOS Intel <= 13 (Ventura)
  • [ ] macOS Intel >= 14 (Sonoma)
  • [ ] Apple Silicon <= 13 (Ventura)
  • [X] Apple Silicon >= 14 (Sonoma)
  • [ ] Linux

Output of colima status

If I run colima start, then colima status:

FATA[0000] colima is not running

If I run colima start --edit, and edit it to qemu, then run colima status:

INFO[0000] colima is running using QEMU
INFO[0000] arch: aarch64
INFO[0000] runtime: docker
INFO[0000] mountType: virtiofs
INFO[0000] socket: unix:///Users/MYUSER/.colima/default/docker.sock

Reproduction Steps

  1. Set vmType: qemu in ~/.colima/default/colima.yaml.
  2. Run colima start.
  3. Note failure and check config to see it over.written with vmType: vz

Expected behaviour

colima start should run the profile in the config and not overwrite the config.

Additional context

colima start gives the following:

INFO[0000] runtime: docker
INFO[0000] starting ...                                  context=vm
> Using the existing instance "colima"
> errors inspecting instance: [vz driver is running but host agent is not]
FATA[0000] error starting vm: error at 'starting': exit status 1

pangdaxing23 avatar Feb 13 '24 14:02 pangdaxing23

I have exactly the same problem on the same setup

@abiosoft I am facing the same issue vz driver is running but host agent is not when starting colima on sonoma 14.3.1

very first it's working fine

colima start --vm-type vz --network-address --cpu 6 --memory 8 --arch aarch64
  • when I start 1-2 days later, this time face a driver issue. @abiosoft could you suggest any solution for this issue

mostafa6765 avatar Feb 18 '24 10:02 mostafa6765

I have same problem. Fix please.

bogdankorobka avatar Feb 28 '24 11:02 bogdankorobka

I'm also having trouble with the same problem on my M3 Mac. Even if I rewrite the VM type of colima.yaml to qemu, when I run colima start, a log saying Starting the instance "colima" with VM driver "vz" is displayed, and The VM type will be automatically rewritten to vz.

I would appreciate it if it would be fixed as soon as possible.

mewmo avatar Mar 10 '24 03:03 mewmo

Hi guys,

same problem occurred here on my Mac M3 (Sonoma) after brew upgrade. I could get it running again with

colima delete colima start

Best regards, mscdit

P.S.: Attention ... by doing so I hade to re-load all images/containers!

mscdit avatar Mar 28 '24 09:03 mscdit

I have the same issue and a very naive solution worked for me. Definitely not a fix but restarting my computer worked.

Have you tried turning it off and on again?

ragrahari avatar Apr 01 '24 16:04 ragrahari

This issue also affects M1 Pro. Previously, colima 0.6.8 was functioning properly before updating macOS to the recent version. I've also recently updated brew packages, which has updated the lima package.

Actually, I was not manually triggering colima stop each time I shutdown or restarted the laptop, yet colima started properly on the subsequent run. However, I've noticed that now I need to manually trigger the stop command each time, and it might be related to the recent Docker version (26.0.0), or lima (0.21.0) rather colima itself.

╭─walma in ~ 24-04-10 - 11:30:13
╰─○ docker -v
Docker version 26.0.0, build 2ae903e86c

After that I rebooted

╭─walma in ~ 24-04-10 - 11:37:17
╰─○ uname -a
Darwin KXRFXKX5P7 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:10:42 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6000 arm64
╭─walma in ~ 24-04-10 - 11:37:24
╰─○ sw_vers
ProductName:		macOS
ProductVersion:		14.4.1
BuildVersion:		23E224
╭─walma in ~ 24-04-10 - 11:37:29
╰─○ sysctl hw.model
hw.model: MacBookPro18,1
╭─walma in ~ 24-04-10 - 11:37:40
╰─○ colima version
colima version 0.6.8
git commit: 9b0809d0ed9ad3ff1e57c405f27324e6298ca04f
╭─walma in ~ 24-04-10 - 11:37:44
╰─○ colima list
PROFILE    STATUS    ARCH       CPUS    MEMORY    DISK      RUNTIME    ADDRESS
default    Broken    aarch64    8       24GiB     100GiB
╭─walma in ~ 24-04-10 - 11:37:47
╰─○ colima start
INFO[0000] starting colima
INFO[0000] runtime: docker
INFO[0000] starting ...                                  context=vm
> Using the existing instance "colima"
> errors inspecting instance: [vz driver is running but host agent is not]
FATA[0000] error starting vm: error at 'starting': exit status 1
╭─walma in ~ 24-04-10 - 11:37:51

Might be related to: https://github.com/lima-vm/lima/issues/2227

lampenweltwma avatar Apr 10 '24 09:04 lampenweltwma

Hi guys,

same problem occurred here on my Mac M3 (Sonoma) after brew upgrade. I could get it running again with

colima delete colima start

Best regards, mscdit

P.S.: Attention ... by doing so I hade to re-load all images/containers!

The only way I got it working, thanks!

marceljungle avatar Apr 24 '24 07:04 marceljungle

I encountered the same issue. After running this command, it worked fine.

colima stop -f

kkarthik-1 avatar May 31 '24 04:05 kkarthik-1

I ran into this as well but also got the following error:

failed to stop usernet "user-v2": Get "http://lima/services/dhcp/leases": dial unix /Users/kev/.colima/_lima/_networks/user-v2/user-v2_ep.sock: connect: connection refused

Fixed it with:

  • colima stop -f
  • rm -rf /Users/$USER/.colima/_lima/_networks
  • colima start

KevSlashNull avatar Jul 02 '24 17:07 KevSlashNull

This should be resolved via https://github.com/abiosoft/colima/pull/1045

bradleyayers avatar Jul 04 '24 07:07 bradleyayers

This has been resolved.

The vmType is now always honoured and a warning is displaying when trying to change the vmType after the initial startup.

Feel free to re-open if this is still an issue.

abiosoft avatar Aug 17 '24 06:08 abiosoft