Sun Microsystems was undoubtedly one of the largest UNIX pioneers of the 90s. They were particularly notable due to their SPARCstation line of computers, which used the RISC-based SPARC processor family, offering excellent power and generous amounts of RAM support.
Since the SPARCstation series was replaced by the Sun Ultra line in 1995 and because Sun is technically no longer existent (due to acquisition by Oracle), vintage SPARCstations are often hard to find and/or purchase. So, that leaves another, far more reasonable option: emulation.
Thankfully, SPARC system emulation is much better than SGI emulation in terms of support, performance, and versatility, and it is only getting better with age. So, if you'd like to know how to "build" your own virtual SPARCstation, scroll down and continue reading.
I followed this guide, this guide, and this guide to get my own setup working. My tutorial will be a sort of amalgamation of the three guides, as well as some tweaks I have made to my own configuration that I believe are beneficial to most people.
If metaphorical benchmarks are useful at all, when I first wrote this guide in 2021, my setup was a Dell Latitude E5540 with a 2GHz Intel Core i5-4310U and 16GB of RAM running macOS Big Sur 11.5. Since then, my setup has changed to a 2022 ASUS ROG Zephyrus M16 running Windows 11, and QEMU has been updated to version 7.2.0. As a result, loading times in Solaris seem to be significantly reduced.
Requirements:
QEMU
A Solaris 2.1-9 ISO for installing the operating system
These can be found here.
For this guide, we will use Solaris 2.6.5.
Some decent knowledge of how to use a CLI (command line interface)
Regardless, this guide will walk you through it pretty thoroughly, so don't worry.
Optional:
A SPARCstation PROM corresponding to the model you're trying to emulate
Instead of loading the bland yellow and black screen of OpenBIOS, using a PROM file will load the white and in-color version of the SPARCstation boot screen, complete with a violet Sun logo and black Sun console font. In my opinion, it makes it feel much more genuine and using the ok prompt in the proper font feels exquisite.
This may actually be a drawback depending on how authentic you'd like your experience to be. OpenBIOS will automatically begin booting Solaris the moment QEMU is invoked from the CLI, while using a PROM file forces you to input boot disk0 at the ok prompt every time you start up the VM. Your choice. Personally, I love using the PROM, but it's up to you.
These files can be found here. For the purposes of this guide, we'll assume you're trying to emulate a SPARCstation 5, so we'll need ss5.bin.
Apparently you can even emulate Tadpole Computer's SPARCbooks using QEMU. I've tried this myself and it works, but I was unable to find a PROM file online.
An original Sun CG3 framebuffer ROM
Normally, without this, using its CG3 clone BIOS, QEMU will run the guest at a resolution of 1024x768 with 8-bit color. Using an original CG3 ROM, however, allows the guest to run at a resolution of 1152x900, still in 8-bit color. If you decide to do this, you must use a SPARCstation PROM file; otherwise, the graphics will bug out.
This can be found here, though I've provided a direct download link here.
Now with those out of the way, let's get into the actual installation and experience of using a virtual SPARCstation.
Install QEMU for your operating system.
Download all required files to one folder or directory.
Now we need to create a hard drive file for QEMU/Solaris to use. Open a terminal window/command prompt and type:
- "C:\Program Files\QEMU\qemu-img.exe" create -f qcow2 (NAME).qcow2 36G (for Windows)
- qemu-img create -f qcow2 (NAME).qcow2 36G (for macOS)
- ./qemu-img create -f qcow2 (NAME).qcow2 36G (for Linux)
...and replace (NAME) with whatever you want to call the disk.
If all goes well, you should see:
Formatting ’(NAME).qcow2’, fmt=qcow2 size=38654705664 encryption=off cluster_size=0Use cd to get to the directory containing the Solaris ISO and your HDD file and then run:
- "C:\Program Files\qemu\qemu-system-sparc.exe" -M SS-5 -m 256 -drive file=(NAME).qcow2,bus=0,unit=0,media=disk -drive file=solaris_2.6_598_sparc.iso,bus=0,unit=2,media=cdrom,readonly=on -vga cg3 [-bios ss5.bin] (for Windows)
- qemu-system-sparc -M SS-5 -m 256 -drive file=(NAME).qcow2,bus=0,unit=0,media=disk -drive file=solaris_2.6_598_sparc.iso,bus=0,unit=2,media=cdrom,readonly=on -vga cg3 [-bios ss5.bin] (for macOS)
- ./qemu-system-sparc -M SS-5 -m 256 -drive file=(NAME).qcow2,bus=0,unit=0,media=disk -drive file=solaris_2.6_598_sparc.iso,bus=0,unit=2,media=cdrom,readonly=on -vga cg3 [-bios ss5.bin] (for Linux)
The bracketed argument is optional. Do not include brackets if you're actually going to use it. I'll break down all parts of the command:
- qemu-system-sparc - Tells QEMU to emulate a SPARC system
- -M SS-5 - Tells QEMU what model to emulate; for us, this is a SPARCstation 5
- -m 256 - Tells QEMU how much memory to use in terms of megabytes; for us, this is the maxed out 256MB that the SPARCstation 5 can accept
- -drive file=(NAME).qcow2,bus=0,unit=0,media=disk - Tells QEMU what hard disk file to use
- -drive file=solaris_2.6_598_sparc.iso,bus=0,unit=2,media=cdrom,readonly=on - Tells QEMU what disc image file to use
- -hda (NAME).disk - Tells QEMU what hard drive file to use; for us, this is our blank QEMU drive we created
- -vga cg3 - Tells QEMU to load the CG3 framebuffer instead of the default TCX one; required for the graphical installer and for using OpenWindows
- -bios ss5.bin - If added, tells QEMU to use the SPARCstation 5 PROM file
After launching QEMU, the system will begin booting. It will load everything it needs, with the exception of the unformatted drive, and then put you at a prompt. Run boot cdrom:d -vs. This will boot from the CD image into a verbose single-user mode.
You will eventually arrive at a screen with:
INIT: SINGLE USER MODE
#
Run the command drvconfig.Now, run disks. These two commands are more useful for adding disks to a live system, but they serve the purpose we need for the time being.
Run the format command. This will ask for many things, so it is important to be careful when selecting options. Go through the prompt as described below:
Specify disk (enter its number): 0
Specify disk type (enter its number): 16
Enter number of data cylinders: 24620
Enter number of alternate cylinders[2]:
Enter number of physical cylinders[24622]:
Enter number of heads: 27
Enter physical number of heads[default]:
Enter number of data sectors/track: 107
Enter number of physical sectors/track[default]:
Enter rpm of drive[3600]:
Enter format time[default]:
Enter cylinder skew[default]:
Enter track skew[default]:
Enter tracks per zone[default]:
Enter alternate tracks[default]:
Enter alternate sectors[default]:
Enter cache control[default]:
Enter prefetch threshold[default]:
Enter minimum prefetch[default]:
Enter maximum prefetch[default]:
Enter disk type name (remember quotes): Qemu36GB
If you followed the instructions correctly, you should see:
selecting c0t0d0
[disk formatted]
...and then the format menu.Run the label command. When prompted, select y.
Repeat step 9.
Run quit or q.
Execute a reboot.
You will arrive at another prompt. Run boot cdrom:d.
Eventually, the system will boot into the graphical installer. For end-user purposes, most of the default settings are fine, but the following are notable or necessary depending on how you'd like your experience to be:
- When it prompts you to enter an IP address, input 10.0.2.15. This is required if you wish to set up networking (see step 15).
- When it prompts you about a name service, click "Other." This is required if you wish to set up networking (see step 15).
- When you get to the "Allocate Client Services" window, click Continue.
- When you get to the "Select Software" window, I highly recommend you click "Entire Distribution plus OEM support." Because we created such a large disk file earlier, this option can be selected with plenty of space remaining for installing additional software. However, this step is entirely up to you.
- When you get to the "Automatically Layout File Systems?" window, clicking "Auto Layout" will work for end-user purposes, and if you decide to (and wish to have a graphical environment), check the /usr/openwin box. If you'd like to have greater control over the size of each "slice" (Sun's 90s term for partitions), click "Manual Layout" instead and follow the instructions.
- MOST IMPORTANTLY: When asked how you'd like the system to reboot after completing installation, click "Manual Reboot." We'll need to make some changes to the system for booting and (optionally) networking purposes.After the installation is done, use the Solaris Install Console to execute the following (with ^D being Control-D):
cd /a/etc
cat >> system
set scsi_options=0x58
^DThe following steps are only necessary if you wish to be able to use networking inside the guest:
- Execute the following:
cat >> defaultrouter
10.0.2.2
^D
- Then, run the following:
sed 's/hosts:.*files/hosts: files dns/g' nsswitch.conf > nsswitch.conf.new
mv nsswitch.conf nsswitch.conf.old && mv nsswitch.conf.new nsswitch.conf
chmod 644 nsswitch.conf
cat > resolv.conf
nameserver 10.0.2.3
^DRun reboot.
When prompted, choose a root password.
Login with the root account. You can choose either OpenWindows or CDE as your default session once prompted.
The following steps are only necessary if you'd like to increase the screen resolution:
- Shut down the VM.
- Locate the file named QEMU,cgthree.bin.
- Download the aforementioned Sun CG3 framebuffer ROM.
- Rename the original QEMU,cgthree.bin file to QEMU,cgthree.bin.old.
- Rename the newly downloaded file to QEMU,cgthree.bin and copy it into the folder where the original file is located.
- Add the argument -g 1152x900x8 next time you'd like to start up the VM. Remember that this requires the SPARCstation PROM file, meaning you also need to add -bios ss5.bin to your arguments if you haven't already.
Welcome to your new virtual SPARCstation!
You can shutdown the system properly by running poweroff, /usr/sbin/shutdown -g0 -i5, or shutdown now as superuser.
Upon your first shutdown, you can remove the second -drive flag to start up without the CD image.
You can mount/swap disc images while the VM is running by doing the following:
If a disc image is already mounted (e.g.: the Solaris install media), execute eject from inside the guest.
From the "View" submenu in the menu strip, click compatmonitor0.
Run change scsi0-cd2 (NAME).iso, where (NAME) is the filepath to the disc image you'd like to mount.
Switch back to cgthree from the View menu. Your disc can be found at /cdrom, but it should automatically appear in a File Browser window.
If you opted to follow step 15, you will have networking capabilities inside the guest, and you can put them to use with the delightfully retro HotJava web browser (run hotjava in a terminal; the app is located at /usr/dt/bin/hotjava). However, do be warned as modern web sites will absolutely not work (except for ones like FrogFind that are designed with vintage machines in mind). I recommend you install Netscape (found here) for a marginally better web browsing experience.
If you decide to use a SPARCstation PROM file, run boot disk0 at the ok prompt to boot into the installed system. You can also shutdown the system from the PROM using power-off. More information about the OpenBoot PROM and its commands can be found here.
Troubleshooting:
On Windows, selecting a different install folder for QEMU requires that you replace "Program Files" in certain commands with whatever directory you specified during setup.
For example, installing QEMU to "C:\Program Files (x86)" means that all instances of "C:\Program Files\QEMU\qemu-system-sparc.exe" should be changed to "C:\Program Files (x86)\QEMU\qemu-system-sparc.exe".
If QEMU throws an "Invalid image size specified." error when trying to create a disk image, try swapping 36G with 36GB or vice versa.
If your system crashes or panics upon attempting to boot, one of your QEMU flags or arguments is probably incorrect. Make sure everything is properly set.
I hope this guide helped you, and enjoy your "new SPARCstation!"
~ Fletchable