3 ms·
FWIW, if you're comfortable with command-line, here's a way to use QEMU with `virt-builder`[a] and libvirt (the virtualization API): (1) Download a Fedora imag
by kashyapc 4y ago
FWIW, if you're comfortable with command-line, here's a way to use QEMU with `virt-builder`[a] and libvirt (the virtualization API):
(1) Download a Fedora image (or any one of the images that `virt-builder` supports: `virt-builder --list | less`)
$> virt-builder fedora-36 --format qcow2 \
-o vm1.qcow2 --root-password secret
(2) Import the image to libvirt:
$> sudo virt-install --name vm1 --ram 4096 \
--disk path=/var/lib/libvirt/images/vm1.qcow2,format=qcow2 \
--nographics --os-variant fedora-36 --import
Then you can do various operations via `virsh` (the shell tool). Start a VM, and see the boot process on the serial console:
$ sudo virsh start --console
Create a snapshot:
$ sudo virsh snapshot-create-as vm1 snap1 "Clean Fedora 1"
With this kind of snapshot (called "internal snapshots"), the original and its delta, i.e. the snapshot, are stored in a single disk image file; this is convenient for moving it across machines. This only works with QCOW2 images. To revert to the snapshot:
$ sudo virsh snapshot-revert vm1 snap1
And so on[b].
[a] https://libguestfs.org/virt-builder.1.html https://libguestfs.org/virt-builder.1.html
[b] https://developer.fedoraproject.org/tools/virt-builder/about.html https://developer.fedoraproject.org/tools/virt-builder/about...
- koprulusector 4y agoDoes this work on Mac M1? Last time I tried setting up libvirt/libguestfs on my work Mac M1 I ran into various problems and gave up. This was somewhere around April 2022.
- rwmj 4y agoSo .. actually I've been porting libguestfs & guestfs-tools to Mac M1 a couple of weeks ago. I'm intending to write up docs on how to build it, and didn't get around to it, but it will eventually appear here: https://listman.redhat.com/archives/libguestfs/ https://listman.redhat.com/archives/libguestfs/