Mount Qcow2 Image

2023-03-31

Enable NBD on the host:

modprobe nbd max_part=8

Connect qcow2 image as a network block device:

qemu-nbd --connect=/dev/nbd0 /path/to/image.qcow2

Find the VM’s partitions:

fdisk /dev/nbd0 -l

Mount partition from the VM:

mount /dev/nbd0p3 /mnt/point

To unmount:

umount /mnt/point
qemu-nbd --disconnect /dev/nbd0
rmmod nbd

Enter your instance's address