# Build your own SPARC workstation with QEMU and Solaris

## Overview

![](https://cdn-learn.adafruit.com/assets/assets/000/074/988/medium800/hacks_sparc.jpg?1556306838)

Back in the late 80s and through the 90s, Unix workstations were super powerful, super cool, and super expensive. If you were making 3D graphics or developing applications, you wanted a high-performance workstation and Sun made some of the best ones. But unless you worked for a huge company, university, or government, they were probably too expensive.

More than twenty years later, we have much more powerful and affordable computers, so let's emulate the old systems and see what it was like to run some of the coolest computers you could buy in the 90s.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/621/medium800/hacks_install01.jpg?1555690487)

Sun workstations started out running SunOS, based on BSD Unix (like NeXTSTEP), but in 1991 they replaced it with Solaris, based on Unix System V Release 4 (like AIX and HP-UX).

The first version of Solaris was actually Solaris 2, and to try and make sense they went back and named SunOS Solaris 1, but in the operating system it still refers to itself as SunOS. So Solaris 1 is SunOS 4, and Solaris 2 is SunOS 5, and Solaris 2.6 that we'll run is SunOS 5.6. Confused yet?

Ignore the naming conventions and just know that we'll run Solaris 2.6 from 1997. For comparison, at that time a PC would be running Windows 95 and Apple released Mac OS 8 the same year.

You'll need:

- The latest version of [QEMU](https://www.qemu.org/download/), for this guide version 3.1.0 worked well.
- A system to run it on - Windows, Linux, or Mac
- [Solaris 2.6 ISO](https://winworldpc.com/product/sun-solaris/2x)
- For added fun, a Sun Type 5 keyboard converted to USB with [Drakware's Sun2USB](https://drakware.com/product/Sun2USB) or DIY with the [SPARC keyboard specification](https://sparc.org/technical-documents/specifications/) and a small Arduino like the Trinket M0

# Build your own SPARC workstation with QEMU and Solaris

## Set up QEMU

![](https://cdn-learn.adafruit.com/assets/assets/000/074/999/medium800/hacks_Untitled.png?1556310568)

Rather than using a virtual machine to run the x86 version of Solaris, we'll use QEMU to emulate the actual SPARC hardware used by Sun machines back in the 90s. SPARC stands for Scalable Processor Architecture and is a RISC (reduced instruction set computing) design.

For Windows, you can download the latest binary from the [QEMU site](https://www.qemu.org/). I used the 20190218 build.

For macOS you can use homebrew to install it:

```
brew install qemu
```

If you're running Linux, your distribution might have an older version of QEMU so you'll need to get the source and compile it. That goes a bit beyond this guide so take a look at the [download page](https://www.qemu.org/download/#source) for more info.

# Build your own SPARC workstation with QEMU and Solaris

## Create a disk image

The disk format that QEMU uses is called qcow2. We'll make a 9.1GB disk, that's plenty to hold Solaris and have a lot of room left over.

```
qemu-img create -f qcow2 sparc.qcow2 9663676416
```

Disks in Solaris need to be labelled before they can be used, so we can't install just yet. First we need to boot into Solaris to format and label the disk we just made.

```
qemu-system-sparc -M SS-5 -m 128 -drive file=sparc.qcow2,bus=0,unit=0,media=disk -drive file=solaris_2.6_598_sparc.iso,bus=0,unit=2,media=cdrom,readonly=on
```

Let's take a look at the options:

**qemu-system-sparc** - run the emulator for a 32-bit SPARC system

**-M SS-5** - emulate a SPARCstation 5

**-m 128** - 128 MB of RAM

**-drive file=sparc.qcow2,bus=0,unit=0,media=disk** - Use our disk image, put it on SCSI bus 0, unit 0

**-drive file=solaris\_2.6\_598\_sparc.iso,bus=0,unit=2,media=cdrom,readonly=on** - Use the Solaris 2.6 ISO as a CD drive, SCSI bus 0, unit 2

Once you run that, the OpenBIOS ROM should start first and bring you to a prompt, type:

```
boot cdrom:d -vs
```

![](https://cdn-learn.adafruit.com/assets/assets/000/074/727/medium800/hacks_disk01.jpg?1555957883)

The system should boot into single user mode and bring you to a root prompt (#). First we run a few commands to prep the system, then we'll format the disk.

```
# drvconfig
# disks
# format
```

Solaris only knows about a few specific disk types, so we need to specify our own geometry.

```
Specify disk (enter its number): 0
Specify disk type (enter its number): 16
Enter number of data cylinders: 16381
...defaults are fine here...
Enter number of heads: 16
...
Enter number of data sectors/track: 63
...
Enter disk type name (remember quotes): Qemu9G
```

![](https://cdn-learn.adafruit.com/assets/assets/000/074/736/medium800/hacks_disk03.jpg?1555958280)

Now label the disk - it's really easy:

```
format&gt; label
Ready to label disk, continue? y
```

All set. Now type **q** to quit the format utility and type **reboot** to restart the system. It's time to install!

# Build your own SPARC workstation with QEMU and Solaris

## Install Solaris

The reboot should take you back to OpenBIOS. Boot from the CD again but this time into the installer:

```
boot cdrom:d
```

![](https://cdn-learn.adafruit.com/assets/assets/000/074/737/medium800/hacks_install01.jpg?1555960520)

Time to install! For the most part, the defaults are fine, but there are a few places where you'll want to make changes.

When you reach the networking options, pick a hostname and check **Yes** for Networked. Use 10.0.2.15 for the IP address, QEMU has its own internal network.

Name service: **Other**

Part of a subnet: **No**

![](https://cdn-learn.adafruit.com/assets/assets/000/074/738/medium800/hacks_install04.jpg?1555961571)

Now set the time zone, time, and date. When you get to "Allocate Client Services" just click **Continue**. Pick an additional language if you'd like one.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/739/medium800/hacks_install06.jpg?1555961918)

Choose how much you want to install. **End User** is enough to run it, **Developer** will let you build things, and **Entire Distribution** will just install everything. If you really want to, you can **Customize the installation** but it's easy to break things so it's best to stick with the available software groups.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/740/medium800/hacks_install07.jpg?1555962351)

It should auto-select the available disk for you but if not you can select it and click the right arrow to add it to the selected disks.

When it asks about preserving data you can click **continue**. Click **Auto Layout** and **continue** , the defaults are fine. Click continue on the remote file systems page.

Now you can review the last few options. If it looks good click **Begin Installation**.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/741/medium800/hacks_install09.jpg?1555962620)

Make sure you choose **Manual Reboot** when prompted - we need to change some settings or else it won't boot.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/747/medium800/hacks_install10.jpg?1555963267)

Once everything is finished you should see "The finish script log `finish log` is located in /var/sadm/system/logs after reboot." followed by a root prompt (#).

# Build your own SPARC workstation with QEMU and Solaris

## Install Solaris part 2

Now that the installation has finished we need to adjust a few settings to make everything work, we'll use the console to do it. Below, ^D means push Ctrl+D.

First we'll set the SCSI flags so it'll boot properly.

```
# cd /a/etc
# cat &gt;&gt; system
set scsi_options=0x58
^D
#
```

Next we need some network settings. Let's add a default router, the address that QEMU uses is **10.0.2.2**.

```
# cat &gt; defaultrouter
10.0.2.2
^D
#
```

Now configure DNS. The nameserver is **10.0.2.3**.

By default, Solaris doesn't use a nameserver at all so we need to enable it. The first 3 lines make that change to **nsswitch.conf** and save it in a new file, replace the old file, then set the right permissions.

Next we tell it what nameserver to use by adding a line to the **resolv.conf** file.

```
# sed 's/hosts:.*files/hosts: files dns/g' nsswitch.conf &gt; nsswitch.conf.new
# mv nsswitch.conf nsswitch.conf.old &amp;&amp; mv nsswitch.conf.new nsswitch.conf
# chmod 644 nsswitch.conf

# cat &gt; resolv.conf
nameserver 10.0.2.3
^D
```

![](https://cdn-learn.adafruit.com/assets/assets/000/074/751/medium800/hacks_install12.jpg?1555964950)

All set! Time to reboot, just type reboot and hit enter.

# Build your own SPARC workstation with QEMU and Solaris

## User Setup

![](https://cdn-learn.adafruit.com/assets/assets/000/074/983/medium800/hacks_solaris02.jpg?1556296023)

The root account has full access to everything, so it's a very good idea to set a password. It's also a good idea to set up a normal user account. We'll do that next.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/984/medium800/hacks_solaris03.jpg?1556296471)

Here's the login screen, go ahead and log in as **root** with the password you just set. Once you push enter or click **OK** , it will ask which desktop environment you'd like. **CDE** is the default and a good choice, OpenWindows is the older environment.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/985/medium800/hacks_solaris04.jpg?1556296744)

Welcome to CDE!

A bunch of windows will open, you can close them all or take a look if you like. The **Help Viewer** will give you an introduction to the CDE desktop.

The panel on the bottom has everything you need, each icon will launch something or the arrow on top will expand a tray with more things to run. We want to create a new user, so open up **Applications** , go to **System\_Admin** , then run **Admintool**.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/986/medium800/hacks_solaris05.jpg?1556297737)

Go to **Edit** , **Add** , and add a user for yourself. The defaults are fine for most of it. For the home directory path at the bottom you'll want to use **/export/home/youruser**. Click **OK** , then exit Admintool. Click **exit** down at the bottom of the panel and **OK** to log out. Now you can log in as your new user and the system will prompt you to set a password. The mouse needs to be in the password window to focus it. Once set you'll be able to login.

![](https://cdn-learn.adafruit.com/assets/assets/000/074/987/medium800/hacks_solaris08.jpg?1556298323)

You'll get all the windows opening again, plus one that wants you to register. You can just click **Never Register**.

When you want to shut down, click **Exit** again, then go to Options and Command Line Login. Press **enter** to get a console login prompt, login as root, then type **shutdown now**. After that you can quit QEMU.

Next time you start you can leave out the CD part:

```
qemu-system-sparc -M SS-5 -m 128 -drive file=sparc.qcow2,bus=0,unit=0,media=disk
```

That's it! Enjoy your Solaris system!


## Featured Products

### Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE

[Adafruit Trinket M0 - for use with CircuitPython & Arduino IDE](https://www.adafruit.com/product/3500)
The&nbsp;Adafruit Trinket M0 may be small, but do not be fooled by its size! It's a tiny microcontroller board, built around the Atmel ATSAMD21, a little chip with _a lot_ of power. We wanted to design a microcontroller board that was small enough to fit into any project, and low...

Out of Stock
[Buy Now](https://www.adafruit.com/product/3500)
[Related Guides to the Product](https://learn.adafruit.com/products/3500/guides)
### USB cable - USB A to Micro-B

[USB cable - USB A to Micro-B](https://www.adafruit.com/product/592)
This here is your standard A to micro-B USB cable, for USB 1.1 or 2.0. Perfect for connecting a PC to your Metro, Feather, Raspberry Pi or other dev-board or microcontroller

Approximately 3 feet / 1 meter long

Out of Stock
[Buy Now](https://www.adafruit.com/product/592)
[Related Guides to the Product](https://learn.adafruit.com/products/592/guides)

## Related Guides

- [Adafruit Trinket M0](https://learn.adafruit.com/adafruit-trinket-m0-circuitpython-arduino.md)
- [Porting an Arduino library to CircuitPython: VL6180X Distance Sensor](https://learn.adafruit.com/porting-an-arduino-library-to-circuitpython-vl6180x-distance-sensor.md)
- [Trinket (& Gemma) Servo Control](https://learn.adafruit.com/trinket-gemma-servo-control.md)
- [Make your own PCB with Eagle, OSH Park, and Adafruit!](https://learn.adafruit.com/making-pcbs-with-oshpark-and-eagle.md)
- [3D Printed LED Fire Horns](https://learn.adafruit.com/3d-printed-led-fire-horns.md)
- [CircuitPython Powered AT Hand-Raiser](https://learn.adafruit.com/at-hand-raiser.md)
- [CircuitPython Basics: Digital Inputs & Outputs](https://learn.adafruit.com/circuitpython-digital-inputs-and-outputs.md)
- [CircuitPython 101: Basic Builtin Data Structures](https://learn.adafruit.com/basic-datastructures-in-circuitpython.md)
- [Sensor Plotting with Mu and CircuitPython](https://learn.adafruit.com/sensor-plotting-with-mu-and-circuitpython.md)
- [Glowy Message Crown](https://learn.adafruit.com/glowy-message-crown.md)
- [How to Program SAMD Bootloaders](https://learn.adafruit.com/how-to-program-samd-bootloaders.md)
- [NeoPixel Cyber Falls Wig](https://learn.adafruit.com/neopixel-cyber-falls.md)
- [Using DS18B20 Temperature Sensor with CircuitPython](https://learn.adafruit.com/using-ds18b20-temperature-sensor-with-circuitpython.md)
- [CircuitPython Hardware: LED Backpacks & FeatherWings](https://learn.adafruit.com/micropython-hardware-led-backpacks-and-featherwings.md)
- [NeoPixel LED Mickey Ears](https://learn.adafruit.com/neopixel-led-mickey-ears.md)
- [Custom Controllers for MakeCode Arcade](https://learn.adafruit.com/custom-controllers-for-makecode-arcade.md)
