Sometimes you need to access guest disk without booting it.

From time to time i just need to access few files from VM backups, so I restore VM to other ID on host and mount disk to prevent network IP conflicts etc.

.raw

It can’t be easier

Mount

losetup /dev/loop0 /var/lib/vz/images/100/vm-100-disk-1.raw
mount /dev/loop0p1 /mnt/tmpdiskrescue

Unmount

umount /mnt/tmpdiskrescue

.qcow2

Little more tricky

Kernel module

First, you will need kernel module loaded

modprobe nbd max_part=63

Mount

qemu-nbd -c /dev/nbd0 /var/lib/vz/images/100/vm-100-disk-1.qcow2
mount /dev/nbd0p1 /mnt/tmpdiskrescue

Unmount

umount /mnt/tmpdiskrescue
qemu-nbd -d /dev/nbd0

Source http://alexeytorkhov.blogspot.com/2009/09/mounting-raw-and-qcow2-vm-disk-images.html