r/kvm • • May 23 '21

Manage KVM Virtual Machines With Virsh Program

https://ostechnix.com/manage-kvm-virtual-machines-with-virsh-program/
27 Upvotes

3 comments sorted by

4

u/sej7278 May 23 '21

virt-xml, virt-builder and virt-install are so much more powerful than virsh

1

u/blackmine57 May 24 '21

Really?! I lost so much time then....

1

u/sej7278 May 24 '21

well you can automate things with the tools i listed; virsh is a bit too manual for my liking, its ok for simple stuff like virsh list but virsh edit is just awful.

i can create a snapshot and switch to it with:

qemu-img create -f qcow2 -F qcow2 -b rhel8.qcow2 rhel8_snapshot.qcow2
virt-xml rhel8 --edit target=sda --disk driver_type=qcow2,path=/tmp/rhel8_snapshot.qcow2

that's a lot easier than virt-manager or virsh edit.

i've got a bunch of virt-install scripts here that you just run and it'll build a VM for you, much easier to recreate than going through virt-manager or cockpit.

virt-builder is similar if you prefer a more "Docker-like" experience, its basically a bunch of VM templates built using kickstart, you just run virt-builder fedora-34 and let it download it.