VirtualBox in Seamless Mode
Written by Northbear

VirtualBox is "virtual machine" server software that allows you to create and run "guest instances" of other operating systems under your current operating system.  For this tutorial, I will cover the installation and setup of VirtualBox on an existing Fedora 7 32bit system. The guest OS will be Windows XP.


While this tutorial covers running Windows XP under Linux, it's quite possible to run Linux under Windows XP. VirtualBox supports Windows hosts and OS X hosts that are based on Intel hardware. The following list shows downloads for VirtualBox:
   * VirtualBox 1.5.4 for Windows hosts x86 | AMD64 (only on Windows x64!)

   * VirtualBox for OS X Hosts (Beta 2; Intel Macs only)

   * VirtualBox 1.5.4 for Linux Hosts:
         o Ubuntu 7.10 ("Gutsy Gibbon") i386 | AMD64
         o Ubuntu 7.04 ("Feisty Fawn") i386 | AMD64
         o Ubuntu 6.10 ("Edgy Eft") i386
         o Ubuntu 6.06 LTS ("Dapper Drake") i386
         o Debian 4.0 ("Etch") i386 | AMD64
         o Debian 3.1 ("Sarge") i386
         o Univention Corporate Server 1.3-2 instructions
         o openSUSE 10.3 i386 | AMD64
         o openSUSE 10.2 i386 | AMD64
         o SUSE Linux Enterprise Server 10 (SLES10) i386 | AMD64
         o Fedora 8 ("Werewolf") i386 | AMD64
         o Fedora 7 ("Moonshine") i386 | AMD64
         o Fedora 6 ("Zod") i386
         o Fedora 5 ("Bordeaux") i386
         o Mandriva 2008.0 i386
         o Mandriva 2007.1 i386
         o Red Hat Enterprise Linux 5 ("RHEL5") i386 | AMD64
         o Red Hat Enterprise Linux 4 ("RHEL4") i386
         o PCLinuxOS 2007 i386
         o Xandros Desktop 4.1 i386
         o All distributions i386 | AMD64

I selected the 32bit version (i386) for Fedora 7 and downloaded it. Switch to root
and install the RPM package:
[root]# rpm --install VirtualBox-1.5.4_27034_fedora7-1.i586.rpm
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/VBoxVRDP

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!

[root]#

VirtualBox installs a driver module ("vboxdrv") and creates a device ("/dev/vboxdrv") to use the driver. You will need to add your regular user ID(s) to the "vboxusers" group in order to have permissions to access the /dev/vboxdrv device. In Fedora, users can be added to groups using /usr/bin/system-config-users. You can also edit /etc/group and add user IDs to the "vboxusers:x:502:" line (i.e. "vboxusers:x:502:user1,user2,user3").

The first time you run VirtualBox, a directory containing named ".VirtualBox" will be created in your home directory to store the the setting of the VirtualBox server, guest operating systems and the virtual disks used by the virtual machines. Download the User Manual and read "Chapter 2: Installation". Setup is simple and quick.

                         

Create a new virtual machine with OS type "Windows XP".

           

NOTE: Select a fixed virtual drive rather than a dynamic drive. There are problems with formating an
            NTFS filesystem on a dynamic drive.

           

The virtual machine is now complete. Don't give it all your memory!

           

Setup the optical drive so the virtual machine can load Windows XP.

           

Install Windows XP. Make note of the keyboard/mouse capturing for the virtual machine.

           

Windows XP is now installed. Exit the virtual machine and unmount/remove the install CD.  You need to do this and re-start the virtual machine to install the "Guest Additions".

           

Install the Guest Additions. These support mounting of remote disks and are required for seamless mode.

           

Setup the "Desktop" directory in your home directory for sharing with the virtual machine. You need to do this for seamless mode.

           

Once you have the virtual machine running XP again, run "cmd" to bring up a shell window and type "net use x: \\vboxsvr\Desktop" to share your Linux Desktop directory on drive "x:". Then run "regedit". Save your existing registry with the Export option and edit [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders], changing the "desktop" key to "x: ;".

       

Finally, restart the virtual machine one last time and select "Seamless Mode" from the "Machine" menu.

The Windows XP tool bar will now appear on the Linux desktop above your Gnome/KDE toolbar. Executing programs from the Windows XP virtual machine will now have their own windows on the Linux desktop.

Conclusion

Overall, VirtualBox does a very good job of providing a blending of Linux and other operating systems. Even the sound works, so you can listen to "Clippy" tapping on your monitor!