Qemu

- 53 words - 1 minute

UEFI boot

apt install ovmf
qemu-system-x86_64 -bios /usr/share/ovmf/OVMF.fd \
                   -enable-kvm -cpu host -m 4G \
                   -cdrom debian-testing-amd64-netinst.iso

Mount a disk image

modprob nbd max_part=8
qemu-nbd --connect /dev/nbd0 -f qcow2 file.qcow2
# create one or more partitions in /dev/nbd0
mount /dev/nbd0p1 /mnt
# copy files under /mnt
umount /mnt
qemu-nbd --disconnect /dev/nbd0
rmmob nbd