Posts Tagged ‘virtualbox’

How To Mount Virtualbox VDI With LVM Partition On Ubuntu

October 1, 2015 Leave a comment

First, install the QEMU tools. In Ubuntu, you’ll find them in the qemu-kvm package. Whatever package your distribution ships which contains the qemu-nbd binary should be fine and also install the lvm2

sudo apt-get install qemu-kvm

sudo apt-get install lvm2

Load the nbd kernel module. Yes, I’m serious, the network block device module!

sudo modprobe nbd max_part=16

Then run qemu-nbd, which is a user space loopback block device server for QEMU-supported disk images. Basically, it knows all about weird disk image formats, and presents them to the kernel via nbd, and ultimately to the rest of the system as if they were a normal disk.

sudo qemu-nbd -c /dev/nbd0 <vdi_file_location>

Ex: sudo qemu-nbd -c /dev/nbd0 /home/testuser/Desktop/SharedFolder/xubuntu_1404-disk2.vdi

Re-read The Partition Table Without Rebooting Linux System using partprobe command

sudo partprobe /dev/nbd0

Once installed, run pvscan to scan all disks for physical volume. this to make sure your LVM harddisk is detected by Ubuntu


After that run vgscan to scan disks for volume groups.


Reading all physical volumes. This may take a while…
Found volume group “VolGroup00” using metadata type lvm2

Activate all volume groups available.

vgchange -a y

Run lvscan to scan all disks for logical volume. You can see partitions inside the hard disk now active.

ACTIVE ‘/dev/VolGroup00/LogVol00’ [72.44 GB] inherit
ACTIVE ‘/dev/VolGroup00/LogVol01’ [1.94 GB] inherit

Mount the partition to any directory you want, usually to /mnt
mount /dev/VolGroup00/LogVol00 /mnt

How to install Virtualbox guest additions on Xubuntu 14.04

October 13, 2014 1 comment

Note: The following instructions are tested in windows 7. Virtualbox installed in windows 7 and xubuntu 14.04 installed in virtualbox .

After installing xubuntu 14.04 we need enable the virtualbox guest additions to get the full screen other features like folder sharing. Following are the steps to installing Guest Additions.

Step 1: Install kernel headers and build tools.

Virtualbox guest additions are compiled for the target system, so it needs the necessary kernel headers and related programs. Install the following 2 packages.

sudo apt-get install build-essential module-assistant

Step 2: Now run following command

sudo m-a prepare

Step 3: Compile virtualbox guest additions

Now click “Devices > Insert guest additions CD image” in the virtualbox window. This will insert the guest additions cd image into the guest OS (xubuntu here). The cd should get mounted automatically inside the /media directory.

The path should be similar to something like this

Mount manually, If it does not mount by itself, then you can manually mount it. Find out the device using blkid and then use the mount command to mount it somewhere in.

%d bloggers like this: