Alan Burlison's Work Related Ramblings

All | General | Java | NetBeans | Perl | Solaris
« Facebook: do I get... | Main | Multicore cobblers »

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]

Trackback URL: http://blogs.sun.com/alanbur/entry/kicking_both_tyres_together_virtualbox
Comments:

Thanks for posting this.

Turns out that getting the video RAM up to 32 makes a big difference the OS actually installing!
I now have OpenSolaris Developer Preview 2 running under VirtualBox on top of Solaris Nevada build 81 on my AMD Ferrari 3200 laptop (with only 1GB of physical RAM).

Posted by Mark Thacker on February 14, 2008 at 08:34 PM GMT #

One other note to these already great instructions. When getting the PCN driver:
* Copy none.bz2 to your Indiana VM
* Type "bunzip2 none.bz2"
* Type "cpio -d -i < none"
* Type "cd kernel/drv"
Then proceed with the instructions to copy the "pcn" and "pcn.conf" files to the Indiana /kernel/drv directory and issue the "add_drv" command as root.

Posted by Mark Thacker on February 14, 2008 at 08:47 PM GMT #

Thanks for the excellent write-up.

There are talks about using the ae driver from Masayuki-san's archive in the OpenSolaris Discussion Forum:

http://www.opensolaris.org/jive/thread.jspa?threadID=51846&tstart=0

However, at this moment the VirtualBox/Solaris beta does not seem to provide the vboxsf driver (in order to mount the shared holder from the host), nor the USB support.

Is there any way to add and install the ae driver? Thanks again.

Posted by W. Wayne Liauh on February 15, 2008 at 02:38 AM GMT #

@Wayne, I've provided an ISO image of the ae driver for anyone who wants to try it - see the updated blog post.

And you are right about the shared folder and USB support not being there yet, I assume that is being worked on for the full release.

Posted by Alan Burlison on February 15, 2008 at 10:58 AM GMT #

The ae iso works fine. Thanks a lot. It was way easier to download than the SXCE image.

After I had the network up, I copied your xorg.conf in place and that works as well.

I found one minor problem so far (Kubuntu 7.10 host):

Sometimes my mouse cursor seems to `sleep' for a couple of seconds. It hangs regardless where I'm (host or guest window). But so far, it came back to live.

Posted by Marco Walther on February 15, 2008 at 08:39 PM GMT #

[Trackback] I am not much of a basketball fan, so apologies for a misleading post title (attributable to the partial attention I paid to ESPN India's telecast of a Maryland-Duke game). I managed to install the Indiana Developer Preview 2 OpenSolaris distributi...

Posted by Waiting for I/O on February 16, 2008 at 01:48 PM GMT #

Hi,
just because this was one of the more usefull hits for the topic I found via google I think it's worth to note that someone was so kind to build all the opensource nic drivers and pack them together:
http://blogs.sun.com/moinakg/resource/nicdrv.tar.bz2

This solved for me the chicken-egg problem to get Indiana up and running in Virtual-Box without having another Solaris system at hand to build those drivers. Running without network and thus internet access is very bad start these days. ;-)

Posted by Sven on March 06, 2008 at 09:58 AM GMT #

Hey Alan, any thoughts on how to make this work with SXDE? I've been playing around with all sorts of different CustomVideoModes and xorg.conf changes, but it appears that something in gnome doesn't like the higher resolution as I always get the error "Gdk-ERROR: **: error while retrieving Xinerama information" I think from gnome-session right after I login, and a subsequent core dump pops me back to the login screen.

Posted by Joe Mocker on March 26, 2008 at 01:27 AM GMT #

@joe, as far as I know it should just work with SXDE, can you try without Xinerama?

Posted by Alan Burlison on March 26, 2008 at 09:49 AM GMT #

http://blogs.sun.com/phantom/entry/workaround_for_vbox_indiana_nic

Posted by Anonymous on April 07, 2008 at 02:03 PM BST #

Hi Alan, thanks a bunch for xorg.conf. I'm using b79b build as my guest, and I got it to work on my Mac OS X running VirtualBox on 1280x1024. However, when I try to do the same for my Windows XP host, it does not work. Also, GNOME desktop does not work, only CDE. Any ideas? We're trying to get this going for some demos for JavaOne. Any help is appciated, thanks!

David

Posted by David D. Lee on April 08, 2008 at 07:04 AM BST #

On Issuing the command:

VBoxManage setextradata Indiana CustomVideoMode1 1280x1024x32

I get this:

VirtualBox Command Line Management Interface Version 1.5.6
(C) 2005-2008 innotek GmbH
All rights reserved.

[!] FAILED calling virtualBox->FindMachine(Bstr(argv[0]), machine.asOutParam()) at line 5633!
[!] Primary RC = 0x80070057
[!] Full error info present: true , basic error info present: true
[!] Result Code = 0x80070057
[!] Text = Could not find a registered machine named 'Indiana'
[!] Component = VirtualBox, Interface: IVirtualBox, {76b25f3c-15d4-4785-a9d3-adc6a462beec}
[!] Callee = IVirtualBox, {76b25f3c-15d4-4785-a9d3-adc6a462beec}

Is there a way to solve this?
Thanks!

Posted by Guillermo Garcia-Rojas on April 18, 2008 at 04:28 AM BST #

You need to replace "Indiana" with your machine name.

Posted by 66.27.201.136 on April 18, 2008 at 06:00 PM BST #

My machine name is Indiana.

Posted by Guillermo Garcia-Rojas on April 18, 2008 at 07:46 PM BST #

Hi there,
Mouse doesn't seem to work inside guest Indiana OS(My host is Kubuntu 8.04). I tried installing guest additions from Virtual Box as well as the guest OS, but unfortunately nothing seems to work.
Any help would be appreciated.
Thanks...

Posted by Rajath on May 16, 2008 at 06:02 PM BST #

Hi, I installed the VB 1.6.0 and the OpenSolaris released version, and everything works on Kubuntu 8.04;-)

I also did not see that problem with earlier versions (dev-preview2 @ VB 1.5.4@ Kubuntu 7.10,
rc2 @ VB 1.5.6 @Kubuntu 7.10/8.04).

So I guess it's worth looking into.

Thanks

Posted by Marco Walther on May 16, 2008 at 06:36 PM BST #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed