Connecting the dots with Solaris and middleware In the middle

Sunday Dec 23, 2007

These instructions have been updated based on using the latest release, OpenSolaris 2008.05. 

As part of our project to port OpenSolaris' Image Packaging System (IPS) to multiple OS platforms, I've had the opportunity to work with a variety of operating systems as guests under both VMware Workstation and VirtualBox.  I have to say that my experience in using the live CD image of OpenSolaris 2008.05 has been a great compared to some of the popular Linux distros.  Ubuntu has consistently worked well in these virtualized environments, but I had significant issues with both Fedora 8 and the Fedora 9 Preview live CDs as guests on VMware workstation.  I gave up on trying to use the Fedora 9 Preview and resorted to using the non-live CD to get Fedora 8 installed properly.  Issues included having to run a CLI to trigger the installer from the live CD (the install icon wouldn't show up consistently on the live desktop), the inability to get the display resolutions set properly and having to start the Network Manager daemon manually in order to see the nm-applet in the notification area.  I don't mention these issues to bash the Fedora offering (years back I was a big Fedora fan prior to making the switch to Ubuntu for daily desktop work), but rather to highlight that the OpenSolaris 2008.05 out-of-the-box experience is pretty darn good. Sure, it has its own warts, but the progress made by the project in such a short period of time has been significant.

Once a pre-installed VMware image of OpenSolaris is made available for general download, some of the following instructions will become obsolete.  Ideally, all you should need to do is download a VMware image of 2008.05 and boot it within VMware Workstation, VMware Player or one of the VMware server products.

In the meantime the following instructions address booting up the OpenSolaris 2008.05 live CD and installing the OS into a virtual machine (VM).  In this example we'll use VMware Workstation 6.0.2 build-59824 running on Ubuntu 7.10 with bridged networking. 

A colleague of mine has also followed these instructions, minus the Linux and wireless workarounds, for VMware Workstation 6 on Windows XP.

1) Get OpenSolaris 2008.05

Download the Live CD Image

2) Apply Workaround for VMware Wireless Networking Issue 

This step only applies if you are:

1) using a wireless adapter

2) using VMware on a Linux host running 2.6.22.x 

If you intend to use only the wired ethernet interface on your computer, then you can skip this step.  If you intend on using a wireless network adapter and you're running a Linux host OS with a kernel version of 2.6.22.x, then consider the following instructions to work around a known problem. 

You can determine the kernel version of your Linux host by executing:

$ uname -a

There's a patch floating around that appears to address the inability to use a physical wireless adapter from a VM when using VMware Workstation 6.0.x and a Linux host OS running a 2.6.22 kernel.

In my installation the vmnet.tar file is located at:

/usr/lib/vmware/modules/source

I backed up the existing vmnet.tar file and copied the patch author's vmnet.tar file into place.

Then I reran the VMware configuration tool to recompile the necessary binaries:

$ sudo /usr/bin/vmware-config.pl

Apparently, if you see the following line in your host's /var/log/messages file, the patch has been applied successfully:

$ tail -f /var/log/messages
Dec 22 00:59:00 ckamps-laptop kernel: [363594.740000] audit(1198306740.420:55): dev=eth0 prom=0 old_prom=256 auid=4294967295
Dec 22 00:59:00 ckamps-laptop kernel: [363594.740000] bridge-eth0: disabled promiscuous mode
Dec 22 01:18:18 ckamps-laptop kernel: [364752.896000] bridge-eth0: already up
Dec 22 01:18:18 ckamps-laptop kernel: [364752.960000] bridge-eth1: is a Wireless Adapter
Dec 22 01:18:18 ckamps-laptop kernel: [364752.960000] bridge-eth1: already up

3)  Create a New Virtual Machine

Restart VMware Workstation and follow these steps to define a new VM. 

3.1) Select "Solaris 10 64-bit"

VMWare Guest OS Version Selection

3.2) Accept "bridged networking"

For those of you that are new to VMware, "bridged networking" simply means that your new VM will reuse one of your machine's physical network interfaces.  In this example, we'll be relying on DHCP within the OpenSolaris VM to obtain an IP address on the local network to which the laptop is attached.

3.3) Consider Adjusting Virtual Disk Size

In this example, we'll set the virtual disk size to 12GB.

3.4) "Edit virtual machine settings" to specify booting from live CD image

Select "CD-ROM" device and "Use ISO image".

Specify location of the downloaded "in-preview.iso" file:


 

3.5) Set Up Access to Wireless Network Interface

If your computer has only one network interface, you can skip this step. 

3.5.1) Ensure Virtual Network Interface Exists

When you installed and configured VMware Workstation, you might have mapped your wireless network interface to a virtual network interface.  For example, in my configuration:

  • vmnet0 = eth0, my laptop's ethernet network interface
  • vmnet2 = eth1, my laptop's wireless network interface

If you didn't map your wireless network interface to a virtual network interface, you can exit Workstation and run the configuration program again:

$ sudo /usr/bin/vmware-config.pl

3.5.2) Add Virtual Ethernet Interface for Wireless Interface

Click on "Edit virtual machine settings", click "+ Add" and select "Ethernet Adapter".

Select "Custom: Specific virtual network" and select the virtual network device you specified when running vmware-config.pl:

Adding virtual ethernet adapter for wireless

3.6) Consider Adjusting Memory Allocation

Since the Ubuntu host OS and its applications on my laptop typically use a bit over 1GB of the 2GB of physical memory, I allocated 800MB of memory to the OpenSolaris VM.

4) Power on the Virtual Machine

Power on your new VM. 

You might notice a warning that the sound device is not working.  Ignore it for now.

If you're new to VMware Workstation, you will quickly find that "Ctl-Alt" is the easy way to switch between working in the context of the VM and your native desktop. 

You might want to select "View -> Full Screen" to see the entire OpenSolaris desktop.

As the live CD boots up, select your keyboard layout and proceed.

After a minute or so, you should see the Gnome desktop appear:


 

At this stage you're running a copy of OpenSolaris directly from the CD image.

If your computer's wired ethernet adapter is connected to a network, your VM probably has access to the network.  Start up Firefox to see if this is the case.

5) Install OpenSolaris from the Live CD

On the OpenSolaris desktop, click on the "Install OpenSolaris" icon to launch the installer:

Installer

Proceed through the installer.  Accept the "Use existing Solaris partition" option.  Note that the size of the disk detected equals the size of the virtual hard disk you specified for your VM.

Installation on my laptop took about 10 minutes.

Click on "Reboot" to boot into your new OpenSolaris installation. 

6) Reboot Into OpenSolaris

Log into the OpenSolaris desktop with the new user you defined during installation.

In either case, you might notice that boot time is agonizingly slow.  Here's a workaround for this issue:

Address Slow Boot Speed

I don't profess to understand the cause of the issue, but there's a simple workaround to dramatically speed up the boot process.  From a terminal session, edit the following file and remove $ISADIR/ from the boot entry:

# vi /rpool/boot/grub/menu.lst

Before:

title OpenSolaris 2008.05 snv_86 X86

...
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive

After:

title OpenSolaris 2008.05 snv_86 X86

...
kernel$ /platform/i86pc/kernel/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/boot_archive

Reboot OpenSolaris.

As OpenSolaris reboots you should notice a dramatic improvement in boot up speed and your wireless networking should work fine.  For example, on my laptop computer I saw boot times decrease from 5 minutes to less than a minute.

7) Take a Snapshot of the VM Image

Before installing VMware Tools into the OpenSolaris VM, it's probably a good idea to take a snapshot of the existing VM.  If you'd like to revert to this state of your VM in the future, the snapshot will come in handy.  I know from experience: I recently bricked an OpenSolaris installation by uninstalling the SWUNlibm package. (No, there wasn't any warning from the packaging, but given that it's a prototype, I wasn't upset.)  If I had taken a snapshot of the VM, I could have avoided starting over from scratch.

 

8) Install VMware Tools

VMware strongly recommends installing the VMware Tools in all guest operating systems.  Unfortunately, there are several issues when attempting to install the tools in the OpenSolaris Developer Preview 1 release.  See this bug report for further details.

Although the first issue has a workaround, I have not yet found a workaround for the key mapping problem.  I encountered that problem and it caused a lot of grief.  I ended up reinstalling the OS.

TODO: Try out some of the workarounds listed in the References section below.

9) Update OpenSolaris

Refer to the OpenSolaris Updating Guidelines document for detailed steps.

References

The following thread and the people who contributed to it were invaluable to some of the workarounds described in this article:

http://www.opensolaris.org/jive/thread.jspa?messageID=178855 

Comments:

Hey! Glad to see you're blogging again!

Posted by melanie gao on December 27, 2007 at 06:19 PM CST #

Have you ever thought about running a Solaris guest under VirtualBox? Thanks

Posted by W. Wayne Liauh on January 09, 2008 at 10:17 PM CST #

Hi, thanks for the post! Solved my slow boot problem on VMware 6 on Windows as well!

Posted by Alvaro on April 28, 2008 at 12:11 PM CDT #

I didn't have any luck with the X settings as described in the References thread when using 2008.05 release. When the login manager should be starting I just get a blank black screen. Even if I ssh in and delete xorg.conf and reboot the same thing happens. I have to revert to the post-install snapshot to recover.

Posted by Joel on May 10, 2008 at 04:43 PM CDT #

Removing $ISADIR only makes it boot the 32bit kernel, rather than the 64bit one. The 32bit kernel doesn't have the long delay bug, but then you only get a 32bit kernel. Not so helpful if you need a 64bit version.

Posted by Dave on June 19, 2008 at 07:57 PM CDT #

Thansk, solved the slow reboot problem on Vmware server 1.0.4 on a Win32 host.

Posted by Matt on November 06, 2008 at 10:21 AM CST #

Thanks for the info. Is there a fix for the missing sound card issue?

Posted by John Sullivan on January 27, 2009 at 06:12 PM CST #

sorry - this is the classic newbe question.

Having got OpenSolaris-vm running in my VM the first thing it wants is a user name and password. I've tried a few but without success. So what is the default?

Posted by tony eastwood on February 04, 2009 at 06:44 AM CST #

Hi,

This is a good article, no doubt and it will help me. I have already installed the open solaris on vmware and i can see the text console. I have 2 issues:

1. Unable to login as root, though the password (can be resolved).
2. display issues. i am unable to attach a screen shot.

Actually the display issue starts 20/30 seconds after I see the console.

Thank you.
Arif

Posted by Arif on March 29, 2009 at 01:37 AM CDT #

Post a Comment:
  • HTML Syntax: NOT allowed