Sign up ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Is it possible to mount a VirtualBox drive image (.vdi) so the contents can be viewed in Nautilus etc.?

I have a windows 2000 .vdi which won't boot ("inaccessible boot device") after upgrading from VirtualBox 2.x to 3.1.6. I believe the IDE drive details have changed and that all I need to do is access the internal drive image and edit the Windows boot.ini to point to the new location.

share|improve this question
If your .vdi and then .img file contains more then 1 partition, this is very useful: browse-img-without-mounting – user2689749 Mar 31 '14 at 22:00

6 Answers 6

up vote 32 down vote accepted

You can convert into standard image and then mount it.

VBoxManage clonehd --format RAW ubuntu.vdi ubuntu.img


mount -t ext3 -o loop,rw ./ubuntu.img /mnt

You will need to KNOW the type of file system, ext3 in this case. After it is mounted, go in and edit away with the editor of your choice. Don't confuse files inside the /mnt location with the running host, or it will be bad.


share|improve this answer
Specilly useful in a situation like this. OP will be able to work on the copy keeping the original as backup. – Javier Rivera Dec 30 '10 at 15:22
Careful doing this with dynamically sized .vdi files. Converting to .img will force the image file to be as big as the logical size of the disk, which is why this approach works, but it might be much larger than .vdi file was. Take a look at the output of VBoxManage showhdinfo [your vdi file] if you're not sure. – Jack O'Connor Aug 25 '13 at 22:21
-1, stwissel and Maxime R.'s answers provide solutions--this is a fair workaround, but not the best answer to the question – STW Feb 17 at 18:39
If the image has a partition table (like most drives), then you will need to combine this answer with this one to mount the individual partitions. – bain Mar 22 at 19:49

It looks like vdfuse is the tool you are looking for. It is in the Ubuntu repositories. If you want to compile yourself (2010 source) you can do that too.

However for most of us it boils down to a simple:

sudo apt-get install virtualbox-fuse

It seems it now supports dynamic vdi as well.

And to mount the .vdi file in /mnt dir use the command:

sudo vdfuse -a -f /path-to-vdi-file /mnt

The entire disk will be mounted with partitions Partition1 , Partition2 naming format. Then those files can be loop mounted. For example,

sudo mount -o loop /mnt/Parition1 /mountpoint
share|improve this answer
Thanks for pitching in. vdfuse has already been provided as an answer though. Please improve that answer instead of adding a duplicate. – matt wilkie May 7 '12 at 16:49
@mattwilkie: The difference now: no manual compile required anymore – stwissel May 9 '12 at 2:20
You are welcome. Sitting at a propper screen/keyboard instead of pecking on glas made all the difference :-) – stwissel May 10 '12 at 3:15
It's not available in 14.04. – int_ua Aug 9 '14 at 20:14
One can download it from here: and it works (on 15.04) – sup May 13 at 14:17

Use qemu-nbd, the process is explained on serverfault and in this blog.

Basically, you'll have to install qemu if needed:

sudo apt-get install qemu

Then you'll need to load the network block device module:

sudo rmmod nbd
sudo modprobe nbd max_part=16

Attach the .vdi image to one of the nbd you just created:

sudo qemu-nbd -c /dev/nbd0 drive.vdi

Now you will get a /dev/nbd0 block device, along with several /dev/nbd0p* partition device nodes.

sudo mount /dev/nbd0p1 /mnt

Once you are done, unmount everything and disconnect the device:

sudo qemu-nbd -d /dev/nbd0
share|improve this answer
I'd like to note that max_part=16 seems to be a critical part. Without it you won't see any /dev/nbd0pX files, despite the main device will work properly. Check the following discussion on Gentoo forums to see people met this trouble. – firegurafiku Jun 11 at 16:54
All answers work to some extent but this is my favorite and should be the accepted one. clonehd do the job but doubles storage requirements. virtualbox-fuse is ideal but although you can still get it, it didn't make it to the repos in modern releases of OS. – Hatoru Hansou Sep 17 at 22:31

Set the disk as secondary master for another virtual OS, then boot into this (virtual) OS and you can mount it.

share|improve this answer

I didn't tested myself but there seems to be a fuse module to mount them (vfduse), check the following link:

Please note that using it for write access is risky.

share|improve this answer

Not what you requested, but if it's just a matter of getting files off of the vdi, and you want a very quick solution:

  1. Run an ssh server on your host (apt-get install openssh-server && service ssh restart)
  2. Use VirtualBox to build a virtual machine from the existing vdi file, then boot up that virtual machine. (I just kept the default Network Adapter (NAT) when building the VM.)
  3. Within the virtual machine, sftp to your host. (sftp hostuser@hostip)
  4. In the sftp session, put as many files to the host as you need.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.