Hadyai Internet R&D LAB

แหล่งความรู้ => Server => Linux Server System => ข้อความที่เริ่มโดย: admin ที่ 07 กันยายน 2011, 16:35:53

หัวข้อ: Mount a Virtual Box .vdi as a logical drive in Ubuntu
เริ่มหัวข้อโดย: admin ที่ 07 กันยายน 2011, 16:35:53


- make sure you have qemu-nbd available (can be found in the qemu-kvm package)
- load the nbd module through ' sudo modprobe nbd '
- let qemu-nbd provide a loopback block device for the vdi ' sudo qemu-nbd -c /dev/nbd0 <vdi-file> ' and find your .vdi in the device /dev/nbd0 and its partitions in /dev/nbd0p1, /dev/nbd0p2 and so on.
- mount your desired partition(s) or do whatever you want with these devices (format, change partitions...)
- when done, remove the blockdevices (after unmounting etc) through ' sudo qemu-nbd -d /dev/nbd0 '.