I’m trying to automate the virtual machine creation process, but I’m encountering an issue with the following command. The command runs without errors, but the virtual machine seems to require user input. When I access the console, all I see is a black screen:
sudo virt-install
--connect=qemu:///system
--virt-type kvm
--name=ubuntu2204
--os-variant=ubuntu22.04
--vcpus 4
--cpu host-passthrough
--memory 4096
--disk path=/var/lib/libvirt/images/ubuntu2204.qcow2,size=40,format=qcow2,sparse=true,bus=scsi,discard=unmap
--disk path=/var/lib/libvirt/boot/seed.iso,device=cdrom
--network network=default,model=virtio
--cdrom /var/lib/libvirt/isos/ubuntu-22.04.4-live-server-amd64.iso
--console pty,target_type=serial
--boot loader=/usr/share/OVMF/OVMF_CODE.fd,loader.readonly=yes,loader.type=pflash
--accelerate
--graphics vnc,listen=0.0.0.0
I can create a VM using virt-manager, but I want to fully automate the process to avoid the initial setup steps (selecting username, password, additional packages, etc.) every time I create a new VM.
How do other companies offering VPS automate this process? Can you please guide me on the right path to achieve full automation? What should I learn or look into?
Thank you for your help!