Mounting qcow2 Images
Working directly with qcow2 images without the need to boot a virtual machine can come in handy from time to time. These files represent virtual storage but unlike a raw byte image you cannot just use losetup. Luckily qemu comes with tools to make this task simple.
First verify that NBD is installed and your qemu installation has been compiled with NBD support.
Getting started, as root:
1 | modprobe nbd |
When everything is finished and the file systems unmounted:
1 | qemu-nbd -d /dev/nbd0 |
Don’t forget the ever useful qemu-img
command.
Links: