Paul Hinker's Weblog

pageicon Thursday Sep 25, 2008

openSolaris and VirtualBox 2.0

The latest buzz is about xVM, virtualization, and VirtualBox so I thought I would walk through a simple installation and a couple performance runs to see how virtualization and HPC works together. Since I'm in the Performance Library Group and one of the libsunperf developers, that's where my interest lies .

You can check my previous post concerning getting openSolaris installed along with getting the latest Sun Studio Compilers and Tools.

I started out by grabbing the binary distribution of the 2.0.2 VirtualBox packages from here. I'm running openSolaris on a Sun W2100 which sports a dual core 2.0 Ghz Amd opteron processor. It's an older chip so I can't run 64-bit guest OSes but I'll take it around the block using a couple 32-bit guests.

Once downloaded, the packages install in a straightforward manner. The ReadMe.txt included give instructions checking for the vbi module and installing it if it's not there. The vbi module is included in the VB distribution. The sequence of commands I used is :

% pkgadd -G -d VirtualBoxKern-2.0.2-SunOS-r36488.pkg

% pkgadd -d VirtualBox-2.0.2-SunOS-amd64-r36488.pkg

The default installation puts the VirtualBox libraries in /opt/VirtualBox but links are created in /usr/bin. I started it up from user space with :

% VirtualBox &

The first time you run it you'll be given the user agreement and the opportunity to register. Since I'm already registered I skipped this step but you'll be asked for a name and e-mail address. You'll see the xVM control panel


Go ahead and select 'New' to create a new VM and you'll get the 'Create New Virtual Machine' wizard:


The first screen of the wizard let's you pick a name for your VM and an OS type. There are lots of different choices including DOS, Windows, OS/2, and all sorts of flavors of Linux (including some generic linux kernels not associated with a particular distribution). I'm going to install Ubuntu so that's what I named and selected.


The next screen lets you select a base memory size that the VM will use when running. Depending on which OS variant you selected, the wizard will suggest something but you're free to disregard the recommendation. My machine has 2 GB of RAM so I changed the recommended 256Mb to 512Mb since I envision running a number of VMs simultaneously.


Next, you need to set aside some space for the hard disk image. If you already have VM images on your hard drive, these will show up in the drop down menu under Boot Hard Disk (Primary Master). This is my first run so there are none listed. If you have images on other disks, you can select them by choosing the 'Existing' button and navigating to them. I selected 'New' to create a new image. This starts up another wizard to help you create the disk image for the VM.


I selected 'Dynamically expanding image' since I don't know how big this VM is likely to become but you can also choose to create a fixed-size image. The fixed size image takes longer to create but is supposed to improve performance in some cases. You're asked to specify an image size and again, depending on the OS type you picked earlier, a suggested image size will be the default. For the Ubuntu distribution, the suggested size is 8 Gb but I increased it to 12 Gb just for good measure.


You'll notice too that the image file name matches the name you chose for the VM earlier in the installation. It lets you verify the parameters you selected before it actually creates the image.


Now you're back to the original wizard and finally allowed to create the actual disk image. You see that the primary master is now set to the disk image we just worked to create.


Again we get a window with the parameters we're selected so far and a chance to go back and change things or 'Finish' the creation of the virtual machine.


Now the main window will change by having your new VM appear in the left panel. Also, you'll notice that the Settings, Delete, and Start buttons have become active. On the right, you'll see the various details of the currently selected VM (in the left panel).


I wanted to install my ubuntu VM from CD so I first selected 'Settings' from the main VirtualBox panel. You'll see the general settings for the selected VM including the Name, OS Type, Memory Size, and Video Memory Size.


Select the CD/DVD-ROM item from the left panel to get the control panel.


Here you can see that you can mount a CD/DVD Drive. You can select either the Host CD/DVD Drive (i.e. the one attached to the current machine), or you can select an ISO image. If you have a .iso of the distribution you want to install on a local hard disk, you can install into the VM from there. A minor detail when booting from a .iso file. You need to select the checkbox for the Mount CD/DVD Drive, select the ISO Image button. This will activate the folder to the right of the ISO Image File drop-down so that you can navigate to the .iso file. For some reason it took me a while to figure this out. From this screen you can add or remove .iso images.


The passthrough button has to do with whether or not you'll want to write to the host CD/DVD from the VM. The passthrough enables you to write ATAPI commands directly to the drive from the VM. I did not select that option.

Close that panel by selecting 'ok' and you'll see that the main display now indicates that the CD/DVD-ROM (in the right panel) indicates that the host drive has been selected.

We're ready to power up our VM so select the 'Start' button from the main panel. A window will come up and you'll see a quick Sun splash screen followed by a window that explains that the VM is capturing the keyboard and how you can get it to stop capturing the keyboard. The first time you mouse click in the VM window, you'll get a similar message concerning the capturing of the mouse.


From this point, the guest OS works much like it would if you had installed it as the primary OS. There are lots of configuration issues concerning things like running the guest in a window or as the whole screen, configuring USB, and networking. My next entry will talk about using the Performance Library in a guest OS and some of the details involved.

Comments:

Post a Comment:
Comments are closed for this entry.