Alan Burlison's Work Related Ramblings

All | General | Java | NetBeans | Perl | Solaris
« Previous day (Feb 13, 2008) | Main | Next day (Feb 15, 2008) »

20080214 Thursday February 14, 2008

Kicking both tyres together - VirtualBox and Indiana

I saw Tim's announcement that Sun were acquiring innotek. innotek provide VirtualBox, which what Tim described as a "high performance type 2 hypervisor". For people who aren't virtualisation wobbleheads, that simply means that it gives you the ability to run operating system on top of another. The host operating system runs on top of the x86 hardware, you run VirtualBox as an application on top of that. VirtualBox emulates the hardware that a guest Operating System needs to run, so that you can run other OSs on top of your host OS. This is in contrast to xVM (Xen), which runs on top of the bare hardware, with the installed OSs running on top of it.

I pulled the Solaris beta binary from the downloads site and had a play with it. The VirtualBox admin GUI is very easy to use, and it was quick and easy to set up a VM to install a copy of Windows XP on top of Solaris - my workstation is running Nevada build 82. Most everything seems to work really well, the only exceptions being sound, which I believe is not implemented yet, and the Solaris/XP file sharing, which seems a little flaky - it works OK for viewing and editing files created on Solaris, however creating new folders from XP works but reports errors, and you can't see the resulting folders in XP. The other nit is that seamless mode doesn't work quite right if you have a dual-monitor (TwinView) setup - details are here.

The other big news this week has been the release of Indiana Preview 2, AKA OpenSolaris Developer Preview 2. Stephen was gently nagging me last week to take a look at Indiana. I didn't want to futz with my machine config as I've just freshly installed build 82 on it, so I decided to see if Indiana2 would run under VirtualBox - and it does.

First you need to make sure you allocate enough memory for Indiana - I set the memory size to 512Mb, and the video memory size to 32Mb. After installing Indiana and rebooting the VirtualBox VM there's a couple of kernel warnings on boot, one about MPO being disabled because the virtualised memory is interleaved and another about their being no randomness provider for /dev/random. The other thing is that Xorg came up by default in 16-bit mode, which caused VirtualBox to complain, although a little tweaking of xorg.conf solved that.

I also figured out how to get the Indiana screen resolution up to 1280x1024 - you need a tweaked xorg.conf, and before you start your VM you need to run VBoxManage setextradata Indiana CustomVideoMode1 1280x1024x32 - replacing "Indiana" with the name of your VM, and note that "CustomVideoMode1" ends in "1" (one) not "l" (L).

The biggest nit is that the virtualised network device used by VirtualBox requires the pcn driver, and it isn't redistributable, which means in turn it isn't part of Indiana. I grabbed a copy from build 82 (the latest SXCE) and installed it into the Indiana image, rebooted and NWAM brought the interface up. If you want to do this yourself, here's the steps:

  1. Get access to the contents of the SXCE ISO image from inside your Indiana VM. Use the VirtualBox Virtual Disk manager (File -> Virtual Disk Manager) to make either the DVD or ISO image available to your Indiana VM.
  2. Extract the files from /Solaris_11/Product/SUNWos86r/archive/none.bz2 - this is a bzip2ed cpio archive.
  3. As root, copy pcn and pcn.conf to /kernel/drv in your Indiana VM.
  4. Run add_drv -i '"pci1022,2000" "pci103c,104c"' pcn to install the driver - note the quotes are important!
  5. Reboot your VM. After rebooting, ifconfig -a should show you now have a working pcn0 network interface.

And of course, if you are worried about brickifying your Indiana VM by doing this, you can always use VirtualBox's snapshot facility to make sure you can roll everything back if something goes wrong.

One important not however: the resulting Indiana VDI image is NOT redistributable, because of licensing restrictions on the pcn driver.

Once I had the Indiana image up and running under Solaris, I copied it onto a Windows XP machine, imported it, attached it to a Solaris VM , started it up and had a preconfigured instance of Indiana running under WinXP, which I thought was kinda neat. I haven't tested it on Linux but I'm sure this would work there too, as well as on OS X. So all you people who have been putting off taking a look at Indiana because it would mean rebuilding your machine now have no excuse :-)

Update - the ae driver

There is an open-source and redistributable alternative to the pcn driver, the ae driver. This is available at http://homepage2.nifty.com/mrym3/taiyodo/ae-2.6.0a.tar.gz#../ae-2.6.0a.tar.gz. The driver tarball contains installation instructions. To make it accessible to your VM, it needs to be made into an ISO image that you can mount into the VM, using the Devices -> Mount CD/DVD-ROM menu of your VM. To make this a little easier I've prebuilt an ISO of the driver tarball which you can download from here. I haven't tried this driver myself, if you use it, let me know how you get on.

Posted by alanbur ( Feb 14 2008, 01:36:58 AM GMT ) Permalink Comments [16]