Saturday, March 29, 2014

Solaris 7 x86


A week ago I got Solaris 8 x86 working in VMware. This week, Solaris 7!

I would swear that Sun made Solaris 7 available for download way back because I'd swear that I had a copy of it at one time. But, I have no distinct memory of owning it, only a vague memory, and I can't seem to find any reference it it ever having been available for download on the whole internet. Hmm...

Maybe my memory is failing.

At any rate, it was eBay to the rescue, and I ended up getting an unusual package with both x86 and sparc versions. Maybe I'll be able to get the sparc version running under QEMU some day, but yesterday I was focused on the x86 version.


The Solaris 7 DVD isn't bootable, so I had to boot from the Device Configuration Assistant floppy. VMware didn't get along with the Solaris 7 install kernel any better than with the Solaris 8 install kernel, so I had to convert the iso to a vmdk and install from that, just like with Solaris 8.

To convert, I used qemu-img:

qemu-img convert solaris-7-x86-software.iso -O vmdk solaris-7-x86-software.vmdk

To install, I added a second hard disk to the VMware configuration, aimed it at that vmdk I just made, moved it to IDE 1:1 and made sure the CD/DVD was at IDE 1:0. Then, after booting to the floppy and stepping through a few of the prompts, I told the installer to install from that disk, rather than the CD.

[ ] DISK: Target 1:...

I left the CD/DVD attached though, even though I didn't use it to install, because VMware detects the OS type from the CD. I'm not sure how important that really is, but I figured it was better to do it than not.

Like the Solaris 8 installer, the Solaris 7 installer has a few quirks.

  • Sometimes it crashes right away with a BAD TRAP error. If you just let it reboot, sometimes it works, but sometimes it takes a few times before it will work. I never figured out what caused this.
  • Several times, it tries to get you to run kdmconfig. In each case, just select Bypass or Bypass&Suppress.
  • It doesn't ask for DNS info or a default route. You have to add it manually later.
  • The disk partition and filesystem configuration is just as quirky as on Solaris 8. You have to unselect and reselect c0d0 (c-zero-d-zero) or the installer will think that it has partitions defined even though it doesn't. Also, the default filesystem layout includes a small root and large /export/home and the editor for removing /export/home and resizing root isn't very intuitive.

But, hey, this is an os from the late 90's. I was happy that it installed at all.

And it did.

solaris 7 x86 - 1. installation

And eventually, I got a login.

solaris 7 x86 - 2. login

Post Install Tweaks

Post-install, I had a bit of work to do.

Network configuration was high on the list. I added a default route...

echo "" > /etc/defaultrouter

...and added a DNS configuration to /etc/resolv.conf.


(Note the odd "domainname" keyword vs. the more traditional "domain")

I also configured the /etc/nsswitch.conf so the system would actually pay attention to my fancy new resolv.conf file:

hosts: files dns

I also added a /export/home directory and created a user for myself.

mkdir /export/home
useradd -m -d /export/home/dmuse dmuse
passwd dmuse

Like on 8, you have to supply the -d parameter even though /export/home is the default location for home directories.

I also added some useful paths to PATH in /etc/profile.


There's probably some easy way to restart the network, but I just rebooted and when it came back up, I could telnet in with my new login.

Telnet kind of sucks though. I'd much rather use ssh, but I was a little short on software. Solaris 8 came with a companion CD but I had no such CD for Solaris 7. Googling for Solaris 7 x86 software didn't turn up anything. Well... nothing easy to install at least. I could build software from source, but the C compiler in /usr/ucb required a license that I didn't have. If I could find a copy of gcc, I'd be in business, but I couldn't even find that.

It was the classic bootstrapping, chicken-egg problem.

Eventually it occurred to me that I might be able to build a compiler on my Solaris 8 system, that could run on and target Solaris 7. I downloaded the source for gcc-2.95.3 on my Solaris 8 VM, fiddled around a bit, and voila, it worked!

Running this on Solaris 8...

./configure --prefix=/usr/local/gcc-2.95.3 --host=i386-pc-solaris2.7 --target=i386-pc-solaris2.7 --enable-shared
gmake install

...resulted in a tree under /usr/local/gcc-2.95.3 that I could tar up and ftp to solaris 7 and untar in /usr/local. After adding /usr/local/gcc-2.95.3/bin to my PATH, I had a working compiler!


I used it to build gzip-1.3.12 and then rebuild itself. I installed them under /opt/sfw (which appears to be where "companion" software likes to go). I also built and installed bash-1.14.7 and sudo-1.6.9p23.

After adding /opt/sfw/bin to everybody's PATH, the system started to feel kind-of usable, but I still wanted to be able to ssh in.

Remote Access

Now that I had gcc, I could build openssh. It wasn't trivial though.

I ended up having to build and install perl-5.003_07, openssl-0.9.6h and zlib-1.2.8 first. I didn't have trouble with them but openssh-2.9p2 took a little coaxing.

After configuration...

./configure --prefix=/opt/sfw

I had to edit config.h and replace line 13 with:

#define GETPGRP_VOID 1

and edit openbsd-compat/bsd-snprintf.c and comment out line 58:

/*# undef HAVE_VSNPRINTF*/

Then I could build and install.

make install

To run the server at boot, I created /etc/init.d/sshd


case "$1" in
        killall sshd
        echo $"Usage: $0 {start|stop}"
        exit 1

exit 0

And configured it to start.

chmod 755 /etc/init.d/sshd cd /etc/rc3.d ln -s ../init.d/sshd S90sshd

And enabled X Forwarding in /opt/sfw/etc/sshd_config.

X11Forwarding yes

It appeared to work, and after a reboot, just to make sure it would start on boot, I was able to ssh in.

solaris 7 x86 - 3. ssh

scp worked too.

Ok, NOW the system felt usable.

The Web

I poked around a bit but I couldn't find anything resembling a web server in the base installation. Apache 2.0.65 build and installed cleanly under /opt/sfw though and after a few tweaks to the config file, the "It worked" page came up and I was even able to run a few simple cgi's.

The trickiest part of the apache configuration was setting the group to run as. By default, it uses #-1. On most systems, group id's are 16-bit, -1 translates to 2^16-2, and the "nobody" group has that group id. Apparently, on Solaris, group id's are 32-bit, "nobody" has an id like 60001, and it couldn't make any sense of #-1. This fixed it:

#Group #-1
Group nobody

Easy to fix. Tricky to diagnose.

I added an init script for it too, at /etc/init.d/httpd:


case "$1" in
        /opt/sfw/bin/apachectl start
        /opt/sfw/bin/apachectl stop
        echo $"Usage: $0 {start|stop}"
        exit 1

exit 0

And configured it to start at boot:

chmod 755 /etc/init.d/httpd
cd /etc/rc3.d
ln -s ../init.d/httpd S90httpd

On the client side, I couldn't find anything resembling a browser at first, but I eventually discovered HotJava. Unfortunately, it struggled pretty badly with just about any web site I pointed it at.

The web provided Netscape 4.78 for Solaris 2.5.1 x86. Aside from supporting PNG's, it didn't work all that much better.

solaris 7 x86 - 4. netscape

lynx-2.8.7 and wget-1.5.2 both built cleanly from source though.

Good old, reliable lynx.


The Xsun server that comes with Solaris 7 doesn't support SVGA, so the best you can do with it is 640x480 at 16 colors. To me, monochrome always seems more usable than 16 colors, but there's no obvious way to configure Xsun for monochrome.

For Solaris 8 and 9, there are driver packages available that add SVGA support, but not for Solaris 7. I tried several things, but I was eventually able to install XFree86 4.7.0 and get it working.

I basically downloaded everything from and ran:

sudo sh

The prompts were fairly intuitive.

I then added /usr/X11R6/bin ahead of everything else in everybody's PATH and /usr/X11R6/lib ahead of everything else in everybody's LD_LIBRARY_PATH.

Just running X -autoconfig sort-of worked, but really worked too well. It configured itself to 1024x768 which was cumbersome to use on my screen. Tuning it down required a little work. I had to run x86config and that brought back bad memories. It wasn't so bad this time though. The important bits for me were:

  • Mouse protocol: Auto
  • Monitor: 31.5 - 35.1; Super VGA, 800x600 @ 56 Hz
  • Vertical sync range: 40-150
  • Yes, look at a card database
  • Card: Generic VESA compatible
  • Video memory: 1024K
  • Color depth by default: 16 bits (65536 colors)

The server still had issues with the mouse though. The configurator defaults to /dev/mouse. I had no idea what the mouse device actually was, and nothing in /dev looked mouse-ish. The mouse worked in autoconfig mode, so I knew it was possible to get it to work. It turned out, all I had to do was edit the XF86Config file manually and just comment out the mouse device line:

#Option "Device" "/dev/mouse"

Woohoo, CDE!

solaris 7 x86 - 5. cde

To get that running, I had to create a ~/.xinitrc with:


And run xinit.

Getting openlook to run was trickier. It really likes to run the Xsun server, so I had to swap that with the XFree86 server:

cd /usr/openwin/bin sudo mv Xsun Xsun.old ln -s /usr/X11R6/bin/X Xsun

I also had to remove my .xinitrc. But after that, running openwin worked:

solaris 7 x86 - 6. openlook

Well, sort-of.

It complained about a lack of display postscript. No idea how to get that working, if it's even possible.

Starting a graphical login was a little more difficult. dtlogin likes to run Xsun too, with arguments that XFree86 doesn't understand. Replacing the Xsun link with this script seemed to solve the problem:


ARGS=`echo $@ | sed -e "s|-nobanner||g"`

/usr/X11R6/bin/X $ARGS

After that, I could enable dtlogin:

sudo dtconfig -e

And after a reboot, it worked.

Well.. again... sort-of. For some reason, I couldn't exit a CDE session without hitting ctrl-alt-backspace.

Ahh, who knows? It wasn't worth figuring out. I didn't plan on running dtlogin anyway, so I disabled it:

sudo dtconfig -d


I had gcc working, but I needed a few other tools to be able to compile my software. Fortunately I didn't have any trouble building or installing cvs-1.11.23, gnu make-3.82, gnu tar-1.13, or vim-7.4 from source. It was as simple as configure, make and make install. I made symlinks from make to gmake and tar to gtar too, just for good measure.

I couldn't get modern-ish versions of postgresql, mysql, sqlite or even freetds to compile though. Actually, freetds compiled but the install script left files out. Who knows? I'll have to look into that later.

I had to disable openssl support because openssl only built static libraries, but other than that, Rudiments built cleanly. SQL Relay had trouble with Perl, and aside from not having any database API's to compile against, built fine.

Obligatory screen shot of being able to access Oracle:

solaris 7 x86 - 7. sqlrsh

I did have trouble with CVS hanging while accessing my local server for some reason, but it had no trouble with sourceforge. I'm not sure why. Man, I need to migrate to GIT or something though. Just typing "CVS" makes me feel old.


Or maybe I should call them "endearing features"...

  • You have to use the Delete key rather than Backspace on the console.
  • The default shell doesn't understand ~/ but does understand $HOME.
  • Filesystem performance is not so good, untarring and rm -rf'ing take a while.
  • Setting the domain in /etc/resolv.conf uses the domainname keyword rather than domain.
  • Still though, rpckeygen and sendmail don't know the domain name is, and there's no obvious reason why.
  • The command line ftp client is in text mode by default but REPORTS binary and corrupts files unless you explicitly set it to binary mode before downloading.

It turns out Solaris 8 has that same ftp problem. I kept downloading files and getting CRC errors gunzipping them. It took a while to figure out why.

The most significant quirk though is that VMware doesn't detect the Solaris 7 idle loop and it makes the host CPU run at 100%. Electricity isn't free. I wonder if there's anything that can be done about that. VMware detects "Solaris 7" during installation, and sets the Guest Operating System type to "Solaris 10". I tried switching it to 8, but doing that rendered the system unbootable. Worse, it appeared to corrupt something because after setting it back, the system was still unbootable! I ended up having to reinstall completely to get it to work again. There might be some solution there, but I'm kind-of scared to try again.

So, alas, I can't put my shiny new Solaris 7 system in my build farm.

Oh well, I guess you can't win 'em all.

Sunday, March 23, 2014

Solaris 8 x86


Years and years ago, Sun (when they were still Sun) made Solaris 8 freely available for download and development use. I had always wanted my software to run on Solaris, but could never afford Sun hardware, so I was excited to discover that Solaris 8 was available for both Sparc and x86 platforms. Back then, I had a PC dedicated to it, but when virtualization became practical, I migrated it to VMware. Years passed. I installed 9, 10 and 11, and during some migration, neglected 8 entirely.

About a month ago though, out of the blue, I began to miss it and decided to reinstall it in VMware 8.0.6. Much to my surprise, the installer crashed and rebooted over and over, no matter how much I tweaked VMware. What the heck? I was confident that it worked in an older version, I ran it for years. QEMU wasn't any more helpful. The installer failed there too. Bochs got a little further, but eventually crashed and rebooted too.

It was a terrible state of affairs. All available emulators appeared to be incompatible. I wanted to cry.

Instead, I did a whole bunch of digging and debugging, and at infinite length, discovered the following:

  • The install kernel and installer software are finicky enough with ATAPI and LBA that the installer can't be run from the DVD image under any modern emulator.
  • The distro came with several discs including an installer, disk1 and disk2. Disc1 is apparently also bootable and contains a more capable kernel and installer, but the installer still can't be run from the DVD image.
  • It can be run from a disk image though.

I'll spare you the details, but it was nothing short of a miracle that I discovered some of that. For example, the installer eventually prints an error on the screen that only one document on the entire internet knows anything about, and that document is for Solaris 9, not 8. The prescribed solution alludes to disc1 also being bootable. If it weren't for that document, I doubt I'd have ever known.

So... To make a long story short, here's how to get it to run.


Convert the disc1 iso to a vmdk disk image using QEMU's qemu-img:

qemu-img convert solaris-8-u7-disc1.iso -O vmdk solaris-8-u7-disc1.vmdk

Set up a typical VMware VM, accept the defaults - 8g hard drive and 256m of RAM. I removed the sound card and floppy but you don't have to. Don't let it auto-start though. Instead, make sure the hard drive is on IDE 0:0 and cdrom is on IDE 1:0. Then add a second hard drive and aim it at solaris-8-u7-disc1.vmdk, that disk image you created a minute ago and set that disk to be at IDE 1:1. If it's at IDE 0:1 then VMware will attempt to boot to it directly, which will fail.

Start the VM. It should boot to the DVD. The initial prompts should be straightforward. On the "Boot Solaris" screen though, arrow down and hit space to select:

[ ] DISK: Target 1:...

Select a "Solaris Interactive" installation and follow the prompts.

There are a few quirks.

  • Over and over, the installer will try to get you to run kdmconfig. In each case, select Bypass or Bypass&Suppress.
  • The installer doesn't ask for a default route. You'll have to add it manually later.
  • The interface for selecting the Geographical Region is odd. You have to press space on the V to expand a section, then move over using the arrows and hit space to select a specific region. It wasn't intuitive to me but it might be to you. I was tired at the time.

Formatting and partitioning is REALLY quirky.

On the "Select Disks" screen, deselect and reselect c0d0 (that's c-zero-d-zero). Failure to do so appears to confuse the installer into thinking that the disk is already partitioned and causes filesystem creation to fail with a cryptic error.

If you accept the default filesystem layout, you will get a small root partition and very large /export/home partition. This makes it tricky to install much software on the root partition. If you don't want to play games with symlinks later, remove the /export/home partition and expand the root partition.

The interface for editing file systems isn't intuitive though. You have to actually delete the word /export/home using the delete key and set the size to 0 to actually delete it. There's no "fill-remaining space" option to expand the root and file system creation will fail (and thankfully return you to the editor) if you set it to an invalid size. With an 8G disk, and the default swap size, I had to set my root size to 8031, which I figured out after a few failed attempts.

The rest of the installation is straightforward.

solaris 8 x86 - 1. install part 1

At some point it asks you to insert disc2 and then it installs a bunch of stuff from there too.

solaris 8 x86 - 2. install part2

And, eventually you get a login.

solaris 8 x86 - 3. first login

It's not too happy that you didn't configure X, but that's OK. If you had, it would have been even more confusing.

Post-Install Tweaks

Ok, now that the OS is installed, a few post-install tweaks are necessary.

If you didn't tell the installer to use DHCP, then it didn't ask you for a default route. You can set it manually though:

echo > /etc/defaultrouter

I'm sure there's some way to restart networking without a reboot but I couldn't figure it out, so I rebooted. When the system came back up, I could ping yahoo and telnet to port 80 at various sites.

There are various paths that are helpful to add to the default PATH too. Edit /etc/profile and modify as follows:



Back when Solaris 8 was out, there were actually 4 DVD images available: installation, disc1, disc2 and "companion". The companion disc contained a ton of open source software packages including a bunch of GNU tools that anything approaching modern computing is really hard to do without.

If you aim VMware's fake CDROM drive at the companion DVD, Solaris should mount it automatically. The installer is graphical though, and we intentionally skipped configuring graphics during the install, so you have to aim the DISPLAY at a different computer.

Run xhost + on that other computer, then run, as root, on Solaris:

export DISPLAY

After a few seconds, the installer will pop up. It's intuitive.

solaris 8 x86 - 4. companion

After installing the software there are a few things to configure.

Sudo has the wrong permissions. Fix that:

chmod u+s /opt/sfw/bin/sudo

And, nobody can actually use any of this software unless you add /opt/sfw/bin to everybody's PATH and /opt/sfw/lib to everybody's LD_LIBRARY_PATH. Edit /etc/profile as follows:


Woohoo! Now we have bash, gcc, gzip, gtar, gmake... everything!

Adding A User

So far everything has been done as root, but that's not going to work in the long term.

Solaris likes to put home directories in /export/home but since we told the installer not to create an /export/home filesystem, that directory doesn't even exist. Create it:

mkdir /export/home

And create a user:

useradd -m -d /export/home/dmuse dmuse
passwd dmuse

The useradd command was confusing to me. It seemed to require the -d option, even though the -m option tells it to create a home directory, and the default place to create them is in /export/home. It's possible that I just misunderstood something though. It was pretty late when I was working on it.

The sudoers file is /opt/sfw/etc/sudoers if you want to give the user sudo access.

Remote Access

I was all "Woohoo! ... everything!" earlier, but the companion CD didn't really give us everything. Remote access is a little lacking on Solaris 8. It comes with ftp and telnet clients and servers, but SSH is conspicuously absent. This is forgivable, considering it was released in 2000, but it's hard to live without SSH these days.

Fortunately we have everything necessary to build and install OpenSSH from source. I used OpenSSL 0.9.6h and OpenSSH 2.9p2 because I'd recently had good luck with them on old linux systems. Do not expose a server running these old versions to the internet though, as they undoubtedly have vulnerabilities.

To build:

gtar xfz openssl-0.9.6h.tar.gz
cd openssl-0.9.6h
sudo make install
cd ..
gtar xfz openssh-2.9p2.tar.gz
cd openssh-2.9p2
./configure --prefix=/usr/local/openssh-2.9p2
sudo make install

To configure it to start at boot, create /etc/init.d/sshd


case "$1" in
        killall sshd
        echo $"Usage: $0 {start|stop}"
        exit 1

exit 0

And symlink it to into /etc/rc3.d

cd /etc/rc3.d
sudo ln -s ../init.d/sshd S90sshd

To configure X forwarding, edit /usr/local/openssh-2.9p2/etc/sshd_config and change the X11Forwarding line to:

X11Forwarding yes

To make all of this available to everybody, update the PATH in /etc/profile


And to start the server without a reboot, run:

sudo /etc/init.d/sshd start

solaris 8 x86 - 7. ssh

NOW we're getting somewhere.

The Web

Solaris 8 comes with Apache 1.3.12 and it's configured to start at boot, but it's disabled by default because the config file is missing. To enable it, just copy the example config file to a real config file:

cd /etc/apache
sudo cp httpd.conf-example httpd.conf

And start it up:

sudo /etc/init.d/apache start

The default DocumentRoot is /var/apache/htdocs. The "It Worked!" page came up immediately. After a few tweaks to the config file, I got CGI's working too.

From the client side, things weren't as good. The companion DVD provides workable versions of wget and lynx but as far as graphical web browsers go, Netscape 4.76 was all that was available. It supports PNG's, but struggles with CSS and javascript and was hilariously unusable.

solaris 8 x86 - 10. netscape

I didn't really expect it to work though, so I wasn't all that disappointed.


The default Xsun server doesn't support SVGA or VESA, so the best you can get with it is 16 colors at 640x480.


Thanks to:

  • Sun releasing the "Solaris XFree86 Video Drivers and Porting Kit" source
  • J├╝rgen Keil adapting it to XFree86
  • ...and allowing the guy that runs VM Back (who's name I can't find anywhere on the site) to distribute a binary package of it

We have: solaris-xf86-

The page says you have to apply patches 109401-14, 119068-02 and 112786-43 from SunSolve before using it, but SunSolve is long gone, the Russian mirrors are sketchy and I haven't run into any issues yet without them. Your mileage may vary.

I downloaded and extracted the package, and installed it with:

pkgadd -d `pwd` SUNWxf86u SUNWxf86r

Then I ran kdmconfig and had all kinds of fun getting it configured correctly. This worked for me:

  • Video card: XF86-VMWARE VMware SVGA virtual video cards
  • Monitor: Super VGA 35.5 Hz (800x600 @ 56Hz and 1024x768 Interlaced)
  • Screen: 15-inch
  • Resolution: 800x600 - 16777216 colors @ 56Hz
    • The number of colors must match the host. 256 colors also works but leaves the cursor with a weird black box around it.
  • Virtual Resolution: 800x600

To just get an X session from the command line, create a .xinitrc file in your home directory with:


and run:


And you should get a beautiful CDE session like this:

solaris 8 x85 - 5. cde

If you prefer OPENLOOK, remove your .xinitrc and run:


solaris 8 x86 - 6. openlook

Oh yeah, that looks old.

As a side effect of running kdmconfig, a graphical login will start up when the machine is rebooted.

You can disable this using:

sudo /usr/dt/bin/dtconfig -d

Or re-enable it using:

sudo /usr/dt/bin/dtconfig -e

I tried running CDE to a nested X server on a remote machine but something doesn't run properly. I got the splash screen and nothing else. Some of the other programs were running, but not everything necessary for a session, and what did run didn't show up on the screen. Openlook was even worse. It forces itself to run on the console by default, no matter what DISPLAY is set to. It seemed like it would take more time than I cared to spend to get either of them working.


Yes, development. What I'm actually up to here... I wanted to get SQL Relay running.

The companion CD gave me most of the tools I needed: vim, cvs, gcc, gmake, readline, tcl... Solaris just comes with Java too. Databases were conspicuously absent though. I managed to build freetds from source, but current versions of postgresql, mysql and sqlite all failed for one reason or another and though unixodbc built just fine, it was useless without drivers from one of the other packages.

I guess Oracle 8.something.or.other was out when Solaris 8 was popular, and it might have been freely available for development purposes, like the Linux version, but I didn't have the presence of mind back then to download it. Actually, it's possible that Oracle only made Windows and Linux versions available for download. It was a long time ago and I don't remember it clearly.

At any rate, I got most of my software to compile. I had to disable SSL support in Rudiments because, for some reason, OpenSSL 0.9.6h didn't build shared object versions of its libraries. Ironically, I couldn't get the SQL Relay Java API to build either because of a compiler warning in the JNI header. The version of Python provided by the Companion CD was too old too.

I have a little tweaking to do, but that's part of the fun.

I was able to get SQL Relay to talk to MS SQL Server and Sybase using FreeTDS, and I was able to talk to Oracle via SQL Relay on a nearby Linux machine.

solaris 8 x86 - 9. sqlrsh

I guess that last screenshot isn't as interesting as similar shots usually are, as Solaris 8 x86 was once an Oracle-supported platform.


Solaris 8 was substantially less quirky than other OS'es of similar vintage. The only really badly noticeable issue was the filesystem performance. When untarring or running rm -rf, it drags badly. It's probably slow when compiling too, but it's really noticeable when extracting or deleting lots of files.

Other quirks:

  • You have to use the Delete key rather than Backspace on the console.
  • The default shell doesn't understand ~/ but does understand $HOME.
  • The ping command is /usr/sbin/ping and /usr/sbin is not in a non-root user's path.

I'm sure I'll run into more quirks as I play with it more.

I hope so. It's odd little details that make older OS'es so much fun.