How to Mount qcow2 KVM/Xen/VMware VM Image

To mount qcow2, you need to mount this image as a ‘Network Block Device’.

First, enable NBD

modprobe nbd max_part=8

Now, connect the qcow2 as an NBD device

qemu-nbd --connect=/dev/nbd0 /vz/vmprivate/v1002/harddisk.hdd

Now to mount the partition, first detect the partition

fdisk /dev/nbd0 -l

Now, you may mount the partition

mount /dev/nbd0p1 /mnt

Once, all the jobs are done, you may unmount, disconnect, and remove the NBD kernel module

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

KVM VM Not starting – could not get access to acl tech driver ‘ebiptables’

Issue

KVM VM not starting with the following error when you try to start:

could not get access to acl tech driver 'ebiptables'

There is a nwfilter module for libvirt. If for some reason, it comes up with an issue, the above error would appear. To fix this, you need to update (If any update is available) / reinstall (If no update is available) the following module using Yum:

libvirt-daemon-config-nwfilter

The command would be like the following:

yum update libvirt-daemon-config-nwfilter

That shall fix the issue.