Time machine: Solaris 2.6 on QEMU

You can never go home

A big chunk of my professional career in the 1990s was spent with a Sparcstation on my desk. Before that the 68000 Sun2 and Sun3 floated past my sticky fingers but the Sparc machines quickly superseded those. I don't remember too much about which ones: pretty sure there was at least one IPX, one Sparcstation 5, a Sparcstation 10 and then the last one was most likely an Ultra 1 or maybe even an Ultra 5. It was a long time ago. Every now and again I think about how productive those machines were and do a little Ebay digging on how much one would be worth to have around. Except I don't have the room for more machines and the idea of trying to revive 25 year old hardware from that era is well beyond my electronic capabilities.

Never fear, QEMU is here. Following these excellent instructions from Adafruit, you too can install Solaris 2.6 and have your very own emulated machine.

Note that there is one instruction in there I am not sure you need. At one point, the Adafruit article says you need to "set the scsi options" and shows a cryptic code that pushes a hex number into a file on the disk image of your half-built machine. I skipped that. Not only do I not know what the hex number is or represents, the thing boots fine without that part.

What can you do with it?

I had a colleague back then who was unimpressed with Solaris. He was a dyed-in-the-wool SunOS fan, a BSD guy. When Sun announced they were moving to SVR4 and away from using their own operating system, the collective shouting of SunOS administrators was heard as rolling thunder across Usenet. My colleague referred to Solaris as "Slowlaris" and he wasn't wrong. Sun seemed to bloat every OS release with slower and slower GUI tools, especially compared to the snappy SunView windowing system on the 68030 Sun3. The X based systems felt a bit sluggish and having to re-learn where all the configuration files lived was a major pain. A few years on and not only were those windowing systems gone but so was the BSD based Unix that most Sun admins were familiar with. The oncoming Windows onslaught had Sun dropping interest in their second (third?) window management system OpenLook in favour of CDE as alliances were formed and broken in the aftermath of the Unix wars. Then came the final knife twist, they stopped shipping a C compiler with the base operating system.

The last one was particularly hard to take. Sun had always shipped a C compiler with the operating system, but now you had to pay cash money for it and it wasn't cheap. The ISO you download from the Adafruit instructions doesn't seem to have a C compiler included and from memory, when you paid the kings ransom for the C compiler from Sun it came on a different CD. As I said, this was all a long time ago.

First thing I did after the installation was set my user environment to OpenLook - something of a mistake. OpenLook is spartan but it also doesn't have anywhere near the amount of tools that were supplied with CDE. Happily you can select your desktop environment at the login prompt.

Being in OpenLook (actually it might be called OpenWindows at this stage) is like finding yourself behind the wheel of your first proper car. It feels familiar, the old muscle memory still works. There is that flaky Console window that you always had half an eye on, it should show you system messages (a bit like a primitive notification bar for the OS) but it generally stopped working a lot. I notice that as a concept, most Unices don't have anything like that any more. The supplied apps are fairly basic: a text editor; the wacky Command Tool that has a half editor built into it; the simpler Shell tool that's basically a fat X terminal. Most of these are work-alikes for the old SunView tools that older Sun guys used since the start. Re-familiarising myself with this stuff was fun but I wanted a C compiler to make a Hello World app. I needed some way to get files into the VM. Unfortunately a lot of the networking tools don't work quite so well any more, I couldn't get NFS to talk to the NFS server on the host machine (and yes, I tried setting this host back to NFS v2 but still got the never useful "permission denied" error). I'm sure that futzing around with the QEMU ports would likely sort it all out, or perhaps I have the /etc/exports file wrongly configured but I lost interest pretty quickly. The supplied ftp client starts up but it's so old that nothing wants to talk to it any more, even setting your ftp host back to PASV doesn't seem to fix it. The only thing that seems to semi-work is the ancient java based HotJava browser. HotJava struggles mightily with any modern website though (TLS has killed access to even Google). It was fine talking to a local Python based web server which was pleasing, as without NFS or FTP I couldn't work out a way to transfer files inside the Solaris VM. Why do I need to transfer files? Because I want a damn C compiler!

TGCWare to the rescue

I'm not sure who the hero is that runs TGCWare but it's awesome. The standard "cc" command on Solaris usually lives in /usr/ucb/cc but in this case it's a script telling you that you haven't got a C compiler. Talk about passive aggressive. On the host machine, I grabbed a gzipped copy of GCC 2.95 for Solaris 2.6, unzipped it and put it somewhere the Python web server could get it. I made a small page with a link to the file (actually, I added a .png extension first), wrapped that in an img tag and right clicked on that in HotJava. HotJava obliged by giving me the option to download the fake png and once it was saved, I renamed it and ran the Solaris pkgadd command to install it. Then I renamed the /usr/ucb/cc shell script to cc.old and put a soft link in from /usr/tcgware/gcc29/bin/gcc to /usr/ucb/cc. Hello World!

This was where I gave up on OpenLook and switched to CDE. Most of the cool stuff Sun were doing had re-oriented around the Motif based CDE system and there was one tool I was keen to try out again: Application Builder.

CDE was kinda cool. Kinda.

In all the shifting alliances between Unix vendors, HP stepped up to the plate and supplied a GUI builder for CDE that is actually pretty neat. It uses a drag and drop system to put your buttons and widgets onto control panes, then you "generate code" and voila, it dumps out a pile of C code you can then compile and run. We used this quite a bit to make small utilities - the world is a lesser place without neat, simple GUI builders like this. If the source code for it is still floating around it would be interesting to see if it runs on a modern Linux.

The automagically generated code compiled fine with gcc (as soon as I found where make was installed, for reference it's in /usr/ccs/bin). Voila, a quick CDE gui program that does... nothing. Still made me happy though.

Now I will have to start the task of getting the rest of the TGCWare binaries onto the machine, probably best to start with gzip, then wget, then I can grab everything directly from the VM without having to use the intermediary Python script. It's been a fun exercise to play in that environment again, although like a few other people I'd really like to see the source code for SunOS released so I can play with SunView again.

Edit: IT LIVES

The CDE tools were open sourced at some stage and you can download them for your modern Unix!

Edit 2: an even better guide

I haven't checked the links in this guide but here is an alternative to the adafruit article for playing with solaris 2.6. Interestingly he says http is the only thing that is easy to get going for file transfer.

Popular posts from this blog

Tailscale ate my network (and I love it)

That magical word: Workstation