Installation Solaris Sparc 2.6 (SunOS 5.6) on Qemu – Part1 Qemu Installation

Introduction

The goal of this article is to describe patching, configuration, compilation and installation Qemu 0.14.1 for x86 architecture. I choose Qemu version 0.14.1  as it has been the highest version with written patch for UDP tunnels and multicast and it is known to work with GNS3.  As you know GNS3 uses UDP tunnels to connect Qemu instances themselves.

The tutorial also shows configuration, compilation and installation the latest Qemu git version for  sparc-32 architecture. First, I tried to emulate SS-20 sparc machine with Qemu 0.14.1 but Solaris 2.6 installation hanged up shortly after boot from CDROM. I haven’t notice such a problem with the latest Qemu version.

The Qemu image with installed Solaris 2.6 Sparc (SunOS 5.6) can be used for quick testing of Cisco IOU binary images compiled for Sparc platform.

Unfortunately I managed to install Solaris into SS-5 only so we are limited to maximum 256 MB RAM. Use the latest Qemu version 1.x to emulate SS-20.  SS-20 offers 512MB RAM comparing to SS-5 that allows only 256MB.  As you can imagine this RAM size is not convenient for running complex topology with multiple IOU instances. Try to set at least 4GB space for swap during  installation.

The  tutorial describing Solaris 2.6 Sparc installation can be found here:

http://brezular.wordpress.com/2012/02/17/installation-solaris-2-6-sparc-on-qemu-part2-solaris-installation/

1. Requirements

- Host System    -   x86, Linux Fedora 15
- Guest system  -  Solaris 2.6 (sunOS 5.6) Sparc
- Emulator          -  Qemu 0.14.1 and the latest Qemu from git
- BIOS                 -  proprietary Sparc BIOS for Slolaris

2. Qemu 0.14.1 Installation

a)  Install required Fedora packages for Qemu compilation

sudo yum install ncurses-libs ncurses-devel zlib-devel SDL-devel libpcap-devel glib2-devel

b)  Download and untar Qemu 0.14.1

wget http://download.savannah.gnu.org/releases/qemu/qemu-0.14.1.tar.gz

tar zxvf ./qemu-0.14.1.tar.gz
cd qemu-0.14.1/

c)  Patch Qemu source for UDP tunnels and multicast

Download patch and copy it to Qemu source.

http://www.4shared.com/file/STdSHGb4/0018-qemu-0141-mcast-udp.html

cp /home/brezular/Download/0018-qemu-0.14.1-mcast-udp.patch /home/brezular/Download/GNS3-files/Qemu/qemu-0.14.1

Patch Qemu source.

patch -p1 -i 0018-qemu-0.14.1-mcast-udp.patch

You should see output like this:

patching file block/raw-win32.c
patching file hw/e1000.c
patching file Makefile.objs
patching file net/udp.c
patching file net/udp.h
patching file net.c
patching file net.h
patching file qemu-options.hx

d)  Compile and install Qemu for x86 architecture

./configure --target-list=i386-softmmu
make
sudo make install

Qemu x86 binaries are now placed to /usr/local/bin/ directory. Check the version with command:

/usr/local/bin/qemu --version
QEMU emulator version 0.14.1, Copyright (c) 2003-2008 Fabrice Bellard

3. Installation Qemu from git


a)  Download the latest development tree  from git

git clone git://git.qemu.org/qemu.git

b)  Compile and install Qemu for sparc architecture

cd ./qemu
./configure --target-list=sparc-softmmu
make
sudo make install

Now, qemu-system-sparc binary is placed to /usr/local/bin/ directory. Check the version with command:

/usr/local/bin/qemu-system-sparc --version
QEMU emulator version 1.0.50, Copyright (c) 2003-2008 Fabrice Bellard

Note: If you cannot install Solaris 2.6 to Qemu disk running by Qemu downloaded from the master development branch, just install  Qemu version 1.0.50 version and try again.

4. BIOS Handling

The last step consists from copy particular BIOS image to /usr/local/share/qemu/ directory.

a)  BIOS for Sparc machine

As it is mentioned in this How-To, the default BIOS -  openbios-sparc32 – distributed with Qemu is not working well for Solaris.

http://tyom.blogspot.com/2009/12/solaris-under-qemu-how-to.html

We have to use the proprietary BIOS that you can download from here:

http://home.earthlink.net/~reif/

or alternatively from here:

http://www.4shared.com/file/6gJgTCQ6/ss10_v2.html
http://www.4shared.com/file/3DAMJAcy/ss10_v2_2.html
http://www.4shared.com/file/axFQXBJR/ss5-170.html
http://www.4shared.com/file/IglwTwUA/ss5.html
http://www.4shared.com/file/-7TR5cCC/ss10-20_v225r.html
http://www.4shared.com/file/05hZGv8d/ss20_v2.html

Qemu can emulate several types of Sparc machines (SS-5, SS-10 etc.) For each Sparc machine you have to use particular BIOS.  As I mentioned I had been able to install Solaris 2.6 to SS-5 machine only.

sudo cp /home/brezular/Download/ss5.bin /usr/local/share/qemu/
sudo cp /home/brezular/Download/ss5-170.bin /usr/local/share/qemu/
sudo cp /home/brezular/Download/ss20_v2.25_rom /usr/local/share/qemu/

b)  BIOS for JunOS

This step is only needed if you run Olive – JunOS installed on the top of FreeBSD with Qemu. Qemu version above 0.12.0 contains a bug in SeaBIOS which causes JunOS hangs up during boot. Simple workaround  is described here:

Here is a download link with working BIOS I compiled by myself.

http://www.4shared.com/file/BJw1Ik2x/bios.html

sudo cp /home/brezular/Download/bios.bin /usr/local/share/qemu/


About brezular
"True freedom is an inner thing. It is a state of mind. It is a deliberate exercise of choice. Thus, if we think we are bound by external forces, we are deceiving ourselves. It is our willing acquiescence to these outer demands that imprisons. Free yourself today. Take control of your thoughts."

14 Responses to Installation Solaris Sparc 2.6 (SunOS 5.6) on Qemu – Part1 Qemu Installation

  1. amir says:

    Excellent

    but , this guide also works for Windows version of qemu ?

    how to patch qemu on windows ?

  2. gov says:

    have you tried the iou2net.pl script in sparc qemu? im trying to atleast use the ‘much improved’ switching feature in “new” iou, use 4 switches, then interface it in gns3 maybe via udp and use the routers there. bunch of missing libraries and net modules in perl..

    • brezular says:

      So far I haven’t tried it but it is on my TODO list ;-) Sure, that’s not easy job to get iou2net.pl ruuning on 2.6. If I have any update I’ll post it as How-to. Good luck!

  3. Pingback: Installation Solaris 2.6 Sparc on Qemu – Part2 Solaris Installation « Brezular's Technical Blog

  4. atar says:

    >Unfortunately I managed to install Solaris into SS-5 only so we are restricted to maximum 256 MB RAM

    SS-20 should be no problem either. Then you would have 512 MiB.

    • brezular says:

      yes, I know but I wasn’t successful with SS-20. Anyway, thanks for your blog, it helped me a lot.

      • atar says:

        I guess mostly not for the blog, but rather for the actual contributions to qemu which made it possible ;-) .

        Does SS-20 fail early or late? Using SS-20 is a bit more tricky than SS-5, because you would need to switch off scanning for missing devices and do a reset before booting the OS. Are 256 MiB too few for your use case?

        For my use case it even was too much, so, I had to implement booting with 32 MiB, afair. The SunOS 4.something didn’t like too much memory. :)

      • brezular says:

        Yes, I did it before booting.
        ok setenv sbus-probe-list f
        ok reset

        I tried to boot in both single and multi user mode but the display freezes here:

        ok boot disk2:d -vs
        Boot device: /iommu/sbus/espdma@f,400000/esp@f,800000/sd@2,0:d File and args: -vs
        Size: 243560+176918+41926 Bytes
        SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0]
        Copyright (c) 1983-1997, Sun Microsystems, Inc.
        Using default device instance data

  5. Pingback: Installation Solaris Sparc 2.6 (SunOS 5.6) on Qemu – Part3 iou2net.pl Installation « Brezular's Technical Blog

  6. r2d2 says:

    im doing some test with netbsd and -m 2048 of memory but i need some library’s from solaris to continue pls if you can share those lib`s i will apreciate.

    SUNWcsu
    usr/lib/ld.so.1
    SUNWcsl
    usr/lib/libdl.so.1
    usr/lib/libnsl.so.1
    usr/lib/libc.so.1
    usr/lib/libmp.so.2
    usr/lib/libsocket.so.1

  7. Pingback: 折腾Qemu版IOU的相关资源下载 | Xrong

  8. Imran says:

    I am following the steps described in the document, but i am getting the following error.. while Patch Qemu source for UDP tunnels and multicast
    [imran@localhost qemu-0.14.1]$ cp /home/imran/Downloads/0018-qemu-0.14.1-mcast-udp.patch /home/imran/Downloads/GNS3-files/Qemu/qemu-0.14.1
    cp: cannot create regular file `/home/imran/Downloads/GNS3-files/Qemu/qemu-0.14.1′: No such file or directory
    [imran@localhost qemu-0.14.1]$

    [imran@localhost qemu-0.14.1]$ patch -p1 -i 0018-qemu-0.14.1-mcast-udp.patch
    bash: patch: command not found…
    Install package ‘patch’ to provide command ‘patch’? [N/y]
    * Waiting in queue..
    * Running..
    * Resolving dependencies..
    * Waiting for authentication..
    * Running..
    * Resolving dependencies..
    * Downloading packages..
    * Testing changes..
    * Installing packages..
    * Scanning applications..
    patch: **** Can’t open patch file 0018-qemu-0.14.1-mcast-udp.patch : No such file or directory

    Brezular help me on this..

    • brezular says:

      It seems that you are trying to copy patch to non-existing directory.
      Are you sure that all directories in path /home/imran/Downloads/GNS3-files/Qemu/qemu-0.14.1 exist?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 33 other followers