Using SUN xVM VirtualBox to run multiple Operating System environments
I have been playing with different virtual machines in the past. Since
last few months, I have have been musing on SUN VirtualBox that is
released under GPL license and is an open source software. I have found
it to be a real killer in terms of usage and portability. The open
source community support is quite heavy on this and most issues can be
googled for (you can browse my other articles on VMWare if you are
intersted in this software).
VirtualBox software is deployed on a host operating system (the OS that
is loaded on your machine bootup). Once the VirtualBox software is
installed, virtual machines can be created that will run guest
Operating system (The OS that is loaded on the virtual machine bootup).
Hence the concept of Host and Guest operating system.
You
need to
install the Host version of the Virtualbox software. So if you have
Linux on your machine, download the latest copy of VirtualBox for Linux
and install it. You can then create virtual machines to run other
Operating System or one more instance of Linux over Linux.
Deploying Virtualbox on Linux
My notebook runs Fedora Linux (Version 9 as of this writing). I followed the below steps to complete the installation on my linux box.
- Download the latest VirtualBox RPM file from the VirtualBox download site
- As root user, install the software.
[root@amar tmp]# rpm -ivh VirtualBox-1.6.2_31466_fedora9-1.i586.rpm
Preparing... ########################################### [100%]
1:VirtualBox ########################################### [100%]
chcon: can't apply partial context to unlabeled file `/usr/lib/virtualbox/VirtualBox'
chcon: can't apply partial context to unlabeled file `/usr/lib/virtualbox/VBoxSDL'
chcon: can't apply partial context to unlabeled file `/usr/lib/virtualbox/VBoxHeadless'
chcon: can't apply partial context to unlabeled file `/usr/lib/virtualbox/vboxwebsrv'
Creating group 'vboxusers'. VM users must be member of that group!
No precompiled module for this kernel found -- trying to build one. Messages
emitted during module compilation will be logged to /var/log/vbox-install.log.
Success! - You can run the virtualbox from any user you like, but the
user should be part of the vboxusers group. I created a separate user
for managing the virtualboxes on my machine.
[root@amar tmp]# useradd -c "VirtualBox User" -d /home/virtualbox -m -g vboxusers virtualbox
[root@amar home]# passwd virtualbox
Changing password for user virtualbox.
New UNIX password: - log into the "virtualbox" user and start the machine.
[virtualbox@amar ~]$ VirtualBox
- Accept the license agreement and fill in the registration form. Follow on-screen VirtualBox instructions.
- Virtualbox user will require to be part of the "disk"
group to be enable to access cdrom
[root@amar dev]# usermod -g vboxusers -G disk virtualbox
- login to the user and check if the group is available.
[amar@amar SUN-VirtualBox]$ su - virtualbox
Password:
[virtualbox@amar ~]$ groups
vboxusers disk - Restart the system.
- Start the VirtualBox software now.
[virtualbox@amar ~]$ VirtualBox &
[1] 16928 - Below screen will be displayed.

- Agree to the license to continue. This will take you to the
VirtualBox Management Screen.

- Initially this screen will not have any Virtual Machine to
run, you need to copy or create a new virtual disk and install a guest
operating system. I am running Linux on my notebook and require Windows
XP to run few proprietory stuff that is not supported on Linux. So here
we go. Please note that the process is same if you are installing on
Windows OS.
- Click on the "New" button to start of the process of
creating a new Virtual Machine. I will create a new machine from
scratch (for copying machine refer recovery scenario section). The
below New Machine Wizard window is now displayed, click "Next>"
to continue.

- Next screen will prompt you for the Name of the new Machine
and the operating system that it will run.

- Next screen will prompt you for the Memory that will be
used on the Virtual Machine. Please note this memory is taken from your
System's physical memory. As a start I provided about 192MB, but
windows will require more Memory as you start using applications. You
can reconfigure this value later based on what you will use the
Machine for.

- Next step is to create a Virtual Machine Hard Disk. Each
Virtual Machine requires a Virtual Hard Disk. This is actually a
file that will be visible in your File Manager as .VDI file (this is
similar to .VMDK file for VMWare). VirtualBox will use this file as a
hard disk on the Guest OS. The first step in creating a machine is to
create a Virtual Hard Disk to host the OS.

- You can choose one of the Dynamically or Fixed size image
option and click "Next>" to Continue.

- Provide the Image File Name (I have provided it
as "VBox-XP" and specify the Disk Size. In my case it is 10GB.

- Next screen will confirm on your choice, click "Finish" to
complete the disk creation exercise.

- You will now be taken back to the Virtual Hard Disk

- The virtual Machine is now ready to be created. A summary
will be shown to you and you can click on "Finish" button to complete.

- The new virtual machine is now available in the VirtualBox
Managment console.

- You can choose settings from the Menu and enable the CDROM
drive for the virtual machine. Pop in the windows XP CD and start the
virtual Machine. The Machine should boot from the CD and prompt you for
Windows XP installation process.

- Rest is related to XP installation and should be streight
forward. Once the installation is complete, boot into the virtual
machine and you will now have to OS running on your system.

- One lovely feature of Virtual Machine is the seamless mode.
This option allows the application running on the Guest OS to run
outside the VM container. The effect is that you see all host and Guest
windows together on the same desktop. See the image below, Internet
Explorer and File Manager of Windows are running along with the
Nautilus File Manager of Linux.

Installing Linux guest on Windows host
Download the latest Virtualbox EXE file from VirtualBox downlad site and intall it on your machine. The installation steps are pretty straight forward except that the CDROM fails to get recognized in occassional cases, this condition mostly occurs on Vista. You can google for solutions. One alternative is to convert the CDROM to ISO image and mounting it in the virtualbox. Below is a screenshot that shows XP guest on Vista Host.

Recovery Scenario with Virtual box
Like other Virtual Machines, it is easy to restore or share Virtualbox hard disk file and start the guest operating system on another machine having same or some other host operating system. For instance, I had a motherboard issue on my Linux notebook and had to send it off for service. I copied the virtual box disk file (.VDI) file from my Linux machine to my wife's notebook (that was on Windows Vista) and fired it up with no issue. Once my Linux notebook was back in action, all I needed to do was copy back the .VDI file and create a Virtual Machine using it. This saved me a lot of time and trouble.
Best viewed in medium text size. Please refresh (F5) to view the latest information.
This page was created on 15-Jan-09. Last updated on 15-Jan-09.
please forward all queries to amar@amar-padhi.com