May 5, 2010

Virtual Box - my notes from 2010

For a long time I have used (and struggled with) the VMware product. When VMware works, it is very good, but it is a pain, and a real hassle to keep running when new linux releases and kernels come out.

VirtualBox is a GPL product from Sun Microsystems (now Oracle). I started working with it in May of 2010 and like it very much. It was quick and easy to install, and I immediately set it up to run Windows XP, which was straightforward to do. My ultimate goal is to run Dynamic C, to support Rabbit development under linux. Actually, it turns out there are two "editions" of virtual box:

The concept behind the dual editions is that the PUEL edition can generate revenue by having some features that should appeal to enterprise customers, and this includes USB support.

Upgrading

I originally installed 3.0.14 (which was labelled as Sun Microsystems) and ran it from May through July of 2010. As of 7/2010 the 3.2.6 version was available as an RPM for Fedora Core 13 (as well as many other linux releases.) Note that you should download the AMD64 package even if you have an intel 64 bit processor.

Oracle even has a yum repository set up, so you can add their virtualbox.repo file to your /etc/yum.repos.d directory (which I originally did) and then just yum install the package!! Oddly, though this did not allow me to update my version, so I kicked it to the curb, did a yum erase of VirtualBox, and reinstalled a new version by grabbing the RPM and using rpm -Uvh. This now has me running version 3.2.6, which is labelled as from Oracle (looks like Sun got bought by Oracle).

Using Virtual box and installing Windows

After this, typing VirtualBox in a terminal window starts it up and it is very simple and user friendly.

There is a big (300 pages or so) user manual available as a PDF file. This link has the copy I downloaded in May of 2010, but the official site will have the most recent copy.

I installed Windows XP without event from a disk image of a Windows install CD as I remember, though it might have actually been from Windows physical media. In any event the install was uneventful

Windows and Folder Sharing

The first thing to do (now that I have windows XP installed) is to install the virtual box "Windows Guest Additions", which is easily done by firing up the virtual machine, using the devices tab on the menubar on the top and selecting "Install Guest Additions".

Once this is done, any directory on the linux host can be "shared" with the guest operating system, again by using the devices menu, but the "Shared Folder" selection. This is not terribly clear, but this is what worked for me:

  1. Pick an existing directory on the linux host that you want to share (say /home/joe/stuff).
  2. Use devices-->Shared_folder on the running virtual machine to set up a share for /home/joe/stuff as pickles. (pickles is the "share name").
  3. At the DOS prompt on the windows guest system type: net use x: \\vboxsvr\pickles.
  4. Now x: will appear under my computer as a network drive and be otherwise useful.

Installing Dynamic C 10.60

After setting up folder sharing as described above, I had DynamicC_10.60_WebFull.exe available under x: and could use the "run" dingus under windows to install the compiler. This worked great, but it did complain that it could not find the USB (my rabbit was not hooked up at the time).

Getting USB to work

This seems to be a universally frustrating issue with virtual box (and a sticky business with any virtualization product, to be perfectly fair). My virtual machine is aware of my USB devices (the mouse and the rabbit board), but shows them as greyed out or unavailable:

(/u1/tom/DC1060) cholla $ VBoxManage list usbhost
Sun VirtualBox Command Line Management Interface Version 3.0.14
(C) 2005-2010 Sun Microsystems, Inc.
All rights reserved.

Host USB Devices:

UUID:               0f6a84c3-f776-4a25-809c-87dd6032edaa
VendorId:           0x0403 (0403)
ProductId:          0x6001 (6001)
Revision:           6.0 (0600)
Manufacturer:       FTDI
Product:            FT232R USB UART
SerialNumber:       A6007A2E
Address:            sysfs:/sys/devices/pci0000:00/0000:00:02.0/usb2/2-8//device:/dev/bus/usb/002/003
Current State:      Unavailable

There is a lot of information (that you can dig up using Google) about this business of USB devices being unavailable via virtualbox. Some old tutorials tell you to make an fstab entry to mount the usbfs for the "usb" group (which you are also coached to make). I did this and got scolded by virtual box when I started this up. Apparently this was the thing to do for old linux kernels, but is not longer the case under the 2.6.32 kernel I am running (under Fedora Core 12). The new scheme uses device nodes under /dev to access USB devices.

Virtual box and Fedora

I got the bright idea of using virtual box to run a 32 bit Fedora within my 64 bit Fedora linux, to allow me to build 32 bit RPM's (and maybe to test fly new fedora versions). My first attempt to install (with Virtual Box 3.0.14) locked up during the install. So I upgraded to the most recent (3.2.6) version of virtual box, and that fixed things.

The physical DVD reader support was extremely flakey, so I switched to using a disk image (ISO) of the install DVD, which was not only faster, but it actually worked too!


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org