Mounting a VirtualBox hard disk image file (.vdi) in Linux
- On/Up-to Fedora 19 (You can try these steps on Fedora 20 and others too), you need to install these packages:
# yum install nbd qemu-common
# yum install qemu-kvm
- To mount a partition on a hard disk image file:
# modprobe nbd
# sudo qemu-nbd -c /dev/nbd0 "file.vdi"
# sudo kpartx -a /dev/nbd0 // creates mapped devices in /dev/mapper/
# sudo mount /dev/mapper/nbd0p1 /some/destination/folder // mounts first partition of the image.
- To unmount:
# sudo umount /some/destination/folder
# sudo kpartx -d /dev/nbd0
# sudo qemu-nbd -d /dev/nbd0
No comments:
Post a Comment