UTM
UTM copied to clipboard
Please provide mechanisms for launching unattended OS installations in VMs, especially Linux kickstart/preseeding
The feature must provide some automated way of "typing" on the console after the VM boots.
The feature should also provide some way of launching an ephemeral web server and related infrastructure that allows a guest to retrieve an unattended installation settings file.
HashiCorp Packer's qemu builder includes good examples of both features: https://developer.hashicorp.com/packer/plugins/builders/qemu
Have you tried https://docs.getutm.app/scripting/cheat-sheet/
Have you tried https://docs.getutm.app/scripting/cheat-sheet/
I have, @osy. While it covers the creation of the vm, it does not provide any mechanisms for interacting with the guest OS at boot time, nor does it provide an easy way to supply the guest OS with a kickstart or preseed file.
This can be accomplished with an ISO image or attached USB device containing a kickstart/cloud-init/whatever definition file - is the request here to create a UI for that?
This can be accomplished with an ISO image or attached USB device containing a kickstart/cloud-init/whatever definition file
It can, but the process of creating that file is really finicky, which is why I asked for functionality that looks like the way Packer's qemu builder serves up kickstart files via an ephemeral http server.
But even more importantly, UTM's scripting API needs to provide a way to "type" on the VM's console once the VM "powers on." Some installer images like Ubuntu need autoinstall[^1] appended to the kernel command line in order to make proper use of the kickstart file, however it gets supplied.
[^1]: As noted in https://ubuntu.com/server/docs/install/autoinstall-quickstart, "Unless you interrupt boot to add autoinstall to the kernel command line, the installer will prompt for confirmation before touching the disk."
I can only second this feature request!
If we could create packer images for UTM a whole new world would open up. I'd like to use packer with ansible to create UTM templates like the derivative-maker does for the Whonix UTM template.
Has anyone tried this? https://github.com/naveenrajm7/packer-plugin-utm
Hello! I am the developer of UTM packer plugin. Currently, the plugin supports building custom UTM VM with provisioner support using an already existing UTM file. (uses builder utm-utm)
I tried to add support for building VMs from ISO (builder utm-iso). But currently, there is no way to send boot commands to UTM to do OS installation.
As the OP shared, packer qemu plugin uses VNC to send boot commands and does OS installation . Since UTM uses qemu something similar is possible if we launch UTM VM with qemu additional arguments -vnc localhost:1 .
However, currently UTM APIs does not support adding qemu additional arguments. Once the API is available, we can try implementing unattended OS installs.
We don't expose arguments because UTM doesn't just call QEMU. It uses a fork of QEMU and is integrated with UTM's backend. For example we don't support VNC at all.
Hmm actually.. If I'm not wrong the support was added , here ? Because, I am able to launch VM with VNC arguments and connect to it through VNC client.
-
Launch with VNC arguments
-
Connect with VNC client
So I just need the ability to do the same using API . (Specifically, ability to update QEMU additional arguments section of the config )
Oh you're right, I guess I forgot about that
Update:
I added ISO builder to my packer plugin. So now we can create VMs from ISO and perform automated OS installation using the plugin.
Check the demo below (Creating Ubuntu VM using autoinstall by automatically sending boot commands through VNC). The two manual steps were
- adding qemu arguments #6661
- updating display. #6660
I have created issues to address both steps so we can completly automate VM creation/installation.
https://github.com/user-attachments/assets/72c23bc7-7ca5-4aa5-9b54-2b72d37dd473
Does UTM not use libvirt to interface with qemu then?
virt-install is much nicer than packer as you can provide kernel arguments and inject a kickstart/preseed/cloud-init without messing with custom ISO's or typing over vnc.