Revisiting a Solaris on Qemu install

Since I had written about it the last time, quite a bit of the emulation on Qemu has improved significantly since then.  As always you’ll need to create and prepare a disk image, and I’m using an old SUN Station 5 PROM.

qemu-system-sparc -L . -m 64 -M SS-5 -bios ss5.bin -drive file=36G.disk,bus=0,unit=0,media=disk -drive file=solaris_2.6_598_sparc.iso,bus=0,unit=6,media=cdrom -startdate “1999-04-19”

One nice thing is that now you can boot off the CD-ROM.  And you can boot Solaris 2.6 directly into single user mode to format and label the disk.  It’s very convenient.  All you need here is

boot cdrom:d

And from there you can either kick off the disk partitioning, or the installer will boot up.

Booting from Prom to CD-ROM

And now to the graphical welcome screen!

Welcome

And then off to the ‘graphical’ installer.  Yes, it’s not that graphical at all.  Like before, it’s important that you don’t let it reboot on completion, you have to make changes to the system so it’ll boot up correctly, and make changes to the network config.  At least in graphical mode vi works.

installation

It is absolutely critical that you make this change or the disk will not boot at all.

cd /a/etc
# cat >> system
set scsi_options=0x58
^D

For networking:

And you will want a default route…

# cat > defaultrouter
10.0.2.2
^D

Then in the file /etc/nsswitch.conf change the following:

hosts: files

to

hosts: files dns

Then to ‘fix’ up your /etc/resolv.conf

# cat > resolv.conf
nameserver 10.0.2.3
#

And then I like to add the following hosts to speed up telnet…

# cat >> hosts
10.0.2.2 qemunat
10.0.2.3 qemudns
^D

And then hit Control+D and it’ll reboot back to the PROM.  Now all you have to type in the PROM monitor is:

boot disk0:

And in a minute you’ll be at the login screen.

Login Window

I went ahead with CDE, and over on archive.org the old SimCity for UNIX versions are over there.  One nice thing about being able to use CD-ROM’s is that Qemu can finally auto-mount the disk images.  It’s great.

Meltdown

There is no license for SimCity, and after 5 minutes the city goes into a ‘meltdown’ mode.  It’s a shame that back in the day the upstart x86 Linux was largely ignored by the UNIX market.  But Qemu has come quite a bit where you can run some of this proprietary VAR software.

28 thoughts on “Revisiting a Solaris on Qemu install

  1. Yes, I can confirm there’s still plenty of QEMU SPARC development going on 😉

    You should find with the latest QEMU release (2.10) that the -startdate parameter is no longer required, and also that the included OpenBIOS PROM can now boot Solaris fine on the QEMU SS-5 machine if you don’t want to have to manually type the boot command each time.

    Also I’ve rewritten the sun4m IOMMU/DMA code for the upcoming 2.11 release to use the proper QEMU APIs (instead of the legacy “manual” implementations) and I’ve had reports that this improves disk performance by ~20%.

    • Thank you for your work on the DMA code! Any chance you or anyone else will be finishing up sun4u so it can boot 64-bit Solaris versions? Or another alternative: adding QEMU PCI support to the niagara architecture so it can emulate a network card?

      • The main outstanding issue for sun4u preventing Solaris from running is to implement the sun4u MMU IE (invert endian) bit which is used to configure PCI MMIO devices (it’s also used in OpenBSD which is much easier to test with).

        I had an outline from one of the TCG developers as to how to make this work, however I ran into issues with recursive calls into the memory API causing the byte-swaps to be incorrect, so it will need some more thought.

        On the plus side you should find with a recent QEMU that all of NetBSD, OpenBSD, FreeBSD and Linux will boot fine in -nographic mode so I feel that 64-bit Solaris is getting closer…

  2. awesome to hear! I’ve always loved the SPARC more in emulation than in real life for some reason… I was using the SUN Prom as I wanted that look & feel of the old machine, no real reason beyond that, you are right, as I know there was so much work in OpenBIOS to get it to the point where it too can load Solaris.

    Faster disk is always a good thing… especially in emulation.

    Have you tried to install NeXTSTEP?

    • Yes I did, which was the reason I reworked the sun4m IOMMU/DMA code as I thought it might be a DMA coherency issue, but I’m fairly sure it’s not now.

      FWIW you can boot/install NeXTSTEP on Linux if you run QEMU like: taskset –cpu-list=1 qemu-system-sparc …. which restricts QEMU only to use a single CPU – not sure if there’s an equivalent utility for Windows?

      The only remaining differences I can see between the normal/CPU restricted modes are differences in the async ESP IO requests and timers, so still some more digging to do I’m afraid!

      • I pulled down the latest qemu today and on a whim decided to try installing Nextstep 3.3 on an emulated Sparcstation 5 with 256 mb of ram and a tcx framebuffer. I was able to complete the initial install multiple items, which was really neat to see. However, the installer locked upon when extracting additional packages (languages and add-ons) after rebooting. Using openfirmware and the Sun bios both produced the same results. I manually set the cd to unit 6 just in case the different qemu default was a factor, but still the problem persisted. Great to see the progress though!

        • Sorry for the additional post: I found that de-selecting all the add-ons let the installer finish. The disk access on the harddrive seems okay and you can manually install the add-ons from the cd. Openstep works too.

  3. I just found a 5.25 set of PC-NFS 3.0 disks and spent most of this evening archiving them. Maybe I can set up a virtual NFS client if I can figure out if there are any supported NICs in there.

  4. This document is so great.
    I got Solaris 5.6 installed on Qemu 3.1 with -M SS-5.
    But I can’t install Solaris with -M SS-10 and other machine type.
    Do you have any suggestion about this problem?

    • I think you have to force a different CPU type for the SS-10/20’s. There are so many to try that you may have to try each one to see which one works (if it even does).

      I picked the SS-5 as it worked out of the box without so much messing around, and I didn’t see any real objective difference, as I wanted it to ‘just run’.

      Great that you got it booting up though!

        • Well you will need to tell the SS-20 to use a SS-20 ROM so that makes perfect sense.

          The generic ‘OpenBIOS’ ROM ought to be able to boot& install Solaris by now. It was a year+ ago, so you could try that if you Qemu is new enough.

          I didn’t think of the 256MB RAM limit of the SS-5 being a thing, but yes, if you are going to try to run Solaris Cisco IOU stuff you will need plenty of RAM.

          As a side note, unless you are into historical Cisco IOU, getting VIRL will get you ‘modern’ ish IOU IOS for x86 so you can run them on KVM/VMware if you want to… It’ll be a heck of a lot faster, that is for sure!

          And of course there is dynamips!

  5. Hey,

    I was just wondering if you were ever planning on doing a follow up to the Solaris QEMU stuff now that sun4u is supported (albeit still in beta)? I’d love to see a post on that sometime. I’ve not been able to find anyone else doing that online so far. Not with Solaris at least anyway.

    • For Qemu Default Networking, the Addresses are hard-coded:

      10.0.2.15 guest-nic
      255.255.255.0 subnet / netmasks
      10.0.2.2 gateway
      10.0.2.3 dns-server

      s. wiki.qemu.org/Documentation/Networking

Leave a Reply