Virtualization – How to Mount a QCOW2 Disk Image

mountqemuvirtualization

I have a QEMU virtual machine that uses a qcow2 disk image.

How can I mount its filesystem without powering on the virtual machine?

Best Answer

A quick google search turns up the qemu-nbd program, mentioned here. It is part of the qemu-kvm package, so you'll have to install KVM if you aren't using that already. Not sure about any direct GNOME/KDE solutions, if that is what you were looking for. Here is an example for using it:

sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 --read-only /path/to/image.qcow2
udisksctl mount -b /dev/nbd0p1