Multi Boot vs Virtual Machine

When I bought a 1TB hard drive last year, I had a decision to make. How would I slice up the new 1TB drive? I was running multiple operating systems on my computer desktop. I was using Linux 95% of the time and the other 5% on Windows, if at all.

So, I partitioned my drive and gave Windows 160GB. The rest went to Ubuntu.¬†Knowing what I know now, I wouldn’t do it the way I did it. I would format all 1TB for the Linux partition. What about Windows? From hindsight, I could easily install Windows as a virtual machine instead of having a multi boot setup.

There are several advantages to using virtual machines over multi boot.

  1. You can easily launch a virtual machine without rebooting your computer.
  2. You can have both Linux and Windows running at the same time.
  3. You can clone as many instances of Windows.
  4. You can easily delete a virtual machine and free up the partition.

These are good enough reasons for me to prefer virtual machines over a multi boot setup. Knowing what I know, I would rather install Windows in a virtual machine using Virtualbox. So, if you’re at the same juncture of trying to make a decision whether to partition your drive. Don’t. Use virtual machines instead.

Increase Disk Space Of A Virtual Machine

One of the cooler technologies to arrive on the desktop the past¬† ten years is virtualization. With virtualization software, desktops are able to run multiple virtual environments on a host computer. You can easily run Windows on top of Linux and vice versa. Two of the most popular virtualization software that come to mind are VMWare and Virtualbox. I use the latter because it’s open-source.

My host system is Ubuntu 11.04 and I run several Linux distributions on it, as well as a single instance of Windows XP. Unfortunately, I’ve only allocated a 10GB for my Windows XP virtual machine, which is the default size when you create a new virtual machine or VM. After several weeks of normal use, I found out that I needed more disk space.

Increasing the disk space on the VM is not quite the easy as I thought it would be. In fact, the process was more elaborate than first conceived. I’m not going to write every detail of what I did, but I will explain the high level process. Hopefully, you’re able to get the idea. The process was trial and error, but the result was successful. I was able to get results twice now, on two different systems.

Tools

5 Step Process

  1. Clone the Windows XP virtual machine to a USB hard drive.
  2. Create a new virtual machine with a bigger disk space.
  3. Use GParted to create a new partition. NTFS in this case.
  4. Restore the Clonezilla image to the new virtual machine.
  5. Run GParted again to allocate the increased disk space.

Step 1.

Clonezilla a free software disaster recovery and disk cloning utility that you can readily download online. Choose the latest stable version from the website. Make a bootable CD from the ISO that’s provided on the download. Boot Clonezilla on your old virtual machine. You may need to disable the hard drive from your boot up options to make the virtual machine boot from Clonezilla. Make sure you are able to add the USB drive to the virtual machine. Follow the instructions how to clone your old partition to the USB drive.

Step 2.

Create a new virtual machine with a bigger disk space. I used 50GB this time around. I assume you are familiar with Virtualbox how to create a new virtual machine. Don’t load any OS just yet. Just leave it blank.

Step 3.

Boot the GParted on the new virtual machine. Just follow all the instructions on how to create a new partition. Allocate all 50GB to the new partition using the NTFS file system. NTFS is the native file systems for Windows.

Step 4.

Boot Clonezilla on the new virtual machine. Restore your Clonezilla image that you stored on your USB drive. Just follow the instructions how to restore a Clonezilla image.

Step 5.

Run GParted again. The current OS (in this case, Windows XP) is still using the older and smaller partition. It doesn’t recognize the new and unallocated partition on the drive. So, run GParted again and increase the size of your current partition. Use all of the unallocated disk space on the partition. Reboot. Windows XP ran a Chkdsk on bootup, and then rebooted. I checked the disk space and sure enough, it says 50GB.

Done

There you have it. How to increase drive space of your existing virtual machine.

Re-Install Virtualbox VMs

I recently had to re-install my Ubuntu desktop due to issues with pulling back from using Gnome 3. I was getting dependencies errors was when I tried to run “apt-get” from the Terminal. I tried fixing it for half an hour, but I decided to go for a clean install instead to avoid wasting anymore time. Anyways, I have 5 virtual machines that I wanted to save and re-install on a new clean install of Ubuntu. Here are the steps that I took to backup and re-install Virtualbox VMs on a new clean machine.

  1. Back up the “Virtualbox VMs” folder to a USB drive.
  2. Re-install Ubuntu on the same machine or on another.
  3. After the clean install, copy back “Virtualbox VMs” folder to user home.
  4. Then, install Virtualbox.
  5. Start Virtualbox.
  6. Add VMs by invoking Machine > Add.
  7. Point it to corresponding .vdi file.
  8. Repeat until all VMs are re-installed.
  9. Run the VM to validate if successful.
Pretty simple.