Disk expansansion in VirtualBox

I have been using Sun’s (now Oracle’s) VirtualBox to run Ubuntu 10.04 as a guest operating system inside a Windows 7 host.  I’ve also tried Windows 7 inside an Ubuntu host, but I’m doing it the other way ’round now since I end up using so many Windows-specific applications.

Anyway, what started out as an experiment has become a routine setup for me.  Unfortunately, when I set up the Ubuntu guest, I didn’t give it much virtual disk space.  So I’m confronted with cloning and enlarging the virtual disk I use for Ubuntu.

After reading many out-dated accounts of how to do this that don’t take into account the UUID and grub problems that could result in simply cloning the contents of disks, I think I have a solution.  Here is what I tried using VirtualBox 3.2.2:

  1. Create a new virtual disk (vdi) the size you want using the tools in virtualbox (File -> Virtual Media Manager).
  2. Set the new vdi as slave in the specified Virtualbox (Machine -> Settings -> Storage).
  3. Download (if needed) and attach the latest .iso for Clonezilla (Settings -> Storage).
  4. Check that the boot order will pick up the CD before the hard drives.
  5. Use Virtualbox to boot from Clonezilla.
  6. Follow Clonezilla prompts to copy the old hard drive (vdi) to the new hard drive (vdi).  Naturally, make sure you get order correct.  Use the disk-to-disk option and allow Clonezilla to use grub when done.
  7. When done, use Virtualbox to dismount the Clonezille iso.
  8. If any adjustments are needed in the partitions on the new disk, you can download (if needed) the gparted live iso (the one you can boot from) and use virtualbox to boot from it.  I had to do that to adjust the sizes of the partitions.
  9. After the new disk is just how you want it, dismount any iso from the cd drive, remove the original vdi drive, and reassign the new vdi drive the the top boot order (IDE primary master, e.g.).
  10. Now boot from virtualbox.
  11. If all goes well, give yourself a nice beverage.

Shared folders in VirtualBox

I am exploring using virtualbox on my Windows 7 64-bit machine to run Ubuntu 10.04 as a guest operating system.  Ok, its a little geeky, but I just can’t get along without a little linux once in a while.  I’ve used virtualbox before, but mostly on linux host machines running windows operating systems as guests.

Virtualbox 3.2.2 was an easy install on the windows host.  The installation of the guest additions (used to more fully integrate the mouse, keyboard, and file systems) was a little flaky, but they seem to be working ok.

I defined a shared folder in virtualbox so I could access my windows documents folder in ubuntu.  Then I attempted to mount the shared folder in ubuntu.  The command I’ve used for that before is

sudo mount -t vboxfs <sharename> <mountpoint>

vboxfs stands for ‘virtualbox file system’ I always assumed, so its easy to remember.

This has worked before for me, but after several failed attempts, I started reading documentation.  Some documents suggested using -F rather than -t, but that didn’t work either.  One private web page I found showed “-t vboxsf” rather than “-t vboxfs”.  I assumed it was a typo when I read it, but it actually worked for me.  Did some Sun (now Oracle) employee make a typo in the new virtualbox?