How to mount a vdi file in ubuntu 13.10? [duplicate]

Running Ubuntu 14.04 with Virtualbox 4.3.10 I installed the package by forcing dpkg.

sudo dpkg -i --force-depends virtualbox-fuse_4.1.18-dfsg-1ubuntu1_amd64.deb

Everything worked just fine after that.

When you mount the vdi file it just gives you access to the partitions, but you need to then mount the partition somewhere. For example:

mkdir ~/vdisk
mkdir ~/part1
sudo vdfuse -f Machine.vdi ~/vdisk
sudo mount ~/vdisk/Partition1 ~/part1

Based on @gavenkoa's answer, but for mounting an existing image instead of creating a new one::

$ sudo apt-get install qemu-utils
$ sudo modprobe nbd max_part=16
$ sudo qemu-nbd -c /dev/nbd0 ~/path/to/my.vdi
$ sudo partprobe /dev/nbd0
$ sudo mount /dev/nbd0p1 /mount-target

If you have more than one partition, you can access them by number — nbd0p1 is partition 1, nbd0p2 would be partition 2, and so on.

After you finished your investigation, you should unmount VDI image from the network device.

$ sudo qemu-nbd -d /dev/nbd0

virtualbox-fuse was deleted from apt repository. You can download it from Launchpad, and install it. Once you download it, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, navigate to where the file was downloaded, and run the command(s) below:

sudo dpkg -i <package_name>.deb

Once installed, you can mount the vdi by typing

sudo vdfuse -f /home/user/file.vdi /home/user/mountpoint

Note: virtualbox-fuse depends on virtualbox 4.1.18, and will not work with 4.2. Thanks to Marius.


...For those of you that use 4.2, you should downgrade if you wish to use this software ...

This is not correct! The 4.1-version of "vbfuse" is compatible to the 4.x line of the official virtualbox versions.

Just download the virtualbox-fuse package, but don't install it with:

sudo apt-get install -d virtualbox-fuse

Instead, simply copy the package to a (temporary) directory, extract is and copy the "vdfuse" binary over to your system:

mkdir /tmp/vboxfuse
cd /tmp/vboxfuse
mv /var/cache/apt/archives/virtualbox-fuse*.deb .
dpkg -x virtualbox-fuse*.deb .
cp -av usr/bin/vdfuse /usr/bin/.
cd /tmp
rm -rf vboxfuse

You will need root privileges to execute some of the above commands depending on the permissions of /usr and /var in your system.

This way you don't have to uninstall your virtualbox-4.x. Tested under Ubuntu 12.04, but also should work on other versions.

See: https://wiki.blue-it.org/VirtualBox#Mount_a_vmdk_file_in_linux