Every day there will be a ‘tiny’ OS to run on Qemu!
The QEMU Advent Calendar 2018 features a QEMU disk image each day of December until Christmas. Each day a new package becomes available for download.
Every download contains a little ‘run’ shell script that starts the QEMU emulator with the recommended parameters for the disk image. Disk images are either contained directly in the download or are downloaded by the ‘run’ script (you need to have installed ‘curl’ or ‘wget’ in that case).
The disk images contain interesting operating systems and software that run under the QEMU emulator. Some of them are well-known or not-so-well-known operating systems, old and new, others are custom demos and neat algorithms.
The ‘run’ scripts (and disk images if included in the download) were created by volunteers from the QEMU community to showcase cool software that QEMU can run.
I found this one recently… So the first thing is you need Qemu 0.10 or higher (probably not a problem), as it’ll save in ppm format no issues. Then the fun expect program (Yay Linux subsystem), and of course Imagemagik.
Run Qemu so you can telnet to the command monitor:
Being the unfair person I am, I thought I’d try NeXTSTEP to see how far it gets.
Processor Speed State Coprocessor State Cache Size
--------- -------- --------------------- ----------------- ----------
0 250 MHz Active Functional 0 KB
Available memory: 512 MB
Good memory required: 16 MB
Primary boot path: FWSCSI.6.0
Alternate boot path: LAN.0.0.0.0.0.0
Console path: SERIAL_1.9600.8.none
Keyboard path: PS2
Available boot devices:
1. DVD/CD [lsi 00:00.0 2:0 Drive QEMU QEMU CD-ROM 2.5+]
2. lsi 00:00.0 0:0 Drive QEMU QEMU HARDDISK 2.5+
Booting from lsi 00:00.0 0:0 Drive QEMU QEMU HARDDISK 2.5+
Boot IO Dependent Code (IODC) revision 153
Can't determine I/O subsystem type
NEXTSTEP boot v184.108.40.206
NEXTSTEP will start up in 10 seconds, or you can:
Type -v and press Return to start up NEXTSTEP with diagnostic messages
Type ? and press Return to learn about advanced startup options
Type any other character to stop NEXTSTEP from starting up automatically
And amazingly the bootloader works, although that is about it. Trying to boot up OpenBSD gets about this far:
I found on Windows though that the Debian 8 CD’s work the best, as the earlier ones lock up after loading a kernel, and the later one doesn’t fully initialize. I’ve been using this one: debian-8.0-hppa-NETINST-1.iso Serial console interaction is the way to go, so I ran Qemu like this:
That’s right, the ADB is usable enough now to type and move the mouse, meaning that OS X Server can now be installed within Qemu!
It’s incredibly slow, and the mouse is incredibly jumpy, but it’s actually running!
Basically, like A/UX, you boot up into MacOS to partition the drive.
qemu-system-ppc-screamer.exe -L pc-bios -m 256 -M mac99 -prom-env “boot-args=-v” -prom-env “auto-boot?=true” -prom-env “vga-ndrv?=true” -hda 2GB.vmdk -cdrom “Mac OS X Server 1.2, MOSX_Booter.iso” -sdl -device usb-mouse -device adb-keyboard -boot d
And then kick off the installer:
Which really isn’t much to do, other than tagging the partition, and prepping the machine to reboot.
Qemu doesn’t emulate the NVRAM, so it’ll complete with this ‘non fatal’ ‘fatal error’
After that, boot into the OS X Server kernel, and continue the install:
qemu-system-ppc.exe -L pc-bios -prom-env “boot-args=-v rd=sd0″ -drive file=2GB.vmdk,index=1,format=vmdk,media=disk -M g3beige -cpu g3 -drive file=”Mac OS X Server 1.2, MOSX_Booter.iso”,index=0,format=raw,media=cdrom -prom-env “boot-device=cd:9,\\:tbxi” -m 256 -net none
It will then format the disk, and copy over the base operating system. After that it’s time to shutdown, and reboot the VM. I couldn’t figure out a pure hard disk boot, but again using the CD-ROM, you can just tell it to pull the root from the hard disk.
qemu-system-ppc.exe -L pc-bios -prom-env “boot-args=-v rd=hd0″ -drive file=2GB.vmdk,index=1,format=vmdk,media=disk -M g3beige -cpu g3 -drive file=”Mac OS X Server 1.2, MOSX_Booter.iso”,index=0,format=raw,media=cdrom -prom-env “boot-device=cd:9,\\:tbxi” -m 256 -net none
And after this, it’ll want to reboot again. Launch it up and now we get the initial setup
And with that out of the way, we can logon!
And after a while, it’ll load up the desktop
As mentioned above, the mouse is incredibly jittery. Doing anything graphical is very difficult. But here we are, running OS X/Rhapsody for the PowerPC!
Because the mouse is VERY jumpy at the moment, Im going to make some pre-configured disk images available because running the disk tool under OS 9 is a major pain. The first image has only been partitioned, while the second has completed the ‘text mode setup’, aka a minimal install.
So after nearly 8 years ago from messing around with UnixWare, I wanted to confirm something from a SYSV Unix that has a C compiler that isn’t GCC, and I remembered I have UnixWare 7.1.1 from a long time ago. Anyways I have long since lost the virtual machine I had installed onto, but I still have media and of course the more important licenses.
Yep it’s the real thing. So with my certs in hand I do an initial install in Qemu and on reboot the system basically has bricked itself.
WARNING: System is in an unreliable state.
And then looking at the licenses it turns out that my license has expired. What?
Somehow I got lucky before, but it turns out that the installation process for ancient UnixWare is NOT Y2K compliant! And this actually turned out to be a known issue. I can’t find the original article, but a mirror is here: ischo.net
So basically install using an eval license, which will of course expire on install, and then use your actual license after the installation, remove the eval, reboot and all will be well.
Although you can’t boot up in any real useful state, the networking will kick people off, and it’ll constantly complain that you are in license violation, you can at least bring up the SCO Admin tool, and add in your actual licenses, and then delete the evals.
Ok, now for the real fun part, flags and how to run with kvm/qemu. Since I was loading this onto a server for remote access something like this works fine for me as I’m using the VNC remote console.
So the key things are to restrict the CPU level, and I’ve deferred the network configuration so I can update network drivers, and the OS. I’ve found that by doing the networking during the install resulted in an OS that crashed with an integer divide by zero after installing the fixpack 5.
Once you have UnixWare 7.1.1 installed, be sure to install Maintenance Pack 5, which is thankfully still online over at sco.com I’d also recommend to do this in single user mode, you can enter single user mode by hitting a key during the boot logo and typing in:
And you’ll boot in single user mode, and can install the Maintenance pack with ease. Until the maintenance pack is installed, expect poor stability, and the system won’t actually listen to the real time clock device, and it’ll accelerate the clock like crazy where I was passing an hour every minute or two.
Once the install and update is done, I just added a PCI network card (So older versions of Qemu work well with the ne2k_isa, but newer work much better with the AMD PCNet card.), which is a popular choice for both machines and VM’s of the era. Although you can use SLiRP the built in NAT for Qemu/KVM alternatively you can also use tun/tap. I tried to enable SMP, however it has issues binding to the other processors, although it does see them. And this is better to give full access to the network stack for fun things like FTP, NFS and whatnot.
Oh yeah so I don’t forget years from now I’m using the following OS & Qemu version:
# qemu-system-x86_64 -version
QEMU emulator version 2.8.1(Debian 1:2.8+dfsg-6+deb9u3)
# cat /etc/issue
Debian GNU/Linux 9 \n \l
Also I found an eval serial for SMP, but it doesn’t recognize the second processor after the boot.
# psrinfo -v
Status of processor 0 as of 01/31/18 16:40:07
Processor has been on-line since 01/31/18 16:13:57.
The Pentium processor has a i387 floating point processor.
The following conditions exist:
Device drivers are bound to this processor.
I’ll try apparently this as for some reason it doesn’t detect the MP in Qemu/KVM so it never installed the osmp driver.
pkgadd -d cdrom1 osmp
Add the following line to the file /stand/boot:
I was pretty amazed to see it even get this far. Credit to Steve Troughton Smith for his patched BootX, which gets the boot process this far. It’ll actually start the NeXTSTEP style install, but the keyboard won’t work either USB or ADB. Oh well.
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
And from there you can either kick off the disk partitioning, or the installer will boot up.
And now to the graphical welcome screen!
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.
It is absolutely critical that you make this change or the disk will not boot at all.
# cat >> system
And you will want a default route…
# cat > defaultrouter
Then in the file /etc/nsswitch.conf change the following:
hosts: files dns
Then to ‘fix’ up your /etc/resolv.conf
# cat > resolv.conf
And then I like to add the following hosts to speed up telnet…
And then hit Control+D and it’ll reboot back to the PROM. Now all you have to type in the PROM monitor is:
And in a minute you’ll be at the login screen.
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.
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.
As you may or not be aware of, Microsoft hit it big as a computer languages company, before they added operating systems into it’s portfolio. And for some weird reason after the whole OS/2 divorce thing, someone decided that everything that had been painfully learned in the earlier eras should just be expunged from history. Which is a real shame to anyone interested in Basic, Fortran, Pascal, C and MASM. Years ago I had gone through the steps of extracting the text the only way I could figure out easily, by writing a simple TSR that would dump the contents of the text video buffer, and write it to a file, then press the page down key, and keep repeating the process. The end result being that I had then dumped the MSPL aka the Microsoft Programmer’s Library. I had put the text into an archive, aptly named Microsoft_Programmers_Library.7z, and pretty much used grep whenever I wanted any information, and left it at that..
One thing that is annoying is that information on CD from the late 1980’s seems to be darned near impossible to find. I know that each generation of machines until about 2005 was exponentially larger than the previous one (post 2007 we hit the iThing world, along with most machines being ‘good enough’ for day to day usage). I know this ad may seem insane, but Microsoft really was trying to push people to CD distributions. As we all know that internet thing didn’t quite tickle their fancy. Did they ever put resources like this online? Like on BIX or Compuserve? It seems like an ideal resource. But I was a kid, and didn’t have that kind of money.
So in the interest of a bad idea, here is MSPL, aka qemu/curses in action.
Well as an addendum I thought it’d be cool to put MSPL online, via shellinabox. First off I needed a 5MB MS-DOS disk, basically enough MS-DOS too boot up, run smartdrive, idle and the CD-ROM driver, along with the minimal MSPL install. And to button it up, I added a reboot.com from the autoexec, so when you exit it’ll reboot the VM. Great.
The reboot command was input via debug, as it’ll let you assemble code directly. Although it isn’t a MACRO assembler, so you have to know exactly what you are doing.
XOR AX, AX
(return on a line by itself)
And with that saved, now I have to setup Qemu. Since I’m taking the shellinabox approach that means I need something text mode, and I was thinking this was light weight. Qemu has a curses output so that’ll work. I set it up to use qcow2 and a backing store image so that way every forked user doesn’t eat 5MB of disk space, it’s more like 100kb.
So it’ll find numerical directories that are at least 30 minutes old, kill them and remove their directory. Probably very dangerous to run, but it’s isolated so Im not too worried. Then just have root add that script to it’s crontab, and run it every minute, and it’ll kill the old stuff hanging around.
I’ll add a video later on how to use MSPL via this setup. And maybe I’ll rig something to have RDP access as well, depending on how I’m feeling.
With the textmode setup complete, it’s time to do the graphical setup of Windows NT 4.0
You can use any name/org
Select how many licenses you have for your NT Server.
Give the server a name
I’m not going to build a domain, so a stand alone server is fine.
You can give the Administrator account a password if you so desire.
I don’t need any emergency repair disk, as this server is the epitome of disposable.
I added all the components. Again for this test it really doesn’t matter.
Now for the fun part, we are going to configure the networking.
I’m sticking to ‘wired’ networking. I’ll save RAS for another lifetime.
Everyone wants to be a webserver. Sure why not.
You can either manually select a NIC, or just let it auto-detect. We are going to auto-detect it though.
And it’ll correctly identify the AMD PCNet card.
I selected all the protocols available. I didn’t bother adding other ones like AppleTalk.
It’ll prompt for the media type and duplex. The card isn’t real and it’ll work fine no matter what. I just leave the options alone.
Our network doesn’t have any DHCP server. Since we are plugged into a simple hub. DHCP requests will fail. Let’s give it a static address. For Advanced people, yes you could wireshark on the wire to observe the DHCP. We will touch on how to do that later, as I just want to get NT installed .
There is no need for a gateway.
We don’t have any bindings that need adjusting, so you can just hit Next
And Next again
Again, no domain, so run in workgroup mode.
Finish, although it’s far from over.
IIS components to install. I just hit OK for the defaults.
Confirm the creation of the directory
And the child directories
And creating the IIS child directories
Gopher isn’t happy without a domain name, but I don’t care.
Select your timezone. Or don’t. This is from 1996, so many of the timezones are no-longer correct. Just as DST has changed so many times. But it really doesn’t matter yet again.
The display adapter is SVGA compatible.
Move the resolution slider to 800×600
Then hit OK. It’ll want to test the resolution
Everything looks good
YES I saw the bitmap
OK to accept the display at 800×600
Files will finally start to copy
And now we can finally restart are computer.
By default the NT Loader will wait for 30 seconds. You can hit enter to get it to load right away or wait.