Philip Wittamore

Sparc Solaris 2.5.1 on Linux

Obtain QEMU

wget http://wiki.qemu.org/download/qemu-0.15.0.tar.gz
gunzip qemu-0.15.0.tar.gz
tar -xvf qemu-0.15.0.tar
cd qemu-0.15.0
configure (add missing libraries, zlib dev for example)
make
sudo make install

also tested with success on qemu 1.6.2

Unfortunately openbios-sparc does not work with solaris yet, so we need a sparc rom.

Here is a Sparcstation 5 bios.

Create a disk image (max 16Gb for Solaris 2.5.1)

qemu-image create -f qcow2 sparc_16.img 16G

Launch qemu, boot into installation cdrom

qemu-system-sparc -bios ./bios/ss5.bin -nographic -L . -hda ./disks/sparc-16G.img -m 256 -M SS-5 -hdb ./cdrom/2.5.1/solaris_2.5.1_1197.iso


at the ok prompt type

boot disk1:d -vs

type format, and select your hard disk

use these values:
Sectors = 63
heads = 16
Cylinders = 32767

save and quit
enter partition
modify
* hog all
quit

at the ok prompt type

boot disk1:d -vs


go through the installation procedure, select "don’t reboot"

To be able to boot from a hdd image, before rebooting add the following line to the /etc/system on the hard drive:

set scsi_options=0×58

# cat >> /a/etc/system
set scsi_reset_delay=10000
set tmpfs:tmpfs_minfree=1
set swapfs_minfree=0x040

to reboot into the hard disk you have created, write a little launcher script:

#!/bin/sh
# run-sparc251 script
qemu-system-sparc \
-bios ./bios/ss5.bin \
-nographic \
-hda ./disks/sparc-16G.img \
-hdb ./cdrom/2.5.1/solaris_2.5.1_1197.iso \
-m 256 \
-M SS-5 \
-boot order=hda \
-net nic,vlan=0 \
-net user,vlan=0 \
-redir tcp:5522:10.0.2.16:22


and at the ok prompt, type

boot disk0

Transfering files from Linux host to Sparc guest

install apache http server on the linux host if you haven’t done it already

sudo apt-get install apache2

go to sunfreeware.com to obtain openssh, wget, gzip etc. Uuencode the file to transmit and save in /var/www, for example:

uuencode w_get-1.11.4-sol25-sparc-local.gz wget-1.11.4-sol25-sparc-local.gz > /var/www/wget.uue

in the sparc solaris guest:

# telnet 10.0.2.2 80 | tee wget.uue
Trying 10.0.2.2...
Connected to 10.0.2.2.
Escape character is '^]'.
GET /wget.uue

uudecode wget.uue
gzip -d wget-1.11.4-sol25-sparc-local.gz
pkgadd -d wget-1.11.4-sol25-sparc-local


Software

here is the basic list of software I installed:

* openssh-5.1p1-sol25-sparc-local
* gcc-3.3.2-sol25-sparc-local
* openssl-1.0.0c-sol25-sparc-local
* prngd-0.9.25-sol25-sparc-local
* gzip-1.3.13-sol25-sparc-local
* snprintf-2.2-sol25-sparc-local
* joe-3.7-sol25-sparc-local
* wget-1.11.4-sol25-sparc-local
* libgcc-3.3-sol25-sparc-local
* lynx-2.8.7-sol25-sparc-local
* zlib-1.2.5-sol25-sparc-local
* ncurses-5.6-sol25-sparc-local

Patches

Don’t forget to update Solaris 2.5.1, google for 2.5.1_Recommended.Z

Notes

the line ''-redir tcp:5522:10.0.2.16:22'' in the startup script above enables access via ssh. 5522 is the port of the host, 22 the port of the sparc solaris emulation, so if you ssh root@localhost:5522 you arrive at the solaris prompt

Set the TERM in solaris to vt100 by editing /etc/profile and replace TERM=sun with TERM=vt100

Booting automatically

once the sparc machine is started, you must enter "boot disk0" manually at the command prompt

there is no way of auto booting disk0, however by using an Expect script you can get around this:

#!/usr/bin/expect
set timeout -1
set log     [lindex $argv 0]
spawn /home/philip/qemu/run-sparc251
expect "ok"
send "boot disk0 \r"
expect eof

references:
qemu.org
tyom.blogspot.com