Virtual Machines with VirtualBox

My operating system of choice happens to be Mandriva Linux. Currently, I am running the Mandriva Linux 2008 Power Pack release. I have been running Mandriva since the dawn of time in Linux parlance: since it was called Mandrake and was a derivitive of Redhat.

Since I joined Liferay, I have found that I often need Windows in order to test and debug support tickets. I have a new machine that came with Windows, but since I spend 99% of my time in the Linux partition it's a bit of a pain to stop what I'm doing in my OS of choice, boot over to Windows, run some tests and stuff, and then boot back into my environment to do the rest of my work. So I started looking into virtualization solutions.

VirtualBox comes with Mandriva, but VirtualBox works with any Linux distro, Windows, and Mac, so this should apply to everybody. I figured I'd blog on it because it's a great product and not nearly as well known as VMWare or Parallels. You can go grab it at http://www.virtualbox.org.

They have two versions: an Open Source Edition, which is licensed under the GPL, and another version that is free for Personal Use. Innotek (the company that makes it) has a far different definition of "Personal Use" than you might imagine. Their definition, as I read it (IANAL, so read the license yourself), means that you are free to use VirtualBox as long as you are the only one personally using it. In other words, you can use it for your own virtualization needs, but don't run a virtual server for multiple users on it. If you do that, you should pay. Of course, none of that applies if you use the GPL version. Then it's as free as Richard Stallman wants it to be. :-)

The license wound up mattering to me, because the Open Source edition (1.5.0) that shipped with Mandriva had some show-stopper bugs (VMs would crash on dual core processors). They fixed the bugs in the 1.5.2 release, but Mandriva hadn't created a build for the distro yet, so I grabbed the binaries in RPM format from the web site. 

 

VirtualBox User Interface


VirtualBox has an extremely clean and easy to use interface. To create a new virtual machine, you click the New button in the top left corner. A wizard leads you through the whole process step by step. When you are finished, you will have a mostly configured virtual machine, complete with a virtual hard disk that starts small but can expand in size as the VM grows. I say it is mostly configured because in order to install anything, you have to click the Settings button, go to CD/DVD ROM, and check the appropriate mount option (depending on whether you're installing your OS from a real CD or from an ISO image).

 

Mounting a CD or DVD



From here, you just start your VM by double-clicking on it or by selecting it and hitting the Start button. You can then install your OS of choice as you would install it on a real machine.

 

Installing Windows XP



I used the NAT networking option, as this is the easiest to get going. Initially I thought I was going to have a problem trying to browse Liferay running on my Host OS, but I found that all I needed to do was use the address defined as a the Gateway for the virtualized Windows. You can find out what this is by dropping to a command prompt and typing ipconfig /all.

I intend to use VirtualBox to test Liferay on IE 6 and IE 7 without having to reboot my machine. It provides me with a testing lab on my laptop, obviating the need for multiple machines. If only it could virtualize Mac hardware so I could install Mac OS!

 

VirtualBox Desktop

Blogs
I've used VirtualBox on Linux, Windows and MacOS X and it really impressed me. I still think I prefer VMWare for its many available appliances but VirtualBox is a very stable cross-platform alternative and it's now open source which is as much a reason for me to use it as anything.
Hey Rich, David,

Do you know if VirtualBox supports running an existing windows installation in other partition of the hard drive?
Hey Jorge,

I did a quick search (and also tried to do it in VirtualBox's disk manager) and it looks like it's not supported. I found a forum post from earlier this year (http://www.virtualbox.org/discussion/1/204) that states it's "currently" not supported, so hopefully it'll be there in the future.

I am seriously considering completely removing my original Windows partition on my machine now that I have a virtual windows. Right now, I can't think of a single reason I'm going to need it, and I'd like to reclaim the disk space. :-)
I am new to liferay. I could get liferay up and running on windows 7. But when I try unziping and running it on windows xp inside of virtualbox, everything seems to start up right, but when browsing to localhost:8080 get webpage not found. Any suggestions?