Well after a lot of digging around, I was able to come up with Solaris 2.4 and proceeded to install it on QEMU.
And it works!
From my notes though, it was far easier to use Solaris 2.9’s “format” command to prepare a 2GB hard disk. For some reason Solaris 2.4’s format command didn’t want to write the label to the disk.
But with a labeled disk in hand, and placing the ISO image under the “hdb” position I was able to boot up the installer with a simple
boot disk1:d
During the installation, you can select networking, just remember that the ip address you’ll use is 10.0.2.15, the workstation is networked with a netmask of 255.255.255.0 and you should use the “other” method of resolving names.
As mentioned in the FAQ, don’t let the installer reboot when it’s done (it’s an option), be sure to do the following:
cd /a/etc
# cat >> system
set scsi_options=0x58
^D
Otherwise it’ll load up the drivers in the wrong order, and it won’t mount the root partition… The best part, is that the networking works great, and that I’m able to telnet INTO the VM, and out of the VM.
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
Then finally (yes!) the file /etc/default/login
comment out the line:
CONSOLE=/dev/console
Now you should be good to go!
Or at lest those are the steps I took to make my system boot. Oh, and don’t forget it won’t auto boot, you’ll have to issue
boot disk0
every time you fire up Qemu.
Ha! I user a real dns address for the setup. Does 10.0.2.3 have any advantages, like reverse look-up for 10.0.2.15?
Also with 2.5.1+ and 1.1.2 I never needed to edit /etc/default/login . Is it necessary for the root login on the console? 2.4 is more secure than successors and predecessors then.
The advantage of 10.0.2.3 is that it'll work on every machine, as it'll proxy the requests through what the host machine has setup.. Which is handy for machines with no internet access!
editing /etc/default/login is necessary for root to telnet in with no password… In the real world this would be a big nono, but for a contained VM it's fine.
That's the point: what would it resolve on machines without the internet access? The only thing which come to my mind is 10.0.2.x subnet.
If it doesn't do reverse look-up for 10.0.2.x it is still usable for migrating the guest from one intranet to another one, but in other cases is not much better than 208.67.222.222 .
With qemu you also don't really need telneting to the guest: you have the serial console and it is considered secure. Unless you'd like to have multiple root sessions of course.
Well, not all networks are on the internet… 🙂 Not to mention not all hosts are populated on public DNS servers… And 10.0.2.3 will get you where your physical machine is resolving in a nice generic way.
And multiple root access would be exactly the point of that… Again it's not "best practices" but more so I want into the Sparc VM now.. kind of thing..
Now I've just got to figure out why on earth I can't get it to mount an ISO image…. I've almost given up on the tun/tap networking on Windows, as it "sees" packets, but something is cutting it off. The networking has changed a *LOT* since the 0.9 days of Qemu when I'd hacked a libpcap driver, but I may have to keep on digging around to see where to inject a new network transport…
Do you need the tap networking? I use -redir tcp:4423:10.0.2.15:23 , and then telnet to 4423.
Do you specify hsfs as a file system type when mounting?
Otherwise it may have to do with scsi errors which prevented format utility from working. Do you have anything in the log?
It also may have to do with mounting cd as a hdd: if it complains about the disklabel, the image must be padded to the size specified in the disklabel.
I wanted to ftp into the VM… or heck even out, but the ftp client is too old for passive tricks…
I've altered vl.c so my CD-ROM appears on id #6 so it'd make the SUN firmware happier…
Here is how I created the ISO:
mkisofs -R -full-iso9660-filenames -pad -V gcc GNUgcc.2.95.2.SPAR
C.Solaris.2.4.pkg.tar > gnu.iso
16.97% done, estimate finish Tue May 4 10:21:44 2010
33.97% done, estimate finish Tue May 4 10:21:44 2010
50.91% done, estimate finish Tue May 4 10:21:44 2010
67.90% done, estimate finish Tue May 4 10:21:44 2010
84.84% done, estimate finish Tue May 4 10:21:44 2010
Total translation table size: 0
Total rockridge attributes bytes: 280
Total directory bytes: 414
Path table size(bytes): 10
Max brk space used 4000
29467 extents written (57 MB)
And the Solaris auto-mounter says…
# WARNING: /iommu@0,10000000/sbus@0,10001000/espdma@5,8400000/esp@5,8800000/sd@6,0 (sd6):
no memory for disk label
And I've set the emulation for 128MB of ram…
hahaha you know the sad thing about solaris is, although i love it with passion, that on solaris 10 10.08 (!!!) the most reliable way to get networking up and running is _still_ fuzzing around with /etc/resolv.conf, nsswitch.conf, hosts and so on.
this is mainly because if you select "networked" at the automatic configuration, it pretty much takes over and you can only silently obey.. and although i haven't the remotest idea of how can an unplugged network cable directly cause a handful of system services to fail and 'transition to maintenance', not to mention cde dying horribly, but that seems to be the case.
i just love unix. 🙂 seriously.
I think it was Solaris 2.4 or 2.5 I spent a weekend helping a friend install while in college… The whole CD-ROM needing to be on SCSI ID 6 was a bit much…. And I recall it being touchy as HELL.
And of course as soon as I installed it, and crashed out, he did the proverbial rm -rf / !!!!!!
At least re-installing it was quicker once we had all the drivers & hardware issues sorted out.
The sad thing was it didn't include any compiler, and you can imagine what Solaris is like with no compiler, a MODEM for internet connectivity, and not much else…
Oh well, that was ancient history.
Rejoice in Solaris 2.4 SPARC with gcc now! 🙂
Sorry. Do we need to have OpenVPN configured on our win xp machine as well?
OpenVPN would be to install a tun/tap interface on Windows.
I've had nothing but issues with that, and instead use the 'user mode NAT' that is provided through the SLiRP code in Qemu.
I have followed your guidelines in this blog and at now my qemu guest can ping my win xp host @10.0.2.2 but my win host cannot ping my qemu guest @10.0.2.15 .
NAT goes one way. ICMP (Pinging) isn't the way to test.
You can redir tcp or UDP ports in, but NAT is primarily for allowing traffic OUT.
PINGING WONT WORK, except from the virtual machine to 10.0.2.2
Is it possible to ftp files from win host to qemu guest this way? (as I didn't have success in importing them into my qemu via '-hdc opt.disk' option)
not with the default FTP client as it's fully 'active' mode, which SLiRP can't nat. If you had lynx or something like that you could pull files via a web server… I'm pretty sure I built lynx on that /usr/local disk.
Thank you for your post about how to format a solaris HD.
I'been installing a SUNOS 2.6 with success, but i don't have any kind of connection between host and guest.
I followed your post but i can't communicate with the guest using ftp or telnet.
This is my setup:
HOST: (Linux running on XP Virtualbox)
IP: 10.0.2.40
GUEST: SUNOS 2.6
/etc/hosts:
127.0.0.1 localhost
10.0.2.15 guestsun
10.0.2.2 qemunat
10.0.2.3 qemudns
/etc/resolv.conf:
nameserver 10.0.2.3
/etc/defaultrouter:
10.0.2.2
ifconfig le0:
le0: flags=863 mtu 1500
inet 10.0.2.15 netmask ffffff00 broadcast 10.255.255.255
ether 52:54:0:12:34:
With this setup:
-Guest and Host can ping 10.0.2.2
-Host can't ping guest (it's normal due to NAT)
-Guest can't ping host:
guestsun% ping 10.0.2.40
no answer from 10.0.2.40
-host can't telnet solaris guest:
root@linux telnet 10.0.2.15
Trying 10.0.2.15…
telnet: Unable to connect to remote host: No route to host
Anybody can help with the next questions?
It's normal that guest solaris can ping 10.0.2.2 but can't ping linux IP host 10.0.2.40?
Somebody can do a ftp or telnet from Host to Solaris guest? What kind of configuration i must use?
Yes, it's normal. From the guest point of view your host address is 10.0.2.2. Telnet should directly work with this address, ftp is more tricky because the default 2.6 client doesn't support the passive mode.
Ouch, you've got both the host & qemu on the same network… which will just confuse the thing to no end.
I forget where in slirp it gets initialized to 10.0.2, but basically the major problem you have is that both Qemu & your host have the same network, but they are not on the same network….. If that makes any sense, basically the Qemu VM is *NOT* on your network when you use -net nat …. You may want to check out tun/tap networking which will work better if all your stuff is on 10.0.2.0/24
Thank you for your fast answer.
i've been doing some tests and now i can do ftp and telnet from guest(sunos) to host(linux)
but ftp from guest doesn't work well:
guestsun %
guestsun % ftp 10.0.2.2
Connected to 10.0.2.2.
220 sirou FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
Name (10.0.2.2:cruzado): sirou
331 Password required for sirou.
Password:
230- Linux sirou 2.6.35-22-generic #33-Ubuntu SMP Sun Sep 19 20:34:50 UTC 2010 i686 GNU/Linux
230- Ubuntu 10.10
230-
230- Welcome to Ubuntu!
230- * Documentation: https://help.ubuntu.com/
230-
230 User sirou logged in.
ftp> ls
500 Illegal PORT rejected (address wrong).
425 Can't build data connection: Connection refused.
ftp>
I may study tap solution becouse i need full conectivity between host and guest.
argh – all goes well until I want to transfer files from the linux hist to the sparc solaris 2.5.1 guest. I can telnet but ftp either way doesn’t work, I can create an iso and mount it with -cdrom /test.iso and see the filenames on the CD but impossible to copy them.
It is why I ended up using uuencode and pasting into the console to uudecode.. (mesg -n)!!
Once I got that in place using things like lynx/wget and httpd made things a billion times easier. Also if you do the tun/tap dance you can use NFS although I’ve never done it. I don’t know why but once Solaris is installed getting it to do anything with the CD-ROM is a nightmare.
neozeed: uuencode/telnet/http/pkgadd gzip works fine, but I get this strange problem, when I try to execute a file I get ‘file not found’. For example: I can cat, cp gunzip, but not execute it:
# ls -il gunzip
1174340 -rwxrwxrwx 1 root root 2269 Dec 13 01:47 gunzip
# pwd
/usr/local/bin
# echo $PATH
/usr/sbin:/usr/bin:/usr/local/bin
# cp gunzip gunzip2
# ./gunzip
./gunzip: not found
please ignore! gunzip is looking for bash
Can you post step by step procedure to build sparc solaris system under qemu…either windows or ubuntu. I’ve been trying to configure sparc machine under qemu, since last two weeks but I am stuck at boot prompt, go further ahead…
your help will be very much appreciated..thanks…
I’ll see what I can do.
Good job, neozeed!
Mounting the cdrom iso image as a second hard drive is what I missed, very genial.
I’ve just set the scsi_options as post-install setting.
Now I’d like to start the GUI but don’t know the right command.
If you can post it, it would be very appreciated. Many thanks.