Increase the size of vmdk or vdi (Virtualbox)

A major part of my PC experience is linked to Ubuntu. I’d always have Ubuntu installed on the machines I work on. No marks for guess that I am still using Linux and posting from inside it. Well in a way I am also a Linux evangelist; Sometimes even the office machines would secretly taste the flavor of Linux, thanks to the Boot from USB. Almost all my friends have Ubuntu installed (yeah coz of me) and I’d SSH to their machines and play songs etc remotely and things get all funny and haunting initially. I just love it.

Anyway there was this Virtual Disk File (VMDK of VMWare fame) that I created under VMWare and now it can even be used from VirtualBox (good stuff). So I booted inside it and it was running low on disk. I couldn’t install MS Office on it. So I figured it was time to RESIZE the disk.

#1 (clone the disk to a vdi format)

$ /usr/lib/virtualbox/VBoxManage clonehd “windows-xp-64bit.vmdk” “windowsXP.vdi” –format vdi

— windows-xp-64bit.vmdk = source vmdk

— windowsXP.vdi = target vdi

#2 (use the vdi disk and resize it to the desired capacity)

$ /usr/lib/virtualbox/VBoxManage modifyhd “windowsXP.vdi” –resize 10000

— here we are re-sizing it to 10Gb.

Now that we have a new vdi. Simply change the settings in the VirtualBox and use the new VDI.

Use the new VDI

Use the new VDI

Now, after we booted in the brand new OS, we have two options.

A) Use GParted to resize the partition (expand it).

download GParted ISO; And boot with that ISO instead of the VDI and resize the C Drive. Next reboot in the VDI and we are done!

B) Use Windows Disk Management Wizard and create a new partition with the recently inherited storage.

Create a new partition

Create a new partition

That’s all.

Take a bow!




How to merge snapshots together:

VBoxManage clonehd fullpath/{uuid-of-last-snapshot}.vdi thedisk-full.vdi

clonehd only the last snapshot.

The uuid can be found from VBoxManage list hdds | grep VmName | tail

In the GUI (on Windows), select the VM, select Snapshots from the top right, right click on the snapshot you want, select Clone…, and select Full Clone in the dialog.

Ubuntu fix Fn Brightness keys

So my Acer Aspire 5738 encountered the oh-the-Brightness-Function-keys-are-not-working-yet-again issue after the installation of Ubuntu 12.04. There is a simple fix and some related caveats. So here we go …..

#1 (open the file in gedit or vi)

$ sudo vi /etc/default/grub
[sudo] password for nikunj:

#2 (find an insert the arguments in gray)

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi_osi=Linux acpi_backlight=vendor

#3 (update the grub configuration)

$ sudo update-grub
Generating grub.cfg …
Found linux image: /boot/vmlinuz-3.2.0-24-generic
Found initrd image: /boot/initrd.img-3.2.0-24-generic
Found linux image: /boot/vmlinuz-3.2.0-23-generic
Found initrd image: /boot/initrd.img-3.2.0-23-generic
Found memtest86+ image: /boot/memtest86+.bin
Found Windows 7 (loader) on /dev/sda1
Found Ubuntu 11.10 (11.10) on /dev/sda2

Just reboot the machine.


At times the screen would go entirely dark. Or would not apparently resume from a blank screen or when the screensaver gets active.

For such cases, all you need to do is press “Fn + Brightness UP button” and screen will GLOW. Simple!!

(This post is more like a NOTE TO SELF. But if it helps you in someway then its even better … AWESOME!! :D)


Works for Ubuntu 12.10 perfectly 🙂

Update (2013/01/08):

You can use “sudo gedit /etc/default/grub” if you are not very familiar with vi editor! 🙂

Update (2013/05/12):

For Ubuntu 13.04 do the following:

GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash acpi_osi=Linux acpi_backlight=vendor

Update (2014/05/25):

Works on Ubuntu 14.04.