Mount partitions from a VirtualBox VDI in Linux.

7 07 2011

Hi, people!

The title’s pretty self explanatory, so I’ll just dive right in…

I needed to access data on a VM which had no network connectivity, and therefore needed a way to mount partitions from the host (Ubuntu 11.04 in this case).

After a little research, I found this article. It explains in simple steps how to go about this. Here’s my much shortened (but far less complete) version:

First, you need to have the package qemu-kvm installed. This can be done in Ubuntu by running the following command:
sudo apt-get install qemu-kvm

Next, load the nbd kernel module.
sudo modprobe nbd

Now you’re ready to make the partitions available to the host OS by running:
sudo qemu-nbd -c /dev/nbd0 {VDI FILE}

This will allow you to access the partitions as /dev/nbdp{number}. For example, to mount the first partition of the VDI in /mnt, you would run the following command:
sudo mount /dev/nbd0p1 /mnt.

For a whole bunch more information on this, click the link to the original article I mentioned before.

Any questions, just ask!

n00b

Advertisements




Disable Gnome-Panel on Ubuntu Karmic Koala

8 11 2009

Hey all. I’ve recently upgraded my home desktop to Ubuntu’s latest release, version 9.10 Karmic Koala. I’ve also spent some time messing with my desktop, and am now using AWN (Avant Window Navigator) as my main launcher/menu, so needed to stop Gnome Panel from starting on bootup.

This is done by running gconf-editor (either from a run dialog or from CLI), and navigating to Desktop –> Gnome –> Session –> Required-Components. Now you will have three values in the panel on the right. Change the value of “Panel” from “gnome-panel” to “” (blank). Note that in order for this to work, you’ll need to have another panel application (e.g. AWN) running and in your startup programs folder.

Just a quick one. Took me bloody ages to find this out, so hope this has made things easier for some of you!

n00b