Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

[b] https://developer.fedoraproject.org/tools/virt-builder/about...



Does 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.


So .. 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/




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: