Files
homelab/active/systemd_qemu/qemu.md
ducoterra ef9104c796
All checks were successful
Reese's Arch Toolbox / build-and-push-arch-toolbox (push) Successful in 14s
moving everything to active or retired vs incubating and graduated
2025-04-19 18:52:33 -04:00

1.4 KiB

QEMU

QCOW2

QCOW2 (KVM, Xen) qcow2 QED (KVM) qed raw raw VDI (VirtualBox) vdi VHD (Hyper-V) vpc VMDK (VMware) vmdk

Restore qcow snapshots

# Create a snapshot
qemu-img snapshot -c snapshot-name /var/lib/libvirt/images/vm-image.qcow2

# List snapshots for a given image
qemu-img snapshot -l /var/lib/libvirt/images/vm-image.qcow2

# Restore snapshot
qemu-img snapshot -a snapshot-name /var/lib/libvirt/images/vm-image.qcow2

Convert qcow to bootable drive

qemu-img convert -f qcow2 -O raw /var/lib/libvirt/images/vm-image.qcow2 /dev/sdb

Convert bootable drive to qcow

dd if=/dev/sda of=/home/ducoterra/Downloads/toshiba.raw conv=noerror,sync,notrunc,sparse status=progress
qemu-img convert -f raw -O qcow2 -p /dev/sdd /var/lib/libvirt/images/toshiba.qcow2

If you need to resize a windows partition to non-continuous space simply grow the last partition, shrink it to the end of the drive, then grow the windows partition with gparted.

ISO

pacman -S cdrtools
mkisofs -r -iso-level 4 -l -o /tmp/arch-files.iso ./arch