Sunday, February 3, 2013

My openSUSE 12 Journal 11: VirtualBox

This should be an interesting entry in light of the recent developments in the roadmap of both Fedora & openSUSE where MySQL is being ditched for MariaDB.  This will affect new enterprise deployments in the next 18-24 months when the changes cascades into the next major release of RHEL & SLES.

At the heart of these changes is the perceived lack of openness & transparency of commercial juggernauts shepherding open source projects.  Another example is LibreOffice, being a fork of OpenOffice a few years back, and is now the default in openSUSE distributions.

VirtualBox was originally from Innotek GmbH and they were acquired by  Sun Microsystems Inc. in February 2008 which in turn got acquired by  Oracle Corporation in January 2010.  Virtualbox is not shipped as a default on openSUSE but you can install it very easily because the binaries are available in the default online repositories.

Personally, I think VirtualBox is the 'BEST' virtualization software for the desktop. I would go with KVM or even Xen for enterprise server virtualization. However, for virtualizing Windows or Linux on a desktop for quick testing purposes,  I'll pick Virtualbox anytime for its ease of use & free of cost attributes.

Easy Install Method

As root, execute zypper se virtualbox and you ought to see the partial listing below:

S | Name                | Summary                         | Type      
  | python-virtualbox   | Python bindings for virtualbox  | package   
  | virtualbox          | VirtualBox is an Emulator       | package   
  | virtualbox          | VirtualBox is an Emulator       | srcpackage
  | virtualbox-devel    | Devel files for virtualbox      | package   

If the above command returns an empty list, either you do not have assess to the Internet or your YaST online repositories are not configured correctly.

To install, execute zypper in virtualbox and you are done.  Once installed, you can start it up by searching "virtualbox" via the application launcher OR just execute virtualbox as a regular user.

Manual Install Method
Unlike the easy install method above, you would use this manual method only if you want the latest and greatest version of VirtualBox directly from the source (

Specifically for me, I go to the Linux download section and chose to download the AMD64 (ie 64 bit) version of the RPM next to line openSUSE 11.4, 12.1, 12.2.  At the time of this writing, the version of VirtualBox is v4.2.6.

Highly recommend you also download the equivalent Oracle VM VirtualBox Extension Pack on the homepage of  The filename is in the format: Oracle_VM_VirtualBox_Extension_Pack-[version].  The [version] of the Oracle VM VirtualBox Extension Pack must match the version of VirtualBox software you downloaded previously.

To install, execute zypper in VirtualBox-[version].x86_64.rpm in the same directory where you have downloaded the VirtualBox binaries.

Once installed, you can start the GUI by searching for "virtualbox" in the search field in the application launcher (bottom-left corner of screen).

NOTE:  It is most likely that you will not be able to start any virtual machine because this latest and greatest version of VirtualBox needs to compile VM drivers against your kernel.

To achieve this requires two simple steps.

1.  Download the relevant kernel-source and kernel compilation tools.  The easiest way to do so is via the YaST Software Management GUI.

In the search field, enter "kernel-source" and ensure the relevant kernel-source is checked (double-check the version just to be sure its the same as your current kernel version).

Next, go into the Patterns View and

Scroll down till you find Base Development, check the checkbox next to it and

Click Accept to install both the kernel-source and the tools required to compile binaries.

2.  To compile the VirtualBox drivers, as root, execute /etc/init.d/vboxdrv setup and watch it go!

Recommended Configuration

a)  Install the VirtualBox Guest Additions (ie virtual drivers for virtual machines - Windows, Linux etc).  With this installed in your virtual machine, you can re-size your window and the guest OS will automatically re-size itself to match.

To install Guest Additions, your virtual machine (or guest OS) must be up and running.  Click Devices from the menu bar and you will see the Install Guest Additions option.  For Windows guests, it is largely straightforward as a virtual CDROM will be loaded and it will auto-run the installation.  For Linux guests, you have to either manually mount or manually install the drivers or both.

b) Install the Oracle VM VirtualBox Extension Pack to support USB 2.0 devices to be plugged into your virtual machines.

Install the previously downloaded Oracle VM VirtualBox Extension Pack file.  Note that the version must match the version of the VirtualBox you have installed.

Cool features
With the above configurations, here are a few nice and cool features that makes VirtualBox shine for desktop virtualization purposes:

  • Easy hotplug usb devices etc - you can easily transfer a physically attached USB device on your host to your guest by using the Devices menu bar or the USB icon at the bottom of the virtual machine
  • Easily mount host directories as Network drives to Guest OS.  This is very flexible as your host directory could be local hard disk, or separate partition, or external USB drive or even another network (NFS, SMB etc) location.
  • Out of the box and working NAT, Bridged and Host-only virtual networking device to your host network configuration.
  • Auto-Guest resolution to fit window - with Guest Additions installed inside the Guest OS, the resolution of the Guest OS/VM will resize automatically when you re-size its window.
  • Seamless mode - allows you to blend both Guest OS and Host OS in a seamless (no-window border) manner.  To activate, use the pre-defined Host-L key or choose Seamless mode from the View menu on the menu bar.

    Seamless mode in action: Windows Guest super-imposed on top of openSUSE KDE desktop
  • Save Machine State (hibernation) - clicking the X button (top-right) of the virtual machine will give you the option of saving its state.  You can easily restart the virtual machine later (without the need to watch it boot up).  Think of it as hibernation (or suspend to disk).
Have fun!

No comments:

Post a Comment