Sunny Affairs

Getting Started with OpenSolaris 2008.05 and VMware Fusion

Saturday May 17, 2008

OpenSolaris 2008.05 has been out for quite some time now. Unfortunately the release took place in the middle of examinations and therefore I could not give a good try. Anyways now I am over with all my examinations and I decided to give it a go. As usual I am on my Macbook Pro: 2.16Ghz Core2duo with 2 Gbs of RAM. Now I only had about 4 GB of free disk space on my hard disk so I had to empty some of the contents. I moved my old OpenSolaris (Build 72) VM to my external hard disk and it freed about 9 GBs. So now with 13 GBs at hand I started off with a new VMware Fusion (using version 1.1 build 62573) virtual machine. This is the configuration of my VM:
Guest OS: Solaris 10 64-bit
Memory: 800 Mb
Virtual Processors: 1
Hard Disk: 12 Gb (Virtual)
Network Adaptor configured to Share the host's internet connection (NAT)
System Sound Connected
CD/DVD using the OpenSolaris 2008.05 disk image (which is also in my hard disk)

So I booted off the disk and it quickly loaded the GRUB menu.
Without waiting I selected the default option: OpenSolaris 2008.05
It took about 2 mins and 5 secs to boot to the OpenSolaris GNOME Desktop (including the time to select the language and keyboard - negligible). It is the first distribution of OpenSolaris that I am using which does not require a login at start up. Even the beta releases of this operating system also required you to login before you reach your desktop.
First look:
1. Just as expected, the desktop resolution was preset to a very high 1280x1024. Although this resolution can fit into the Macbook Pro screen which has a resolution of 1440x900 but it is definitely disturbing when you are using it in the single window mode cause you cannot see the entire desktop at one time and you have to use the scrollers very often. Anyways I quickly changed the desktop resolution to 800x600, which made the virtual machine fit perfectly on the screen.
2. NWAM has seamlessly set up the network (NAT) with the host operating system and allocated an IP address. I checked out Firefox and the internet was working right out of the box.
3. The entire layout is very similar to Ubuntu (of course I knew this beforehand cause I had tried the Beta release as well).
4. The sound device was not recognized.
5. The system clock was not synchronized with the host operating system.



6. Also, there is no Thrash icon in the panel.
7. A new Window Selector at the top right corner.




Before checking on the other things, I decided to start installation of OpenSolaris to the Virtual Hard Disk. The Setup Icon is available right on the desktop (like you would find it in Ubuntu). Installation is a piece of cake. Extremely straightforward and keeps you out of the filesystem configuration unlike Ubuntu. I guess it uses the same Caiman Installer, but with some modifications to go with this new distribution. So what are the steps:
1. Welcome: A simple welcome screen which also links you to the release notes. Most of you would straight away press Next on this screen without reading anything.
2. Disk: Select the disk where you would like to install. You have the option of either partitioning the disk or using the whole disk. The Recommended disk size is 7 Gb and the minimum is 3 Gb. I decided to use my entire virtual disk.
3. Timezone: You can select the time zone from here. It gives you a very innovative method of selecting time zone. A map of the entire world is shown. You can use the magnifying glass to zoom and select city corresponding to your time zone.
4. Locale: Select your language support and also the locale specific data formats.
5. Users: Set the root password and a new user for yourself. You can also give a computer name here.
6. Installation: Recheck all your settings and hit install. The entire installation took about 23 mins and 30 secs on my laptop, which is much faster than the previous installations.

7. Finish: Once the installation completes you can review the installation log and reboot the computer to start the newly installed operating system.

Now while the installation was taking place I just went through some of the other features. First the terminal. The default shell now is bash, one of the best thing that could have happened. Which means now your command history can be seen through the up-arrow key, backspaces work perfectly etc.

A new device driver utility is present right at the desktop. It shows you details of the installed drivers and also the devices whose drivers are missing.
In case the drivers are missing, you can submit the information to hardware compatibility list.

The file browser looks same as before.
One point to note is that the installation really sucks your resources. Look at my CPU usage during this time:


Once the installation process completes, you can simply reboot the machine to boot into your newly installed operating system.
One major change you would find in the new GRUB menu is that there is no failsafe session available. The only option available is OpenSolaris 2008.05 snv_86_rc3 x86.
On selecting this option your booting process will most likely hang for about 3 minutes. This is because of the same old bug.

Now this distribution of Solaris has a ZFS root filesystem. You can see at the time of booting that the ZFS configurations are read and the ZFS filesystems are mounted.

The login screen is really simple. Unlike the earlier distributions of OpenSolaris this time you will find only 3 buttons. Options, Start Again and OK.



The Options allow you to select the language or the session. The available options in sessions are: GNOME, Run Xclient script, Failsafe GNOME, Failsafe Terminal. Note that unlike the previous distributions, there is no Common Desktop Environment.



Also you are not allowed to login into the root account.



To get root privileges in your account you can use the command su on the terminal and then enter your root password.
Another change to notice at the login screen is that unlike the other distributions this one represents each character entered at the password screen with an asterix (*). Thus you can see the number of characters that the password contains.



Another hitch here is that unless you install the VMware Tools, the login screen will have a resolution of 1280x1024.

Once you login, your Solaris is Up and running, but to make it run properly I feel the following things have to be looked into at first:
1. Correcting the GRUB options in order to boot into 32-bit mode by default.
2. Installing VMware Tools
3. Correct the Network Issues.
4. Get the sound working.

Taking the first issue: You need to make a change in the GRUB menu in order to force Solaris to boot into the 32-bit mode. Note that since OpenSolaris is using a ZFS root, the menu.lst file has been moved to: /rpool/boot/grub/menu.lst

You can either correct the default entry by removing $ISADIR from the kernel and module path, or make a new entry with the following paths:
kernel$ /platform/i86pc/kernel/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/boot_archive

This should correct your booting issues. Make sure you make necessary changes in the title if you are adding a new entry so as to not get confused at the GRUB menu:

Installing VMware Tools poses a little bit of problem because you cannot login as a root. You can mount the disk image of the VMware Tools for Solaris (located at: /Library/Application Support/VMware Fusion/isoimages/solaris.iso). Extract the file vmware-solaris-tools.tar.gz and run the perl script vmware-install.pl

The installation will end with an error where it will be unable to copy a file /usr/lib/vmware-ttols/configurator/autostart-vmware-user.sh to /usr/dt/config/Xsession.d/9999.autostart-vmware-user.sh
This will have to be done manually, using the super-user priviledges. Once you create the necessary folder and copy the required file, run the perl script again and this time the installation would complete itself.

Once you restart your computer the changes will take effect. I have noticed only two major changes. Firstly the login screen will be of the correct size as mentioned in the start-up resolution (in my case I set it as 800x600). Also the time is now synchronized with the host machine.



Apart from these two changes no other effect took place eg drag and drop between host and guest etc. I guess the VMware Tools needs to be upgraded for this new distribution.

Now about the network issues. Strangely, in the installed system, the dns lookup was failing. So in Firefox when you put in the address http://www.google.co.in it reports a server not found error. Instead, if you put http://64.233.187.99 it will open up google properly.
This can be temporarily corrected by inserting this line in the file /etc/resolv.conf:
nameserver xxx.xxx.xxx.xxx
where xxx.xxx.xxx.xxx is the IP address of your Primary/Secondary DNS servers.
This setting will take effect on restarting the computer. Although for this session the browser would work properly, but not in the following sessions because NWAM removes the manual entries from the file /etc/resolv.conf
Unfortunately, I was unable to get a proper solution for this. You can turn off NWAM to preserve your entries. To turn off NWAM and start the default networking service do the following:
$ svcadm disable /network/physical:nwam
$ svcadm enable /network/physical:default
Now you can configure your network from the Network Settings at System > Administration > Network. You can also insert your DNS server addresses here.
Once you reboot your computer, you will get an error like this:



Pressing Log In Anyway logs you in, and doesn't seem to have any negative effect on your computer. You can work as usual and your browser will work perfectly.

But after a while I switched it back to the nwam and everything started working normally again. I haven't figured out why exactly it was giving a problem initially, but nevertheless the issue has resolved.

Note: Make sure you insert your proxy settings in case you are behind a proxy server. Go to System > Preference > Network Proxy for inserting the system-wide proxy settings. In Firefox you can enter your proxy settings at Edit > Preferences > Advanced > Network > Connection > Settings

Finally to get the sound working, download the Open System Sound driver from http://www.4front-tech.com/download.cgi. Get the driver for Solaris 10/11 (x86/AMD64). Once the package downloads, you can install it by using the pkgadd -d command. Restart the machine and issue the command osstest to test the sound. Your Volume icon at the top right would have also been enabled after this driver is installed.
Don't worry about the error shown at the end of the command osstest.

Ah, finally a near perfect system to start all your work.

I find that the new OpenSolaris 2008.05 is extremely simple and easy to use. It is aimed at desktop computers. It runs pretty well in VMware Fusion. Just that at times it freezes the computer (maybe there are some VMware bugs, I am not using the latest build of VMware). And definitely its quite a lot faster than the Community/Developer editions of OpenSolaris. The final installed Virtual Machine only takes about 2.72Gb, much lesser than the other distributions, although it lacks many packages eg OpenOffice.org which can be installed using the Package Manager (System > Administration > Package Manager). Additionally you have Compiz Fusion right out of the box.

I will give OpenSolaris 2008.05 a try on VirtualBox, maybe it will work even better than that, and hopefully have another blog entry describing my experience with that.

[15] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg

Workaround for VMware Fusion "hanging" at the early boot process

Sunday Dec 30, 2007

Are you using Solaris on VMware Fusion? And are getting irritated staring at a black screen (sometimes with a single cursor), waiting for Solaris to start booting right after the GRUB menu? Well, there is a work around.

I have been facing the same thing for a pretty long time, till I found out the reason at Jim Laurent's blog. Ok, so the actual elaborated reason is this. There is some kind of bug in Fusion that would cause it to hang for 3-4 minutes at the early boot process (ie just after you select the boot option from the GRUB) when a 64-bit kernel tried to load. So you stare at the blank screen cursing Fusion and Solaris and other associated things that comes to your mind (I did that everytime I booted the VM before switching to do some other things while the VM revives from its "hanged state"). So then what I did was removed the old VM and created a new 32 bit VM. Even then the same thing would repeat. Now why should such a thing happen when you have created a 32 bit processor for the VM. Its because Solaris by default first checks if the booting system is 64 bit capable and even if you create a VM for Solaris 32-bit, it doesn’t disable the 64-bit, long-word instruction support. I found the reason here and it further on leads to this page that contains a solution.

So you have to simply add one line to the configuration file (.vmx) of your virtual machine.
monitor_control.disable_longmode = 1
Yes this does it. But somehow I was not satisfied by just this much. So I decided to change the behavior of Solaris ie force it to boot in 32 bit mode everytime.

So while searching for a work around this one I reached this page. In this documentation Sun has clearly explained the booting process of Solaris 10, which of course is very similar to that of OpenSolaris. At Solaris installation time, a set of default values are chosen for the system and stored in /boot/solaris/bootenv.rc. We can change the settings by editing the GRUB menu or modifying the bootenv.rc file indirectly via the eeprom command. Needless to say, you'll need root privileges for these operations.

Forcing Solaris to load 32 bit kernel

So firstly the longer method ie editing the GRUB menu youself. In case you dont want to get into the technicalities, look below for the second option:
The GRUB menu settings are stored in a /boot/grub/menu.lst. In case you have not made changes, the menu.lst file is well commented to explain each property. The lines which begin with a # are comments. menu.lst on a single partition, single HDD system, by default will look like this:

#pragma ident "@(#)menu.lst 1.2 07/01/10 SMI"
#
# default menu entry to boot
default 0
#
# menu timeout in second before default OS is booted
# set to -1 to wait for user input
timeout 10
#
# To enable grub serial console to ttya uncomment the following lines
# and comment out the splashimage line below
# WARNING: don't enable grub serial console when BIOS console serial
# redirection is active!!!
# serial --unit=0 --speed=9600
# terminal serial
#
# Uncomment the following line to enable GRUB splashimage on console
splashimage /boot/grub/splash.xpm.gz
#
# To chainload another OS
#
# title Another OS
# root (hd<disk no>,<partition no>)
# chainloader +1
#
# To chainload a Solaris release not based on grub
#
# title Solaris 9
# root (hd<disk no>,<partition no>)
# chainloader +1
# makeactive
#
# To load a Solaris instance based on grub
# If GRUB determines if the booting system is 64-bit capable,
# the kernel$ and module$ commands expand $ISADIR to "amd64"
#
# title Solaris <version>
# root (hd<disk no>,<partition no>,x) --x = Solaris root slice
# kernel$ /platform/i86pc/kernel/$ISADIR/unix
# module$ /platform/i86pc/$ISADIR/boot_archive

#
# To override Solaris boot args (see kernel(1M)), console device and
# properties set via eeprom(1M) edit the "kernel" line to:
#
# kernel /platform/i86pc/kernel/unix <boot-args> -B prop1=val1,prop2=val2,...
#
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris Express Community Edition snv_72 X86
kernel$ /platform/i86pc/kernel/$ISADIR/unix
module$ /platform/i86pc/$ISADIR/boot_archive
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris failsafe
kernel /boot/platform/i86pc/kernel/unix -s
module /boot/x86.miniroot-safe
#---------------------END BOOTADM--------------------

If you look closely, the kernel and module path in the menu item titled Solaris Express Community Edition snv_72 X86 contains a variable $ISADIR, which is actually expanded to a value "amd64", if Solaris finds that the system is 64 bit capable. Thus, when ever a 64 bit capable system boots, the kernel that is loaded is /platform/i86pc/kernel/amd64/unix. The 32 bit kernel is actually located at /platform/i86pc/kernel/unix.

So we have to simply modify two lines. Replace
kernel$ /platform/i86pc/kernel/$ISADIR/unix
module$ /platform/i86pc/$ISADIR/boot_archive
by
kernel$ /platform/i86pc/kernel/unix
module$ /platform/i86pc/boot_archive

You can use any editor to make this modification. I used the vi editor. So save it, once you have made the changes and then reboot your VM.

The second method is a lot quicker. Just run the following command in the terminal
eeprom boot-file="kernel/unix"

Thats it. Just reboot your system and you'll see a new option in the GRUB menu, that would be highlighted and is the new default: Solaris bootenv rc

Actually this new menu will load the 32 bit kernel, while the previous default option ie Solaris Express Community Edition snv_72 X86 (build may be different) still boots into the 64 bit kernel

When you come down to what changes it has made, it has just made one extra entry to the GRUB menu:
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris bootenv rc
root (hd0,0,a)
kernel /platform/i86pc/kernel/unix
module /platform/i86pc/boot_archive
#---------------------END BOOTADM--------------------
#BOOTADM RC SAVED DEFAULT: 0

....and made it the default option.

Chalo enjoy playing with the GRUB and switching the kernel mode. And more importantly no need to stare at that black screen in VMware.

[8] Comments
Like this post? del.icio.us | furl | slashdot | technorati | digg