Thursday, September 20, 2012

Virtualization & The Mind

In previous posts published Apr. 7 and Nov. 25, 2009, I discussed the use of QEMU for emulating virtual computers and the use VirtualBox to run Google's Chrome OS on an Apple MacIntosh Mini computer, respectively. This post provides more detail on the installation of guest operating systems on two platforms using VirtualBox. VirtualBox is an emulation application originally developed at Sun Microsystems and now supported by Oracle. It permits us to operate a guest operating system (OS) on virtual computers installed on a different platform. Two configurations are discussed (see table below).

Configuration Host Computer Host OS Guest OS
1 Apple MacBook 10.6 Windows 8
2 Dell Inspiron Windows 7 Linux

The two test configurations (table courtesy: HTML Tables).

One configuration entails running a Linux-operated virtual computer on a Microsoft Corporation's Windows 7 (32-bit) operated Dell Inspiron 1318 laptop (2.00 GHz Intel Core 2 Duo; 2 GB RAM). In the other, a Microsoft Windows 8 (64-bit) operated virtual computer is run on a OS X (10.6.8) operated Apple MacBook (2.26 GHz Intel Core 2 Duo; 2 GB RAM). In both examples, the results have been excellent. The virtual guest machines operate astoundingly fast, while the impact on the host computers performance is acceptably small. Below, find suggestions how to proceed with the installation:
  1. Download and install the latest version of the VirtualBox platform package (here 4.2) for each actual computer from Download VirtualBox.
  2. Open the application. The VirtualBox Manager will prompt you to set up a new virtual machine, presenting default options on the right. Set base memory to not more than a third of the host computer's RAM. The base memory can be ramped up to one half of the host computer's RAM. However, this may slow the computer.
  3. Set the virtual machine's video memory to 128 MB.
  4. I chose VMDK as the virtual machine's hard drive format and an 8 GB, expandable, as hard drive size for Linux and 20 GB, fixed, for Windows.
  5. Install guest operating system on the virtual machine. I chose Windows 8 (64 bit) for the OSX-10.6 MacBook host and Crunchbang Linux 10 (32 bit, i-386), a small footprint Ubuntu Linux distribution, for the Windows-7 Inspiron host. You can either install the guest operating systems from disk or iso-images that must be attached to the CD/DVD ROM drive of the virtual machine using 'Devices☞CD/DVD Devices' on VitualBox's pulldown menu.
  6. USB-2.0 support. To enable USB-2.0 devices on the virtual machines, download the Oracle VM VirtualBox Extension Pack for the version matching that of the VirtualBox on your computer from VirtualBox's download page and install the package following conventional host OS-specific procedures.
  7. File sharing. To enable file sharing on the virtual machine, VBoxGuestAdditions need to be installed. If you pull down the 'Device' option on the VirtualBox menu and select 'Shared Folders', a VBoxGuestAdditions iso-disk image containing the necessary files should mount. Eventually, the path to the shared folder on the host must be added to the 'shared Folders' list (see details below). If the VBoxGuestAdditions iso-image does not mount, download the image from the VirtualBox repository and mount it on the virtual CD/DVD-ROM drive, using the VirtualBox pulldown menu option 'Devices☞CD/DVD Devices'.
  8. For Windows guests, open the VBoxGuestAdditions iso-disk image folder in the guest with Windows Explorer and simply run the VirtualBox additions executable that matches the guest's operating system. For Linux guests, install the Linux-headers development packages for the kernel of your guest operating system before you proceed. Crunchbang has been developed as a Debian-based Ubuntu distribution. The needed header packages can be added to the operating system with the Synaptic Package Manager. After the packages have been installed, mount the VBoxGuestAdditions iso-image on the virtual CD/DVD-ROM drive, using the VirtualBox pulldown menu option 'Devices☞CD/DVD Devices'and, using the guest's command line terminal, go to the disk image folder, typing at the prompt:

    cd /media/cdrom

    To install the needed additions on the guest enter on the command line:

    sudo sh ./

    After providing your root password, the additions should compile and install. Without Linux headers installed, the script attempts to add a pre-compiled module. In my attempts, the module failed to be added on reboot. Hence, I took the alternative route via compilation. The compiler, however, depends on the Linux-headers development packages. Reboot the guest!
  9. The file sharing path for Linux guests. If shutdown and reboot of the guest proceeded without fail, create a folder in your home directory on the Linux guest as mount point for the folder to be shared on the Windows host. On the Windows host, I created a shared file folder with the name 'share' in the Documents folder, and added the folder's path to the list under the VirtualBox pulldown menu option 'Devices☞Shared Folders':


    If the correct path is inserted, the ok-button will light blue. Press okay. After that, the folder can be mounted on the Linux guest filesystem just so:

    sudo mount -t vboxsf share /home/Username/Documents/share

  10. The file sharing path for Windows guests. For the Windows guest running on a OS X host, make sure that file sharing is activated under 'System Preferences☞Internet & Wireless☞Sharing' on the host. I made a shared folder with the name 'share' in my documents folder on the host and entered its path in the folder list under the VirtualBox pulldown menu option 'Devices☞Shared Folders':


    If the correct path is inserted, the ok-button will light blue. Press okay. On the guest, go to 'Windows Explorer☞Networks☞Map network drive,' select a drive, and add under 'Folder':


    Check 'Connect using different credentials', which will present a login window for the host, asking for your username and password. After providing the correct answers, the shared folder on the host should pop up in the guest's Windows Explorer.
Configuration 1: Windows on OS X.

Configuration 2: Linux on Windows.
I have refrained from exploring the Drag-and-Drop option. But in essence, we are all set to go!

Related Posts

No comments: