One-liner libvirt KVM guest

Boot and install a new KVM guest with guest agent support with this super simple libvirt one-liner (great for scripts and CI deployments).
Tested on a Centos 7.1 host creating a Centos 7.1 guest from a basic Kickstart file.

Parameters should be quite self-explanatory, in any case here's the documentation for virt-install. Important: remember to change the unix socket path on the last line.

virt-install --name "guest01" --memory 2048
-l http://your.ris.server/ris/centos71
-x "ks=http://your.ris.server/ris/ks.cfg console=ttyS0"
--disk size=8,pool=your_pool,bus=virtio,format=qcow2
-w default
--graphics vnc
--channel unix,mode=bind,path=/var/lib/libvirt/qemu/guest01.agent,target_type=virtio,name=org.qemu.guest_agent.0

Popular posts

Mirth: recover space when mirthdb grows out of control

1/4/2000 to 1/4/2025: the beginning

From 0 to ZFS replication in 5m with syncoid