Sunday, December 13, 2009

Solaris/sparc under qemu how-to

This document attempts to answer basic questions on how to set up qemu-system-sparc so that it can boot Solaris. The current version of this how-to is available under http://tyom.blogspot.com/2009/12/solaris-under-qemu-how-to.html. The emulation of sparc system is still being improved, so this document will probably be frequently updated.

Disclaimer

Reading, understanding and using the Howto is by no means a guarantee for successfully finishing the task, and any mechanical failure, accident, psychological trauma or other cataclysm that may result from using the Howto is entirely your own responsibility and liability.

List of supported Solaris versions

Currently the versions 1.1.2 (SunOS 4.1.4), 2.2 (SunOS 5.2), 2.3 (SunOS 5.3), 2.4 (SunOS 5.4), 2.5.1 (SunOS 5.5.1), 2.6 (SunOS 5.6) are supported (they produce some error messages, but do not trap on boot). The versions 7 (SunOS 5.7), 8 (SunOS 5.8) and 9 (SunOS 5.9) can be boot in a minimal mode only (more or less similar to loading Linux with a "init=/bin/sh" boot option).

Kernel debugger (kadb) can be loaded for the versions 1.1.2 (from a HDD image) and 2.2 - 9 (from a HDD image or an install CD/DVD).

Solaris 10 and OpenSolaris do not support 32 bit sparc platforms, so they can never be booted under qemu-system-sparc. (Some day they maybe will be booted under qemu-system-sparc64 though).
The versions prior 1.1.1 and 2.0-2.1 do not support SPARCstation-5 or SPARCstation-20, so they can not be booted. The version 2.2 can be booted in the SPARCstation-20 emulation mode only (the exact steps are not yet described in this howto).

The version 1.1.1 is not yet tested. Reports or/and boot disks are welcome.

List of supported Firmware versions

Unfortunately OpenBIOS doesn't support booting Solaris. The proprietary OpenBoot PROM (OBP) is currently necessary. The SPARCstation-5 OBP versions 2.15 and 2.29 are known to work. The SPARCstation-20 revisions 2.15, 2.22 and 2.25 work only for some guest CPU models. If you have tested other OBP versions please let me know.

Compiling qemu-system-sparc

The qemu version 0.13+ is capable of booting Solaris. Nevertheless some bugfixes or features are only included in the "bleeding edge", a.k.a git master. Compiling master is straightforward:

git clone git://git.qemu.org/qemu.git
cd qemu
./configure --target-list=sparc-softmmu
make

Launching qemu with OBP to boot from a cdrom image

Solaris 2.6 and above:

sparc-softmmu/qemu-system-sparc -M SS-5  -bios /path/to/ss5.bin -nographic -cdrom Solaris2.6.iso

Solaris 2.5.1 and earlier:

sparc-softmmu/qemu-system-sparc -M SS-5 -startdate "2009-12-13" -bios /path/to/ss5.bin -nographic -hdb Solaris2.5.1.iso

The option -startdate "2009-12-13" is necessary for the older Solaris 2.x versions, which have the y2010 bug. It's not necessary for Solaris 1.x (SunOS 4.x).
The option -nographic is important for OBP, as the emulated graphic card is not supported. Successfully initialized OBP should print lines like this:

SPARCstation 5, No Keyboard
...
Type help for more information
ok

booting Solaris in a single user mode from a CD-ROM
at the ok prompt:

Solaris 2.6+:

boot disk2:d -vs

Solaris 2.5.1-:

boot disk1:d -vs

booting Solaris 7, 8, 9 in a minimal mode from a CD-ROM


boot disk2:d -vb

booting Solaris kernel debugger from a CD-ROM
at the ok prompt:

Solaris 2.6+:

boot disk2:d kadb -kdv
Solaris 2.5.1-:

boot disk1:d kadb -kdv
If you are going to debug the kernel, I recommend you to read the PANIC! UNIX System Crash Dump Analysis Handbook. The kernel debugger is a really powerful tool and the book helped me a lot to learn how to use it and shed a lot of light on Solaris internals.

booting Solaris from a HDD image
To be able to boot from a hdd image, add the following line to the /etc/system on the hard drive:
set scsi_options=0x58

Normally during the Solaris installation process the hard drive is mounted under /a, so it can be done with
# cat >> /a/etc/system
set scsi_options=0x58
^d
right after the installation. Hence it's recommended to switch off the automatic reboot  option when the installer asks for it.

If the steps above are not performed, the HDD boot fails with the error message:
cannot mount root on /iommu@0, 10000000/sbus@0, 10001000/espdma@5, 8400000/esp@5, 8800000/sd@0,0

Comments & reports are welcome. Here and at the qemu-devel mailing list.

Last updated on 01.12.2011.

/Happy hacking

298 comments:

«Oldest   ‹Older   201 – 298 of 298
Nigel Horne said...

Any clues what I have to tell it to boot? I tried all sorts of things before I posted here e.g. 'boot cdrom; boot cdrom1'

atar said...

Nigel, please read the how-to.
1. Solaris 10 doesn't support 32 bit SPARC machines.
2. boot command is
boot disk2:d

Nigel Horne said...

As noted, I tried all boot options before posting here. For example:

ok boot disk2:d
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@2,0:d File and args:

Can't find /openprom/client-services
ok

atar said...

But it's still a Solaris 10 media, right?

Anonymous said...

hello my friend
I will install minimal solaris 7 under qemu 0.14.1 on windows XP
and run very good (run level 3)
I have solaris7.disk qemu image now under SS5 prom.
I install with iso cdrom (boot disk2:d) and install it very well
of course i have more error but I solve it after install it.
I can share image disk if you want

Nigel Horne said...

I would like an ISO of Solaris 7 for Sparc, could you please share it? Thanks!

bitje said...

SPARCstation 5 will not boot solaris 10. You will need sparc64 to emulate the IIi.

nyet said...

Got 2.6 installed and running with latest git tree.. Boots fine in single user mode, but I had to disable S74syslogd

If I don't it just hangs at "syslog service starting".

Eventually, it spits out

Assertion failed: MUTEX_HELD(&svc_mutex), file rpc/svc_run.c, line 754

But thats it. Hung dead.

Also, occasionally I get

signal fault in critical section
signal number: 11, signal code: 1, fault address: 0xef75006c, pc: 0xef7d5cf0, sp: 0xeffff4f8
libthread panic: fault in libthread critical section (PID: 144 LWP 1)
stacktrace:
ef689908
ef691d3c
ef7d5ce4
ef7d70ac
ef7d471c
ef7d51a8
ef7d3d6c
ef7dbf88
ef7dbbc4
ef7dbcc0
ef7dbe24
21f78
1468c
1440c
0


and

Run-time error, libC:
Trying to release a lock that was not acquired in this thread
Abort - core dumped

Anonymous said...

has there been any progress on booting Solaris10 (now that qemu version 0.15 is available) ?

thanks.

atar said...

No. I currently don't have the time to merge my code upstream. Maybe for Christmas 2013...

Anonymous said...

:(
shame, 64bit and Sol10 would be really cool.

btw, how do you change the disc in cdrom?
(Ctrl-Alt-2 does not work)

Anonymous said...

I did a complete install of Solaris 9, but when booting from hard drive image, it hangs with this error:
"Starting Web Start Launcher in Command Line Mode."
?

atar said...

The official qemu version can boot Solaris 2.3+ in Single-User mode only (as written in the how-to).

atar said...

shame, 64bit and Sol10 would be really cool.

Well, since Solaris is not open anymore, giving anything for free here is not a good marketing. Free OS - free tools to run it. Commercial OS - commercial tools to run it.

btw, how do you change the disc in cdrom?(Ctrl-Alt-2 does not work)

Start qemu monitor on another port and telnet to it.

Anonymous said...

ok, at least 32bit works quite nice.
thanks atar for everything.
I solved the 'web start' problem by disabling this service from maintenance mode:

rc2.d/S96webstart

Anonymous said...

hi. is it possible today to boot solaris 10 for sprac 64 platform under qemu?

atar said...

You'll have to either modify qemu to add some missing devices, or modify Solaris 10 making it not to look for them.

Why would you need emulating Sparc Solaris 10 anyway?

Anonymous said...

we work on a multi-platform software development and it would be useful to test also over solaris sparc 64 bit OS without the need of the expensive sun sparc hardware.

Guus said...

nyet,
I also had syslogd problems with Solaris 2.6. These problems disappeared after installing 2.6_Recommended.tar.Z from ftp.lanet.lv/pub/sun-info/sun-patches/.
I reckon that 106439-13 is the actual fix but I didn't test that.
The patches may be useful for nfs and libthread (105568-26) problems as well.
You might have a problem getting the patches on the diskimage. I did that by mounting the Solaris disk on a NetBSD/Sparc qemu but I think it should be possible using the network as well.

Thayne said...

I'm trying to boot an iso for solaris 6 in qemu.

I found that using ss5.bin yields this error: qemu: could not load prom 'ss5.bin'

So I found another bios file and gave it a try like this:

qemu-system-sparc -boot d -cdrom sol6_installcd.iso -hda sparcSol2_6.qemu.img -M SS-5 -m 256 -bios openbios-sparc32 -nographic

When I do, I get this:

Configuration device id QEMU version 1 machine id 32
CPUs: 1 x FMI,MB86904
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.0 built on Sep 28 2011 20:47
Type 'help' for detailed information
Trying cdrom:d...
Not a bootable ELF image
Not a bootable a.out image
No valid state has been set by load or init-program

0 > boot disk2:d -vbs No valid state has been set by load or init-program
ok
0 >

I know this is a valid boot disk since I copied it straight from the install CD like this:
dd if=/dev/cdrom of=sol6_installcd.iso

Could this be a bios problem?

atar said...

Yes. ss5.bin is the original Sun OBP which is more stable than OpenBIOS. The answer you are looking for is in the paragraph "List of supported Firmware versions" of the how-to.

If you prefer using OpenBIOS, you can try to give the following command for booting:

boot cdrom:d -vbs

and report the progress to openbios@openbios.org

AdrianR said...

Hi - is the information here still current? Trying to boot a SPARC box with qemu in Amazon EC2. I have RedHat 5.7 64 bit, use the command:

qemu-system-sparc -M SS-5 -bios ./ss5.bin -nographic

just to see what happens, seems to start OK but gets as far as "Starting real time clock..." and hangs.

Using pre-built qemu rpm, qemu-0.14.1-2.el5.rfx.x86_64.rpm

Thanks,

atar said...

AdrianR, have you tried to wait longer? EC2 is a virtual environment itself, there might be some issues with the timer/precision emulation. Can you post the complete boot log?

Also can you try passing the
-startdate "2009-12-13"
option?

AdrianR said...

OK, well interestingly today I tried the same command and got a lot further, without any waiting - to the "Keyboard not present. Using tty for input and output", so that's good.

On the other hand, I read your how-to more carefully and now I think that what I want is not possible. I need to host Solaris 10 and you say "
Solaris 10 and OpenSolaris do not support 32 bit sparc platforms, so they can never be booted under qemu-system-sparc. (Some day they maybe will be booted under qemu-system-sparc64 though)."

So to check I have understood - Solaris 10 is now 64 bit, and will not work with qemu - true?

Brent said...

I have a complete Solaris 9 setup installed and running under qemu-1.0. The OpenBios included with qemu-1.0 worked fine, no need for a Sun OBP image, but only with SS-5. SS-10 and SS-20 hang early on in the boot.

Has anyone been able to get Solaris running under qemu as a SS-10 or SS-20? I can live with being single-processor, but it would be nice to run with more RAM than 256MB...

atar said...

Brent, does SS-20 hang in early boot under OBP? It used to work fine, I don't remember whether I needed to apply the Framebuffer patch from Bob Breuer though.

Also I think that 256m limit with SS-5/OpenBIOS is purely artificial, so you have a choice.

Anonymous said...

Where does 'Solaris2.6.iso' come from?
I have the CDs. Is it created from them? How?
I'm running RHEL 6 on x86_64.

Thank you

egleites

atar said...

Just as usual, something like

dd if=/dev/cdrom of=my_sol_image.iso

Thayne said...

I was able to install and run a Solaris 6 image from iso.
Now I'm trying to install and run a Solaris 8 image from iso.
When I booted from the install cd, it said "Copying mini-root to local disk." Then rebooted.
After reboot, I get some errors saying it cannot mount root.

I went back in and changed the /etc/system to set the scsi_options

Then tried:
boot disk0 -vb
I also tried:
boot disk0 -vs
and both give the same error.

I see in some of the posts that others have had success with Solaris 8 & 9. Is there a trick here that I'm missing?


Copying platform specific files....done.

Preparing to reboot and continue installation.
Rebooting to continue the installation.
Syncing file systems... 41 done
rebooting...
Resetting ...

So now there's this mini-root installed to my disk.

atar said...

Thayne, how did you edit the /etc/system? Are you sure you've edited the target one?
I don't remember anything special with installing Solaris 8 compared to 2.6

Thayne said...

To edit /etc/system, I booted in single user mode from the iso, mounted the disk to /a via: "mount /dev/dsk/c0t0d0s2 /a" and then used vi to edit /a/etc/system. Then I rebooted off the disk.
Note that I tried booting with and without the change to /etc/system, but I get the same result either way.

Thayne said...

By the way, here's the output with the error:
ok boot disk0
Boot device: iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args:
Size: 264120+54502+47926 Bytes
SunOS Release 5.8 Version Generic_108528-29 32-bit
Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved.
Ethernet address = 52:54:0:12:34:56
Using default device instance data
vac: enabled in write through mode
mem = 262144K (0x10000000)
avail mem = 258363392
root nexus = SUNW,SPARCstation-5
iommu0 at root: obio 0x10000000
sbus0 at iommu0: obio 0x10001000
dma0 at sbus0: SBus slot 5 0x8400000
dma0 is /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000 /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000 (esp0): esp-options=0x46
esp0 at dma0: SBus slot 5 0x8800000 sparc ipl 4
esp0 is /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000
Cannot assemble drivers for root /iommu@0,10001000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:a
Cannot mount root on /iommu@0,10001000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:a fstype ufs

panic[cpu0]/thread=f0244020: vfs_mount_root: cannot mount root

f0243ac0 genunix:vfs_mountroot+68 (f0261800, 44000e1, 0, 44000e1, 8, 0)
%10-7: f0261800 f02644a8 00000000 00000000 00000000 f024beac f028b000 f024f400
f0243b20 genunux:main+8c (1, 4400fe0 2000, 44000e0, 81c52000, f005b8f4)
%10-7 f5901000 f0243b88 00101684 043d1f01 043d1f03 00000004 ffef0000 00000e00

atar said...

Strange. It definitely looks like a /etc/system problem. Probably, your Solaris 8 is using /etc/system from a ram-disk packed into the miniroot image. In this case, you'll have to modify the ram-disk image.

There is one more thing you can try with Solaris 8. I haven't tested it, but some versions of Solaris 8 are reported to work with OpenBIOS.

You can try using OpenBIOS (by not providing the -bios command line option if you have the current qemu version), and boot with

boot disk0:a

Bytec said...

Hello,
has anyone managed to run a solaris 8 sparc run with more than 1 CPU or more than 256 MB granted to the machine?

It seems only the Machines SS-10, SS-20 and SS-600MP seem to support these settings with qemu,
but when I try, the machine just hangs in there shortly after identifying the MAC adress.
I've used a qemu 0.15 and compiled it in the way Artyom decribed above, but only the standard settings worked for me, which resulted in a ca.107-Mhz single-core and 256 MB RAM machine.

Any ideas?

atar said...

More than 1 cpu makes less sense, at least for performance. Currently qemu can utilize only one host cpu regardless of the number of the guest cpus. I.e. if you have guest two cpus, they will both work at a half speed.

107Mhz - that's strange. How do you measure this and what is your host? On a 2.66GHz Intel cpu, Solaris tells that it sees a 1Ghz SS-5.

Bytec said...

Sorry, 170 Mhz, that was a typo.
Solaris returns

# psrinfo -v
Status of processor 0 as of: 01/13/12 16:46:07
Processor has been on-line since 01/13/12 16:45:20.
The sparc processor operates at 170 MHz,
and has a sparc floating point processor.




I started like


sparc-softmmu/qemu-system-sparc -hda /path/to/disk -nographic -net tap,vlan=0 -net nic,vlan=0 -monitor tcp:127.0.0.1:2704,server,nowait -cdrom /path/to/iso




On my host system:
cat /proc/cpuinfo |egrep "processor|model\ name|MHz"
processor : 0
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 1
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 2
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 3
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 4
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 5
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 6
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226
processor : 7
model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
cpu MHz : 2400.226


One cpu on solaris would be OK, if it operated accordingly.

qemu-system-sparc -version
QEMU emulator version 1.0.50

atar said...

AFAIK, psrinfo just reads the corresponding bits from OBP/CPU. It's not a benchmark.

Tom said...

I have the same problem with booting Solaris after successful CD installation. Of course I added scsi option in /etc/system file but it didn't help.

ok boot disk0
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args:
SunOS Release 5.9 Version Generic_112233-07 32-bit
Copyright 1983-2003 Sun Microsystems, Inc. All rights reserved.
Use is subject to license terms.
Cannot mount root on /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0:a fstype ufs

panic[cpu0]/thread=f0244020: vfs_mountroot: cannot mount root

f0243ac0 genunix:vfs_mountroot+68 (44000e3, 44000e3, 0, 44000e3, f027f934, f0247c00)
%l0-7: f0277400 f0277400 f02ab2b0 f02a9170 f02a7c00 f024c05c f0277800 f027a000
f0243b20 genunix:main+98 (4400fe0, 4400fe0, 293ff49f, 44000e0, 81c52000, f005bc84)
%l0-7: 00000001 00000000 f02a65dc 00000000 00002000 f026ac00 f0260304 f0091894

skipping system dump - no dump device configured
rebooting...
Resetting ...




Tested installation of Solaris 8 and Solaris 9 with the same result.

The only Solaris version which I can run from disk file is 2.4 (http://vpsland.superglobalmegacorp.com/install/qemu/solaris24minimal.disk.gz), but in this version network is not working :(

Qemu with OpenBIOS (up to 1047) boots only from CDROM, when I try boot from disk I get:


Configuration device id QEMU version 1 machine id 32
CPUs: 1 x FMI,MB86904
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.0 built on Jan 8 2012 13:45
Type 'help' for detailed information

0 > boot disk0:a Not a bootable ELF image
Loading a.out image...
Loaded 7483136 bytes
entry point is 0x4000
bootpath: /iommu/sbus/espdma/esp/sd@0,0:a

Jumping to entry point 00004000 for type 00000005...
switching to new context:
(is ?
Unhandled Exception 0x00000007
PC = 0xffd073a4 NPC = 0xffd073a8
Stopping execution


Does someone have a working Solaris 8 or 9 disk file image?

Regards.
Tom.

atar said...

Tom, I guess under OpenBIOS it has to be "disk", not disk0:

boot disk:a

Bytec said...

Ok, it's because I'd like to make the server perform faster as I need
a replacement for a solaris machine and at the moment it's far to slow.
Is there a way to make qemu operate with either of -M "SS-10" / "SS-600MP" / "SS-20" ? As mentioned, those are the only ones that seem to support RAM > 256 MB, but they fail to start. I tried different "-cpu"-settings as well, no luck with those either...

atar said...

Yes, both SS-10 and SS-20 work fine with the corresponding proms.

Tom said...

Atar:

I used "boot disk" or "boot disk:a" - the same problem...


0 > boot disk:a Not a bootable ELF image
Loading a.out image...
Loaded 7483136 bytes
entry point is 0x4000
bootpath: /iommu/sbus/espdma/esp/sd@0,0:a

Jumping to entry point 00004000 for type 00000005...
switching to new context:
(is ?
Unhandled Exception 0x00000007
PC = 0xffd073a4 NPC = 0xffd073a8
Stopping execution

atar said...

Tom, and your disk with miniroot is plugged as hda, right?

Then, the only option I see is editing the ram-fs image.

Tom said...

Tom, and your disk with miniroot is plugged as hda, right?

Yes

Then, the only option I see is editing the ram-fs image.


Where is located ram-fs image and which tool must I use to edit and repack image?

Bytec said...

Hello Atar,

thanks, you really helped me a lot. I wasn't aware that certain machines would not start without a 'cpu'-Option. I started like this now:

sparc-softmmu/qemu-system-sparc -hda /path/to/img -nographic -net tap,vlan=0 -net nic,vlan=0 -monitor tcp:127.0.0.1:2704,server,nowait -M SS-20 -bios /path/to/bios/ss20_v2.25_rom -startdate "2009-09-05" -m 512 -boot c -smp 2 -cpu "TI SuperSparc 40" -cdrom /path/to/iso

After

boot disk2:d -v

I was able to start and install Solaris.

Unfortunatly, rebooting and starting
with

boot disk0:d -v

resulted in the "good Wrong packet length"-error
here and solaris will not come up.

Any idea what I'm doing wrong?

First I thought it is because of the
"booting Solaris from a HDD image" which
I left out unintentionally, but the error is quite different...

atar said...

Tom, it's not qemu specific. You can try searching though Solaris forums.

atar said...

Bytec, how exactly does it fail? Have you tried to boot from the CD?

SS-20 uses a slightly different disk numeration as SS-5, so booting from a SS-5 disk image won't directly work.

Bytec said...

Hi,

I tried to boot from HDD after Installation. Anyway, I just noticed that the qemu seemed to have rebooted without be noticing it:

Cannot assemble drivers for root /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@0,0:a
Cannot mount root on /iommu@f,e0000000/sbus@f,e0001000/espdma@f,400000/esp@f,800000/sd@0,0:a fstype ufs

panic[cpu0]/thread=f0244020: vfs_mountroot: cannot mount root
(...)
skipping system dump - no dump device configured
rebooting...
Resetting ...


Followed by many pages of booting messages. After reboot he fails with

Rebooting with command:
Boot device: /iommu/sbus/ledma@f,400010/le@f,c00000 File and args:
Internal loopback test -- Wrong packet length; expected 36, observed 64

So the problem is in /etc/system, as you said in you blog. Do you know whether I have to reinstall or can this be fixed differently?

Thayne said...

I figured out a workaround to my problem with the Solaris 8 install. I was poking around in some solaris 8 install procedures and noticed that from a tty terminal it is recommended to use the "Solaris 8 Software" CDs 1 and 2 instead of the "Solaris 8 Installation" CD.
So I tried using the "Software" CDs and it worked fine. I never ended up installing the packages from disk 2 though but it is running stable.
Tom,
If you have the disks labeled "Solaris 8 Software", give those a try - you can thus avoid headaches dealing with the mini root thing.

atar said...

Bytec, yes, you just need to boot into the single user mode from CD, mount your hdd under /a and add the line to /a/etc/system .

Tom said...

from a tty terminal it is recommended to use the "Solaris 8 Software" CDs 1 and 2 instead of the "Solaris 8 Installation" CD.

Yes! It works!!!
Thank you Thayne!

That is the solution for solaris installation, no more resetting during installation and no kernel panics!

I was able to install Solaris 7 and Solaris 8 in that way.

My next problem is network. I used "-net nic,vlan=0 -net user,vlan=0" options but it does not work (the same in Solaris 2.4, 7 and 8). The qemu is started with root permissions, host address is 172.16.172.121 and Solaris uses 172.16.172.129. I cannot ping any outside host (e.g. gateway 172.16.172.1) from Solaris.

atar said...

Pinging outside hosts won't work, as the user-mode networking in qemu doesn't implement this feature. Pinging gateway should work though. Your ip address is strange. By default the guest ip is 10.0.2.15 and the gateway for the guest is 10.0.2.2. Can you try this?

Tom said...

Thanks atar!

It's my fault, RTFM :). I changed an IP adress to 10.0.2.15 and gateway's to 10.0.2.2 and can do ftp to host machine.
Is there a simple way to publish some guest services (e.g. SMTP, TELNET) to be accessable from outside?

atar said...

Easy for telnet. Take a look at the redir option documentation. Also I wrote a post about ssh tunneling some time ago.

Bytec said...

Ok, that worked, thanks!
Now I'm able to start Solaris with 512 MB, more tests to follow (although I had to restart 3 times because the installer dumped core).

It seems Openbios itself does not support booting these machines by default and the '-bios' is needed explicitly: every combination I tried without "-bios" failed on me by "hanging" the qemu.
Is there a list which combinations ought to work?

Dimi said...

Hi,
Now what to do from that step ? how can I tell it to boot something ? I mean the solaris image ... ? I'm a linux newbie, so, please take it slow with me ! thank you ! Dimi.

Dimi said...

Hi,
Managed to install - the menus appeared with language and stuff - but when it comes to label I get this error :

arning: error reading backup label.
WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@0,0 (sd0):
Error for Command: read(10) Error Level: Fatal
Requested Block: 0 Error Block: 0
Vendor: QEMU Serial Number:
Sense Key: Illegal Request
ASC: 0x21 (logical block address out of range), ASCQ: 0x0, FRU: 0x0
Illegal request during read: block 0 (0x0) (0/0/0)
ASC: 0x21 ASCQ: 0x0
Warning: error reading backup label.
Warning: no backup labels
Label failed

What to do next ?
Thanks,
Dimi.

Dimi said...

hi,

I ended up here :

One or more disks are found, but one of the
following problems exists:

> Hardware failure

> Unformatted disk.

But I have previously formatted disk0.

How can I deal with this ?
Thanks.

atar said...

How did you produce and format the image? What Solaris version are you using?

joy said...

great blog man!
im wondering if you could also share the ss20_v2.22.3.bin boot rom? like the one you used on this?

i can't get the 2.25/2.25r revisions to work on all the cpu models. i mean, i can boot in single-user mode, then install from cdrom. but then when i reboot it to finally boot from hd, qemu hangs..

i'll do the test in a sec, and then post the output here. :)

joy said...

here's my output:

./qemu-system-sparc -m 512 -hda sparc.disk -cdrom sparc.iso -bios ./ss20_v2.25_rom -net nic,vlan=1,macaddr=00:aa:00:00:aa:aa -net tap,vlan=1,ifname=tap1 -nographic -M SS-20 -cpu "TI SuperSparc 50" -boot c


ttya initialized
Cpu #0 TI,TMS390Z50
Cpu #1 Nothing there
Cpu #2 Nothing there
Cpu #3 Nothing there
Probing Memory Bank #0 64 Megabytes of DRAM
Probing Memory Bank #1 64 Megabytes of DRAM
Probing Memory Bank #2 64 Megabytes of DRAM
Probing Memory Bank #3 64 Megabytes of DRAM
Probing Memory Bank #4 64 Megabytes of DRAM
Probing Memory Bank #5 64 Megabytes of DRAM
Probing Memory Bank #6 64 Megabytes of DRAM
Probing Memory Bank #7 64 Megabytes of DRAM
Incorrect configuration checksum;
Setting NVRAM parameters to default values.
Setting diag-switch? NVRAM parameter to true
Probing /iommu@f,e0000000/sbus@f,e0001000 at f,0 espdma esp sd st ledma le SUNW,bpp
Probing /iommu@f,e0000000/sbus@f,e0001000 at e,0
Probing /iommu@f,e0000000/sbus@f,e0001000 at 0,0 Nothing there
Probing /iommu@f,e0000000/sbus@f,e0001000 at 1,0 Nothing there
Probing /iommu@f,e0000000/sbus@f,e0001000 at 2,0 Nothing there
Probing /iommu@f,e0000000/sbus@f,e0001000 at 3,0 Nothing there
screen not found.
Can't open input device.
Keyboard not present. Using tty for input and output.


SPARCstation 20 (1 X 390Z50), No Keyboard
ROM Rev. 2.25, 512 MB memory installed, Serial #0.
Ethernet address 0:aa:0:0:aa:aa, Host ID: 72000000.


Power-On SelfTest FAILED ... Replace MBUS0 Module

Type help for more information
ok boot disk0:
Boot device: /iommu/sbus/espdma@f,400000/esp@f,800000/sd@0,0: File and args:
SunOS Release 5.6 Version Generic_105181-05 [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1997, Sun Microsystems, Inc.
configuring network interfaces:qemu: fatal: Trap 0x29 while interrupts disabled, Error state
pc: f0041284 npc: f0041284
General Registers:
%g0-7: 00000000 f025d170 40401fc2 f597e3db 00000004 fbfaeb80 00000001 f59685a0

Current Register Window:
%o0-7: ffff8000 00008000 00000f00 404010c1 f5c7b508 ffee2000 fbe1e4b8 f0041c58
%l0-7: 40801fc1 f0041cec f0041cf0 00000002 0000010f 00000002 00000007 fbe1df78
%i0-7: ffff8000 00008000 00000f00 404010c2 f5d33d70 ffee2000 fbe1e020 f0041c58

Floating Point Registers:
%f00: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff
%f08: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff
%f16: ffffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffff
%f24: ffffffffffffffff ffffffffffffffff ffffffffffffffff 0000000000000000
psr: 40001fc1 (icc: ---- SPE: SP-) wim: 00000002
fsr: 00000000 y: 01c00000
Aborted


./qemu-system-sparc -version
QEMU emulator version 1.0, Copyright (c) 2003-2008 Fabrice Bellard


i've tried most of the guest cpu models but same output.
SS-5 is working fine though.

atar said...

Joy, just do the steps described in the post. As you already read there are two types of boot screen messages. Bad are marked red, and good are marked green.

atar said...

"Power-On SelfTest FAILED ... Replace MBUS0 Module" is bad.

Tom said...

Hi again!

I'm looking for a method to shutdown cleanly a guest machine (Solaris8). I tried to enter "system_powerdown" command via monitor, but Solaris ignores this signal (powerd daemon is running).
Is there a safe way to shutdown a guest?

atar said...

poweroff
(as root)

Tom said...

BTW better is "init 5", but I'd like to run qemu as a service via script with start|stop arguments. Starting is easy, qemu even saves pid in the file, but stoppping is problematic. I don't like to login as a root to guest system (security issue) and enter poweroff command. The best would be to send some signal (i.e. powerfail) to qemu which should forward it to guest system to perform a gracefull shutdown.

Tom said...

Ok. I have already managed with gracefull shutdown.
Another question: Is there a way to lower the CPU usage of quemu process? It always uses over 100% of CPU

atar said...

@Tom,

how did you implement the graceful shutdown? And btw, why "init 5" is better than "poweroff"? The shutdown process looks the same to me.

Reducing CPU consumption is tricky: SPARC v8 doesn't have a "halt" instruction which is used to stop an Intel CPU when it's not used.

I could find no documentation how CPU power management is implemented in sun4m world. If you find the documentation, we can take a look whether it can be implemented in qemu.

Tom said...

"poweroff" command just sends TERM signal to all proceses and then shutdowns the machine. When some process is not responding it simply kills it. "init 5" uses /etc/rcX.d/Kxx scripts to sequentionally stop services with them shutdown dependencies. It takes more time to shutdown, but it's more safety.

My idea for stopping qemu process is easy:

1. Run qemu with two serials "-serial telnet::6666,server,nowait -serial unix:/var/run/qemu.socket,server,nowait"
2. First serial (console - /dev/term/a) is used for guest machine management (via telnet), the second serial (/dev/term/b) is used for controlling the start/shutdown of guest.
3. Write a simple bash script:

#!/bin/bash

exec &>/dev/term/b
while read line; do
[ "$line" = "STATUS" ] && echo "OK"
[ "$line" = "STOP" ] && init 5 && break

done < /dev/term/b


Copy it to /root/bin/sysctrl.sh file on guest machine and add this line to /etc/inittab:
c2:234:once:/root/bin/sysctrl.sh

4. Now the solaris can be simply controlled via /var/run/qemu.socket. In linux I use the "socat" tool to send/receive commands via socket to guest system:
echo "STATUS"|socat STDIO UNIX-CONNECT:/var/run/qemu.socat,rcvtimeo=2,sndtimeo=2 - to check if system is ready.
echo "STOP"|socat STDIO UNIX-CONNECT:/var/run/qemu.socat,rcvtimeo=2,sndtimeo=2 - to init gracefull shutdown.

5. Qemu start script (/etc/init.d/qemu.sh) uses socat to control starting and stopping of Solaris.

Anonymous said...

I'm new to qemu so please forgive me if I am asking the obvious. I'm trying to run Solaris 10 on sparc 64 under qemu 1.0.
Should this be working? What am I doing wrong? Any help?

qemu-system-sparc64 -nographic -cdrom sol-10-u10-ga2-sparc-dvd.iso -prom-env 'auto-boot?=false'

OpenBIOS for Sparc64
Configuration device id QEMU version 1 machine id 0
kernel cmdline
CPUs: 1 x SUNW,UltraSPARC-IIi
UUID: 00000000-0000-0000-0000-000000000000
Welcome to OpenBIOS v1.0 built on Sep 28 2011 20:48
Type 'help' for detailed information

0 > boot cdrom:d -v Not a Linux kernel image
Not a bootable ELF image
Not a bootable a.out image

Loading FCode image...
Loaded 7420 bytes
entry point is 0x4000
Unhandled Exception 0x0000000000000030
PC = 0x00000000ffd19e88 NPC = 0x00000000ffd19e8c
Stopping execution

Philip Wittamore said...

Thank you for your hard work.
I have Sparc Solaris 2.5.1 running in Qemu 1.0.1 just fine for my purposes, which is generating flexlm licenses with old sparc binaries. One question, is there any way I can tell qemu to boot disk0 automatically instead of entering it manually each time? I presume it's because the nvram cannot be saved and reloaded from ss5.bin

atar said...

Thanks for sharing the experience!

The problem here is not ss5.bin (aka OBP, aka PROM) loading, but the nvram. Although QEMU uses the format derived from a later (I guess sun4v) version of OBP, it looks like it's not compatible with the other OBP versions. There are two possible solutions:

- the hard one: try to deduct which nvram format does ss5.bin use, and adjust qemu accordingly. It would allow control OBP NVRAM, just like it works now for OpenBIOS - via the -prom-env QEMU's command line parameter.

- the easy one: add ability for qemu to save/restore the NVRAM contents. I think there was a patch for this from Robert Reif a few years ago, which for some reason was not accepted into mainstream.

Michael De Armon said...

Hello. I'm not a super techie. Kinda doing this out of need, rather than interest. I have an old sparc5 still running an apt program - and I show up and I'm like "We really need to upgrade to a new system". The prgrammers are like... "Well, it will take 5 years to convert all the code to a new code that will run on new stuff". I'm like $h!t...

So the machines are 25 years old and I'm thinking they may die any second....

I did all the steps here, save for booting form a CD, which I don't have.

I have a DD image of all the partitions from the sparc 5 machine (running Solaris 1.1.2 - or SunOS 4.1.4 - whichever you wanna call it).

I have qemu. I have the bios.

Now I just need to know how to boot from the dd img's I create. Or what my next steps would be.

I've already compiled the qemu to support sparc.

Any simple extra's I could do (or at least explained like as if to a dog or a cat) would be very much appreciated.

Thanks!

Mike D

atar said...

Michael, that's easy. You need the slice number 2 - which is the complete disk.

Assuming this is the disk #0, its dump under Solaris would be produced with something like
dd if=/dev/dsk/c0t0d0s2 of=disk0.img

And then you just plug the disk0.img into qemu:

qemu-system-sparc -nographic -drive if=scsi,unit=3,file=disk0.img

Then you can boot it under qemu with

ok boot disk

I still recomend to use the single user mode for the free qemu version, because it's not stable otherwise.

Basil said...

I am trying to install Solaris 2.5.1. I am able to bring it up into single user mode and then exit out of that to the install portion of the iso image (i.e. the cd).

My questions from here (maybe not even in the scope of this blog) are:

- I am given a choice of 13 system types to install to. The obvious options to me are 8=Sun Workstation, or 12=xterm. I am assuming xterm here but am unsure.

- Once the option is selected, I go through the system identification and it starts to install but quickly stops, saying it could not label disks. How do I work around this?

Basil said...

I am trying to install Solaris 2.5.1. I am able to bring it up into single user mode and then exit out of that to the install portion of the iso image (i.e. the cd).

My questions from here (maybe not even in the scope of this blog) are:

- I am given a choice of 13 system types to install to. The obvious options to me are 8=Sun Workstation, or 12=xterm. I am assuming xterm here but am unsure.

- Once the option is selected, I go through the system identification and it starts to install but quickly stops, saying it could not label disks. How do I work around this?

Basil said...

I believe my problem is that I was treating the cd iso as the hd (no critical thinking, just copy-paste from this tutorial).

I created a disk image:

qemu-img create -f raw tempSPARC.img 650M

Then I load qemu:

qemu-system-sparc -M SS-5 -startdate "2009-12-13" -bios ss5.bin -nographic -hdb tempSPARC.img -cdrom Solaris_251.iso

It then loads and I reach the "ok" prompt, where I tried:

boot disk2:d -vs

It then looks like its trying to boot from the cd image but, it gives "data transfer overrun" errors (there is a cryptic "corrupt label - wrong magic number" message in the beginning. It then reboots. What am I doing wrong?

atar said...

@Basil,

I believe my problem is that I was treating the cd iso as the hd (no critical thinking, just copy-paste from this tutorial).

No. The tutorial says that for the versions before 2.6 you have to use iso as hd for a good reason. The Solaris ISOs prior 2.6 used 512 bytes sectors. QEMU can not handle such CDs unless you modify the code (actually it's a trivial change of a few lines, but since the idea was not accepted in the mainstream, I never tried it).

What QEMU version are you using? Some released versions has bugs in the SCSI subsystem which may cause the behaviour you describe.

Also, Neozeed described how to format a Solaris disk here.

Basil said...

I am running Qemu 1.0.1.

I'm not getting much luck formatting a disk image (see my comments on the page you listed).

Per chance, if it is a trivial fix, where in code can I make it?

Basil said...

I was able to get a properly formatted disk image and the install went ok (so far as I am aware). I made the above changes to /etc/system (the correct information was already there) and /a/etc/system.

I then started qemu:

qemu-system-sparc -M SS-5 -m 256 -nographic -startdate "2009-12-13" -bios ss5.bin -hda solaris.disk

It looks like it is trying to boot into the device when the following message gets displayed:

Boot device: /iommu/sbus/ledma@5,8400010/le@5,8c00000 File and args:
Internal loopback test -- Wrong packet length; expected 36, observed 64

Can't open boot device

Type help for more information
ok

At this point, I run "boot disk0", where the following error message gets displayed:

Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args:
SunOS Release 5.5.1 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1996, Sun Microsystems, Inc.
WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000 (esp0):
undetermined selection failure
WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000 (esp0):
undetermined selection failure
WARNING: clock lost 1004 days -- CHECK AND RESET THE DATE!
Hostname: stfsun1
mount: /dev/dsk/c0t2d0s6 no such device
/sbin/swapadd: expr: not found
/sbin/swapadd: /usr/sbin/swap: not found

WARNING - /usr/sbin/fsck not found. Most likely the
mount of /usr failed or the /usr filesystem is badly
damaged. The system is being halted. Either reinstall
the system or boot with the -b option in an attempt
to recover.

syncing file systems... done
Program terminated
ok

I tried boot disk0 -b just to see what happens and it looks to hang after the "Copyright (c) 1983-1996, Sun Microsystems, Inc." line.

Has this been addressed above? It seems like the user VooDoo_UzH_ perhaps had a similar issue but I am not a Russian speaker and Google translate didn't do a good enough job for me to understand much of the context.

[As a side note, I am trying to do something similar in nature to what the user Philip Whittamore above is doing. His contact information and his blogspot account is private. If, by some miracle, he sees this, I would like to pick his brain]

atar said...

> I am running Qemu 1.0.1.

I think this is the problem. At least QEMU 1.0 had some bugs in SCSI subsystem. Please, try 1.1.0 (I didn't look what happend between 1.1.0 and 1.2.0 otherwise I'd recommend to take the latest version).

atar said...

And, btw, you don't need the option
-startdate "2009-12-13" in QEMU 1.1+.

Basil said...

After updating, I am still getting the same issue:

Type help for more information
ok boot disk0
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args:
SunOS Release 5.5.1 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1996, Sun Microsystems, Inc.
Hostname: stfsun1
mount: /dev/dsk/c0t2d0s6 no such device
/sbin/swapadd: expr: not found
/sbin/swapadd: /usr/sbin/swap: not found

WARNING - /usr/sbin/fsck not found. Most likely the
mount of /usr failed or the /usr filesystem is badly
damaged. The system is being halted. Either reinstall
the system or boot with the -b option in an attempt
to recover.

syncing file systems... done
Program terminated
ok


I then try to boot with the -d option:

boot disk0 -d
Resetting ...

initializing TLB
initializing cache

Allocating SRMMU Context Table
Setting SRMMU Context Register
Setting SRMMU Context Table Pointer Register
Allocating SRMMU Level 1 Table
Mapping RAM
Mapping ROM

ttya initialized
Probing Memory Bank #0 32 Megabytes
Probing Memory Bank #1 32 Megabytes
Probing Memory Bank #2 32 Megabytes
Probing Memory Bank #3 32 Megabytes
Probing Memory Bank #4 32 Megabytes
Probing Memory Bank #5 32 Megabytes
Probing Memory Bank #6 32 Megabytes
Probing Memory Bank #7 32 Megabytes
Probing CPU FMI,MB86904
Probing /iommu@0,10000000/sbus@0,10001000 at 5,0 espdma esp sd st SUNW,bpp ledma le
Probing /iommu@0,10000000/sbus@0,10001000 at 4,0 SUNW,CS4231 power-management
Probing /iommu@0,10000000/sbus@0,10001000 at 1,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 2,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 3,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 0,0 Nothing there
screen not found.
Can't open input device.
Keyboard not present. Using tty for input and output.
Probing Memory Bank #0 32 Megabytes
Probing Memory Bank #1 32 Megabytes
Probing Memory Bank #2 32 Megabytes
Probing Memory Bank #3 32 Megabytes
Probing Memory Bank #4 32 Megabytes
Probing Memory Bank #5 32 Megabytes
Probing Memory Bank #6 32 Megabytes
Probing Memory Bank #7 32 Megabytes
Probing CPU FMI,MB86904
Probing /iommu@0,10000000/sbus@0,10001000 at 5,0 espdma esp sd st SUNW,bpp ledma le
Probing /iommu@0,10000000/sbus@0,10001000 at 4,0 SUNW,CS4231 power-management
Probing /iommu@0,10000000/sbus@0,10001000 at 1,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 2,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 3,0 Nothing there
Probing /iommu@0,10000000/sbus@0,10001000 at 0,0 Nothing there

SPARCstation 5, No Keyboard
ROM Rev. 2.15, 256 MB memory installed, Serial #0.
Ethernet address 52:54:0:12:34:56, Host ID: 80000000.



Rebooting with command: disk0 -d
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@0,0 File and args: -d
SunOS Release 5.5.1 Version Generic [UNIX(R) System V Release 4.0]
Copyright (c) 1983-1996, Sun Microsystems, Inc.
Hostname: stfsun1
mount: /dev/dsk/c0t2d0s6 no such device
/sbin/swapadd: expr: not found
/sbin/swapadd: /usr/sbin/swap: not found

WARNING - /usr/sbin/fsck not found. Most likely the
mount of /usr failed or the /usr filesystem is badly
damaged. The system is being halted. Either reinstall
the system or boot with the -b option in an attempt
to recover.

syncing file systems... done
Program terminated
Type help for more information
ok


Is the Solaris install screwing up here or what is going on? How can I fix this? Am I even going about booting into this correctly?

atar said...

I don't see from your last message whether you did re-install Solaris with QEMU 1.1 or used the previously installed one. If the later, please re-install using QEMU 1.1.

Basil said...

Sorry about that, I am using Qemu 1.2.0. I am about to test out 1.1.2, to see if there is anything noticeably different from what I am seeing.

I am able to boot into the disk image now, but every time I am forced to boot into the 2.5.1 iso and run fsck on my disk image. Now, I'm not a *nix guru by any stretch of the imagination (evangelist maybe) but this to me seems to indicate that some fishy things are going on when it is unmounting and exiting out of the system.

What I am doing when I close it is issuing a "halt" command from the root user within 2.5.1 and it drops back down to the bios and then I just have to manually close the terminal window. Could this be causing issues? Moreover, how does one "gracefully" close Qemu from the bios?

Or am I completely off-base?

Sean Kenn said...

I'm trying to run a Solaris 10 install ISO using qemu-1.2.0 on RHEL6.3 x86_64.
Is this not going to work because Solaris 10 and OpenSolaris do not support 32 bit sparc platforms,
so they can never be booted under qemu-system-sparc?
Is qemu-system-sparc64 available anywhere these days?

/tmp/qemu-1.2.0/sparc-softmmu/qemu-system-sparc -M SS-5 -bios /tmp/ss5.bin -nographic -cdrom /space/OS/SOL_10_1106_SPARC.iso

I get the same exact thing that Nigel Horne reported back in July 11, 2011 6:16 PM all the way down to the ok prompt.

I'm not able to boot anything though.

ok boot disk2
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@2,0 File and args:
The file just loaded does not appear to be executable.

ok boot disk2:d -vb
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@2,0:d File and args: -vb
Short disk read
The file to boot may not be present

ok boot cdrom -b
Boot device: /iommu/sbus/espdma@5,8400000/esp@5,8800000/sd@6,0:d File and args: -b

Can't open boot device

atar said...

Correct, this is not going to work because Solaris 10 and OpenSolaris do not support 32 bit sparc platforms,so they can never be booted under qemu-system-sparc.

qemu-system-sparc64 is available at the same place where qemu-system-sparc lives. But the upstream version is not able to boot [Open]Solaris. A while ago I built a prototype which would be able to do it, but couldn't find the necessary funding to finalize the project, so it's currently on hold.

Sean Kenn said...

That's too bad. Just curious...how much funding is needed for something like this? $50, a coke and a smile, or do we need to start catching people at the ATM to get this done? Or is it just a case where this dinosaur should be laid to rest and people should move on to a newer distro?

atar said...

For a private person it's cheaper to buy a used system on ebay. But a company going to migrate/virtualize an existing [obsolete] SPARC infrastructure may be interested in such project.

Basil said...

Another question, maybe you can answer:

I've got Solaris 2.5.1 up and running on QEMU 1.2.0. I want to install some software from a cd that I ripped to an iso.

I have hit a stumbling block. I have tried to pass it in either through -cdrom mount.

I believe that the cd device is /dev/sr0 (which points to /dev/dsk/c0t2d0s2). When I try to mount it via:

mount -o ro -F hsfs /dev/sr0 /mnt

I get the following message:

mount: /dev/sr0 is already mounted, /mnt is busy,
or allowable number of mount points is exceeded

Does the cdrom issue you mentioned above still apply here?

I tried to mount through passing the iso in as -hdb but with the same results. Do you have any advice on what I am doing wrong?

Michael De Armon said...

Atar,
Thank you for the help! I got booted up with the Solaris 1.1.2 (SunOS 4.1.4) DD img just great!
But now, I've been going through the network howto... It's a server I'm trying to setup with the ip of 192.168.9.90. All the other computers telnet/rlogin into it.
I can't figure out what switches to use.
It's not pingable and I can't ping host from it (which I see your postings on, but I can't seem to do it right)
Right now I'm doing:
I'm using the latest Qemu for Debian apt-get at the moment.
qemu-system-sparc -M SS-5 -m 256 -bios ./ss5.bin -nographic -drive if=scsi,unit=3,file=sd0c.img -drive if=scsi,unit=5,file=sd1c.img -net=???

Booting up is fine, but like I said, once I'm in, it doesn't ping out or can't be pinged.

Thanks in advance! You're a life saver!

Michael De Armon said...

Oh, also, is there a Linux Distro you recommend using to run Qemu on and then run SunOS 4.1.4 on?

Michael De Armon said...

so far I've been trying to setup tap per the wiki page on qemu...

= nightmare

Unfortunately it kind assumes I know what I'm doing in the first place LOL.

atar said...

Tap is one possibility. Haven't used it much, as it requires some stuff being run as root, and that's what I'm trying to avoid.

I used port forwarding ( -redir tcp:5023::23 ). It's enough for telnet and ssh. If you don't need ftp, it's easier.

I use '-net user' (it's QEMU's default). In this case your guest ip is 10.0.2.15, and your host ip (gateway) is 10.0.2.2.
You should be able to ping 10.0.2.2 from your guest, but not any further host as ICMP forwarding is not implemented. You obviously can't ping the guest from the host in this scenario.

I wrote about port forwarding via ssh here. There is also a link to a good QEMU networking tutorial.

Michael De Armon said...

Is there a way to make it mimic as though it were a real machine on the 192.168.9.xxx network? Would that require TAP?

atar said...

Yes. If you need a virtual machine on your real network, you need TAP.

Michael De Armon said...

Hey Artyom!

I got your reply via FB. I didn't quite understand about the telnet serial with the expect option.

I'm not much of a programmer =(

Here is the current command I use to boot up the Sun OS 4.1.4. It gets me up to the Sparc Prom (Sparc5 Emulation): (Without the quotes)

" qemu-system-sparc -M SS-5 -bios ./ss5.bin -nographic -m 256 -drive if=scsi,unit=3,file=sd0c.img -drive if=scsi,unit=5,file=sd1c.img -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=/etc/qemu-ifup ; boot disk "

Then, when it's in prom, I simply type in "boot disk" and it boots right up.

There are two virtual drives.

Thanks for you help! You've saved me so much stress!!!

atar said...

I mean ... -nographic -serial telnet::4441,server,wait ...

And then use telnet with expect or Expect.pm . Alternatively there were some attempts to boot SunOS with OpenBIOS. Once it works it would automate booting naturally.

«Oldest ‹Older   201 – 298 of 298   Newer› Newest»