Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any way to mount the .vdi image that is running on a Virtual Box in the local drive.

share|improve this question

migrated from Apr 16 '12 at 1:54

This question came from our site for professional and enthusiast programmers.

Actually two same copies of the same .vdi are running on two different Virtual Box and i have to sync their home directory. So i was thinking of mounting the .vdi and then synchronizing the home directory. – sekhu cool Mar 17 '12 at 16:29

This post explains how to mount VDI images using qemu-nbd, which exposes images as a Network Block Device. Note that this must not be done while the image is being used by a running VM. The following will mount the first partition of the image on /mnt/myvm1:

sudo modprobe nbd
sudo qemu-nbd -c /dev/nbd0 myvm.vdi
sudo mkdir /mnt/myvm1
sudo mount /dev/nbd0p1 /mnt/myvm1
share|improve this answer

You must log in to answer this question.