Friday Aug 08, 2008

New OSS Drivers (Partly) Fix Sound Issues in OpenSolaris on VirtualBox on Mac OS X

Thanks to a comment made by Maria on my blog, I tried installing the new version of OSS drivers, and am happy to say that the sound now works in OpenSolaris in VirtualBox on Mac OS X!  Thanks, Maria!

Here's what I did:

# pkgrm oss    (to delete the old version I installed previously)
# reboot

Download the new oss driver file, oss-solaris-v4.0-1016-i386.pkg, from
(select Solaris 10/11 x86/AMD64 in the list).

# pkgadd -d oss-solaris-v4.0-1016-i386.pkg
# reboot

Run osstest after the OS comes back up, and listen to the music!  Sounds great.

UPDATE 8/13/08: I think I spoke too soon. The sound is very flaky, sometimes works, sometimes doesn't. I am not sure what is happening.

MPI Profiling Tool

Sun Studio Express has new features for profiling MPI programs.  Check out this tutorial.

Thursday May 08, 2008

Solaris Guest Additions in VirtualBox on Mac OS X

I had a little difficulty figuring out how to get the Solaris additions installed.  I could not find the VirtualGuestAdditions.iso, even after consulting the VB doc.  Eventually, I stumbled around long enough to get it installed. 

The key points:

  • Start the OpenSolaris virtual machine.

  • With the OpenSolaris window selected, choose Devices > Install Guest Additions and the CD icon should show up.
  • If that doesn't work, try to mount the iso image for the additions in VirtualBox:  Devices > Mount CD/DVD ROM>CD-ROM Image  (I think the guest window has to be selected in order for the Devices option to show up on the menu bar.)
  • Select the VirtualBox main window, and open File > Virtual Disk Manager. In the Virtual Disk Manager, click CD/DVD Images tab, select the VBoxGuestAdditions.iso, and click OK.
  • If the icon for the VBoxGuestAdditions does not appear on the desktop, check to see if there is a real CD in the drive.  This is what caused my problems  -- as soon as I ejected the CD, the additions icon showed up on the Solaris desktop.  I believe I had to eject the CD from Mac OSX, not Solaris.

  • Make sure also that if you mounted the ISO for Opensolaris, that you remove that CD in the Virtual Disk Manager.  It seems that only one CD, virtual or physical, can be dealt with at a time.
Once the cd is mounted, you can install as follows...

Open a terminal window and su to root, then do this:

cd /media/VB\*

pkgadd -d ./VBoxSolarisAdditions.pkg

And hopefully you will see this:

The following packages are available:

 1  SUNWvboxguest     Sun xVM VirtualBox Guest Additions

                      (i386) 1.6.0

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 1

Processing package instance <SUNWvboxguest> from

Sun xVM VirtualBox Guest Additions(i386) 1.6.0
Sun Microsystems, Inc.

Using </> as the package base directory.

## Processing package information.
## Processing system information.
WARNING: setting mode of </etc/> to default mode (644)
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

This package contains scripts which will be executed with super-user
permission during the process of installing this package.

Do you want to continue with the installation of <SUNWvboxguest> [y,n,?] y

Installing Sun xVM VirtualBox Guest Additions as <SUNWvboxguest>

## Installing part 1 of 1.

/opt/VirtualBoxAdditions <implied directory>

/var/svc/manifest/system/virtualbox <implied directory>
[ verifying class <none> ]
Modifying /etc/
[ verifying class <sed> ]
## Executing postinstall script.

Sun xVM VirtualBox Guest Additions - postinstall script

This script will setup and load the VirtualBox Guest kernel module...
Loaded vboxguest.
Configuring Xorg...
Configuring client...
Configuring service...

Please re-login to activate the X11 guest additions.

Installation of <SUNWvboxguest> was successful.

Then you need to log out and log back in.  The thing you should immediately notice is the screen resolution is now set appropriately for the screen size. You can use Full Screen and really get full screen.

Wednesday May 07, 2008

OpenSolaris on a Mac in VirtualBox

I am not sure if this is an officially supported platform combination, but I thought I'd try it out and make note of any issues.

Get OpenSolaris 2008.05 Distro

The first thing you want to do is download the OpenSolaris image so that it will be available when you make your virtual machine.  I didn't do this because I didn't know any better, but it caused a few problems when I started Virtual Box and then didn't have an image to boot!  Canceling out made VirtualBox a little confused and I wasn't able to get anywhere without generating memory errors until I rebooted the Mac.  I am new to Mac OS X and to virtualization software, so some of this might be obvious to some of you, but it wasn't to me. And I hadn't yet found the instructions for running OpenSolaris on VirtualBox.

So, first, download OpenSolaris 2008.05 from .
Right now the OpenSolaris distro is only available for x86, but that is what we want because the Mac uses an Intel processor.

Save the os200805.iso in a known location where you can access it later from VirtualBox.

Note that you do not need to burn the image to CD if you don't want to, because VirtualBox will let you  mount the image so it looks to the virtual machine and the guest (OpenSolaris) that the image is on an actual CD drive.  If you will only be installing on the one machine, it makes more sense not to burn a CD.  Also, the install will probably be faster from the hard drive than from a CD.

Install VirtualBox on Mac OS X

Go here to download VirtualBox 1.6:

Be sure to select the Mac OS X (Intel) Platform and check the box for accepting the terms and conditions.

Click the link to download the dmg file.

Double-click the downloaded VirtualBox-osx-1.6.0-OSX_x86.dmg file.
Inside the file is the VirtualBox.mpkg and instruction to double-click it.  Also contains UserManual.pdf and VirtualBox_Uninstall.tool.

Follow the instructions shown -- double-click the VirtualBox.mpkg icon first and go through the Installer prompts.  

The welcome screen has a nice intro in the first screen:
"As one of VirtualBox' strengths is user friendliness and excellent operating system integration, we are looking forward to receving feedback, especially suggestions how to make VirtualBox the most user friendly OS X application."

The first screen also lists the known issues of “no support” for a few things -- it's nice to have this in the beginning instead of only in a readme that you may to may not read after installation.

Agree to the software license agreement, and continue to install.  The install took only a few seconds....

Startup VirtualBox to Create Your Virtual Machine for OpenSolaris

Start the VirtualBox app from the Applications folder, and when prompted fill out the registration form with name and email address (if you want).

Then you see a Welcome to VirtualBox screen with a nice explanation of what you're looking at -- why it is empty, and what to do -- press New to create a new virtual machine.

This brings up a wizard for creating a new virtual machine:Creating a new VM

In the next screen, name your virtual machine whatever you want, but it might be a good idea to use something indicating that it's for OpenSolaris because you may add other another VM or two for other operating systems in the future.  Be sure to select Solaris for OS type. Name of VM and OS type

Next you must specify the disk to use as the virtual boot disk.  From this screen, you create a new disk image for this virtual machine by clicking the New button.


After you click New, a series of steps enables you to create your boot drive image.  In the first screen, you might want to select Dynamically expanding image for maximum flexibility and for speed in creating the disk image initially:


Next you must specify the size of the disk that will be reported to OpenSolaris.  The minimum recommended is 10GB, so here we take the offered size of 16GB:


Next a summary page shows what you have chosen and lets you finish the creation of the virtual disk.


Summary page with Finish button


Then you are back at the screen in which you need to select the hard drive.  Your newly created drive should already be selected, so you can  proceed by clicking Next, and then Finish in the next screen to create your virtual machine.  When the virtual machine is created, you are returned back to the main page with summary information about the VM.

Next you need to make the downloaded OpenSolaris image accessible to VirtualBox by mounting it as a CD image.

Mount the os200805.iso as a CD Image (instead of burning a CD)

In the main VirtualBox window, click Settings and then click CD/DVD-ROM.

In the CD/DVD-ROM settings, select Mount  CD/DVD Drive, and ISO Image file, as you see here:


Not sure what's up with that "invalid settings detected" because I didn't have any problems here....

Click the file browser icon next to the ISO Image File list. This brings up the Virtual Disk Image Manager shown below.

Click Add at the top of the window, and then browse to find the os200805.iso file on your Mac.
Select the file and click Open to add the ISO file to the list of CD/DVD images in the Virtual Disk Image Manager. Click Select to choose this ISO file for your VM.

Now you are back in the CD/DVD-ROM settings window, where you should click OK.  


Then you return to the main window of VirtualBox, where you are now ready to start OpenSolaris!


Starting OpenSolaris in VirtualBox

Select your new virtual machine in the Sun xVM VirtualBox window, as shown above.

Then just click the Start button at the top, and OpenSolaris boots from the ISO image that you have mounted as a CD-ROM. The initial screen looks like this:

The selected option (OpenSolaris 2008.05) is the mounted CD, so you can just press Enter here.  You then watch some dots print out as the image is loaded into memory.  Then  when the black text-based screen comes up, you must answer some prompts about your locale so the keyboard and time zone can be set appropriately.

In a few short moments you will see the OpenSolaris desktop, with the open text of the OpenSolaris license marring its beauty.  Gotta love the lawyers.  I closed the license document for this next screenshot.

Next you can install OpenSolaris 2008.05 software by double-clicking the Install OpenSolaris icon.  The installer is pretty straightforward.  I was about to just link off to the install doc, but thought better of it.  Some simple words and pics might help someone who is trying to do what I did.

I made screenshots of all the OpenSolaris install screens inside VirtualBox, but I can't find them now.  I have no idea where they went. I continued writing this blog the next day, having shut down VirtualBox and the Mac the night before.  Maybe I was supposed to save state of the machine when shutting down?  I was asked if I wanted to do that, and didn't because I didn't think I needed to.  I have not read the VirtualBox doc, so I can't really blame anyone but myself if I blew the screenshots away.  :(

So I'll have to proceed without pictures.

 The Disk screen asks you to choose between partitioning the disk or using the whole disk.  Since we created this virtual disk just to install Solaris, I think it's safe to say we can use the whole disk, although the installer recommends partitioning. 

Next you set your time zone data.  A very cool map with dots for major cities lets you click on a city near you to automatically set your region, location, time zone, and date and time. So I click New York since I am on the east coast of the US, and all the fields fill in correctly. Nice feature.

On the Language screen I select English, then on to the User's screen. Here I must set my root password, create a user account for myself, and set the computer name.

The installation summary screen allows me to see all my choices before beginning to install the files.  Another warning that the disk will be erased -- they really want me to know what I am doing.

I click Install and the installation begins.  It took 20 minutes, approximately.

After reboot, when you log in, there is an empty desktop. The first thing you should do is bring up Firefox (see the icon in the menu bar), where the home page is set to a "Welcome to OpenSolaris 2008.05" page that is local to your installation.  This page has links to other places to get information.

The network "just works" on this machine, and everything seems to just work, except for the sound. You can see that the audio is disabled in the VirtualBox summary page, so I will be investigating to see what I can do about it.

In another blog I'll write about getting the sound to work, and installing some packages from the IPS.

<script type="text/javascript"> var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "' type='text/javascript'%3E%3C/script%3E")); </script> <script type="text/javascript"> var pageTracker = _gat._getTracker("UA-4360672-1"); pageTracker._initData(); pageTracker._trackPageview(); </script>

Thursday Nov 29, 2007

Updating the Solaris Multithreaded Programming Guide

Coming soon, an update to the Multithreaded Programming Guide, which is in the Solaris Developer documentation collection.  Included are pthreads APIs that were new in the Single UNIX Specification version 3, including pthread_barrier_\* and pthread_spin_\* functions.

Wednesday Jun 27, 2007

Making Sense of Parallel Programming Terms

Here is an article I wrote while learning about parallel programming,
called Making Sense of Parallel Programming Terms.  Many thanks to Ruud van Der Pas for helping me get it right.

One day soon it will be on

Let me know what you think!

Tuesday Mar 06, 2007

Newbie learning about multithreading

I've been reading around, trying to learn about multithreaded programming.  First major lesson, when you're talking threads, you're probably talking POSIX threads, or Pthreads. There are books of course, but I am not ready for that much detail. Here are some online resources which I have found helpful for the beginner:

Introduction to Parallel Computing tutorial by Blaise Barney, Livermore Computing.

POSIX Thread Programming tutorial by Blaise Barney, Livermore Computing

When I started looking into the POSIX standard for threads, I got a little confused about all the different standards groups attached to this thing.  Then it became apparent that the POSIX standard encompasses a whole lot more than pthreads. It's nothing less than the UNIX specification, apparently. The POSIX FAQ helped me to sort it out.

Thursday Mar 01, 2007

Darn CDs

Okay three months later, and I hate to admit it, but I was never able to install the downloaded Solaris 10 on my SunBlade.  I downloaded the Sparc version onto my PC, burned iso images on CDs on my PC, and tried to install from the CDs on my SunBlade.  It should have worked, but somehow my SunBlade could not recognize the disks.  I burned a second set, which also didn't work, so I gave up and took the SunBlade in to work and did a boot install from the network. Now I am running Solaris 10 11/06.  How many non-Sun people have this problem, and don't have the option to just go install it off the network, I wonder?

We recently made the Solaris Express, Developer Edition available, and it includes developer tools along with Solaris in one big download.  Still have to burn media though.   

The collection of manuals for Developer Edition might be a bit confusing.  All the docs are contained in the Solaris Express, Developer Edition node on  When you open that node, you see a new collection of manuals that are targeted specifically to this release, the Solaris Express, Developer Edition 2/07 collection.

Then there are other collections, with titles such as Solaris Express Reference Manual Collection, Solaris Express Release and Installation Collection and Solaris Express Software Developer Collection. These contain snapshots of manuals that are in the process of being updated for the next official Solaris release. The collections use the name Solaris Express because they have existed in the previous Solaris Express releases.  The really confusing part is when you see that there are release notes in the Solaris Express Release and Installation Collection as well as the Solaris Express, Developer Edition 2/07 collection. You want the Developer Edition version! 

Monday Nov 27, 2006

Sorting things out

I'm trying to sort out the offerings for developers on the Solaris OS. I want to download and install Solaris, including what you need to develop on Solaris.  I could get all this internally on Sun's company network, but I want to see this how a customer sees it. 

I found a New to Solaris page, which seems to be what I need to get started.  I'm already registered on SDN, so the next thing I need to do is Get Solaris, but the link sends me to Get Solaris Enterprise System. Hmmmm. What's up with that?  Methinks someone wants me to seriously consider the whole shebang, but I don't really want that.  There's a checklist of things I can download, and Solaris is just one of them. I can just select that, I hope, without being offered supersize fries and a cherry pie to go with it.  It's free, take it take it! Okay, maybe I'll be back later!

Where do I want to install 

I have to decide where I want to install before I go any further.

I have two machines here in my home office.  One's a SunBlade 150 which you can no longer order... (See, employees don't get the hot new machines, just like the cobbler's children going without new shoes.)  But still, I like it since it's plenty fast for most of that I do, and I can tinker with it, unlike a Sun Ray.  My SB150 has Sun's work-from-home setup installed on it, which I do not want to obliterate as part of this experiment. 

So the other choice is to use a two year old Dell Dimension 3000. It has Windows XP on it, which I don't want to get rid of either... yet.  I know you can set up machines to boot Solaris and Windows, so that's what I need to look into first.  But wait!  Can this Dell support Solaris?  I think it's time to consult the hardware compatibility list... And the bad news is that this machine is not listed.  Maybe I will try it anyway and see what happens.

A quick google found a few pages about setting up multiboot with Solaris and XP, but on first glance these are too techy and I am lazy because this is not my primary objective, but a step I must take to get where I want to go.  So I am not interested in all this background info, I just want a cookbook.  Some other hits for "dual boot Solaris XP" are on Sun forums. These people are looking for cookbooks too!  Looks like Sun doesn't provide this, unfortunately.

Dual Boot Solaris Versions on one SPARC

Now I think maybe I should be able to get my SunBlade to dual boot Solaris 9 and Solaris 10.  That would be cool.   I searched on for dual boot, and didn't find anything.  (We know that the search feature is not great on the doc site, and something is being done about it, coming soon, so I hear.)  I am going to try to find some mention in the Solaris 10 1/06 Release and Installation Collection.

I poked around a bit, eventually coming across this page in the Solaris Live Upgrade manual which has this interesting nugget:

"You can upgrade the Solaris OS by using two upgrade methods: standard and Solaris Live Upgrade. A standard upgrade maintains as many existing configuration parameters as possible of the current Solaris OS. Solaris Live Upgrade creates a copy of the current system. This copy can be upgraded with a standard upgrade. The upgraded Solaris OS can then be switched to become the current system by a simple reboot. If a failure occurs, you can switch back to the original Solaris OS with a reboot. Solaris Live Upgrade enables you to keep your system running while you upgrade and enables you to switch back and forth between Solaris OS releases."

Switch back and forth, yeah that's it!  I want to upgrade my S9 to S10, but still keep my
work-from-home S9 environment with all the tools and stuff.   

Note to self:  Submit RFE for "dual boot" to be added somewhere in install guides so that google and can find.

On second thought

After further investigation and a little frustration, I have decided not to upgrade to S10 using Live Upgrade.  My S9 system is an unusual setup, with many services disabled for security reasons so that when I am not VPN'd into Sun, my system is impervious to unscrupulous elements on the internet.  There are no developer tools at all either. I don't want to use this as a basis to  upgrade to S10.  This article Using Solaris Live Upgrade for the x86 (and SPARC) Platform convinced me because it says that "(LU) upgrades the environment so that it will be as close as possible to what existed in the environment you copied from."   I don't want my S10 installation to be very much like my S9 installation.
I need the developer distro, and it sounds like I will not get them this way! 

So, now I am going to download Solaris 10, burn some DVDs and later upgrade
my Sun Blade, after backing up everything I really need, of course. 

Tuesday Nov 21, 2006

First one

First, let me say that I am a bit of a hesitant blogger, mostly because of the blogosphere's massive display of narcissism gone wild.  So forgive me if this blog contains a dearth of personal info. That just ain't my thing.

I'm a tech writer at Sun, recently assigned to work on Solaris Developer doc. I need to delve into the world of Multithreaded Programming for Solaris Developers, so I can make some overdue updates to the Multithreaded Programmers Guide. This is probably my favorite part of tech writing, plunging in and learning new things. There's an initial reluctance at first, like when you are about to jump into a swimming pool, knowing that it might not be pleasant at the very beginning. It will be fun once you get in and swim around a bit, but that initial shock is something you can live without. Then there's a feeling that I am reading a foreign language, I am confused, bewildered, and wondering what the heck are these people talking about? I am never going to understand this. But this part seems to get easier as time goes on, and I don't think it is just that I'm building on things previously learned. The difference is the web. It is so integrated in my life, both personal and professional, I wonder how I ever did without it. How did I find out anything before? I don't even remember now.

So initially, my blog is going to focus on how I am going about learning what I need to know, and documenting how I do it.  I hope be able to help my group figure out where some of the gaps are in Sun developer doc and  




« December 2016