colima icon indicating copy to clipboard operation
colima copied to clipboard

Colima daemon

Open YentlFrickx opened this issue 2 years ago • 5 comments

Currently we always have to manually start colima when starting our macbook, however it would be nice to have it as a daemon so that it can start automatically. Is there any reason why this has not been done yet?

YentlFrickx avatar Apr 22 '22 06:04 YentlFrickx

+1

It would be really nice to be able to start colima with launchctl and brew services.

edwardtheharris avatar Apr 22 '22 13:04 edwardtheharris

I am interested in taking this on but curious about what the end result might look like.

The simple path forward is a Colima process per vm, most configurations are likely to only have one and this is how qemu operates. I would think the IPC surface for this is minimal and just operating like detach mode as docker does. Meaning, do not attach user stdout/stdin/stderr. The result is a process to only supervise the qemu process spawned.

Taking some inspiration from this library, https://pkg.go.dev/github.com/sevlyar/go-daemon?utm_source=godoc. Not taking the dependency on the library, unless that is okay?

Or is there a desire for this to introduce a true daemon that manages all Colima instances?

Thoughts?

jbreiding avatar May 17 '22 16:05 jbreiding

I spent some time this weekend and got to what I would consider a draft PR.

However, this same library is used to launch a few other daemons, and I don't believe this nesting will work.

Qemu exits after complaining about missing the gvproxy domain socket?

Definitely looks a lot like this. https://github.com/sevlyar/go-daemon/issues/82

jbreiding avatar May 23 '22 14:05 jbreiding

@jbreiding my bad! I actually composed a response but just realised I didn't send it. You do not need to worry about background daemons btw, and it is not needed in this case.

I am working an autostart config for the VM, as well a new start-all command. In essence all that will be required to start all VMs will be

colima start-all --filter=autostart=true

The only thing left would be a user launchd file that will include the above command.

abiosoft avatar May 23 '22 16:05 abiosoft

@abiosoft no worries at all, it was a nice little weekend adventure.

btw, do you use vscode for debugging? If you do would you mind sharing the debug configuration?

I see the .gitignore ignores this folder and I had a painful time launching with debug to troubleshoot what was happening with the daemon process.

Looks like the work for a service with brew can be leveraged from here. #96

jbreiding avatar May 23 '22 19:05 jbreiding

Hello, Is there any news regarding this issue? On my system, the drives can take up to a minute to mount at boot, so it would be useful to be able to start colima as a launchd service to wait until the mounting is done.

fskaeh avatar Oct 09 '22 17:10 fskaeh