Recording QEMU’s VNC output to a flash file

First off it doesn’t do sound… I’ll have to search further for something that will let me do something more.. involved, but for now, this works well enough.

First I’m going to use Qemu 0.14.0 for this, earlier ones will work, but if it’s too old, there isn’t any support for VNC output. I figured I’d start with something simple, Lemmings, from the Win32s demo a while back. Now VNC doesn’t like it when you change resolutions, so I find it’s best to start out in the video mode you plan on recording. So once the VM is fired up I go ahead and load Windows. Qemu can support multiple outputs so I’m going to specify that it listens on the default VNC port (TCP 5900), and bind it to my IPv4 loopback. I’m also going to open up the SDL Window, because I like to see what I’m doing. If you want to get more sophisticated, you can even use a multiplexer program like VNC Reflector which will allow multiple people (or programs) to connect to the VNC port.

qemu -L pc-bios -m 32 -hda win31.qcow2 -vnc 127.0.0.1:0 -sdl -soundhw sb16,adlib

Now a minor word about audio.. I am currently having issues aligning this up.. no doubt I’m doing something wrong, or I should just break down and use some proper editing tools but it kind of works for now. Also to get a ‘clean’ capture of the audio from the VM, I use Virtual Audio Cable. By simply changing my default sound device to a VAC, and my default Mic to the same VAC I don’t have to worry about background noises, or anything else. Not to mention in Vista or Windows 7, you can mute other programs so you won’t have instant pestering bleeding into it.

I’m using the awesome program vnc2flv to record this. Now it is a python program, but thankfully us windows users don’t have to go through too much hell to run this, I just downloaded it from ‘RT’s Free Software‘.

I just kick it off like this:

flvrec -C 640×480+0+0 -o video.flv 127.0.0.1:0

And it’ll start recording. I then kicked off sox to record the audio like this:

sox -4 -b 16 -d audio.wav

Then once I’m done doing what I’m going to record, kill both programs.

While sox can record mp3’s if you find libmad, or build it yourself, I found it was just easier to use lame.

lame -r -x -s 44.1 –bitwidth 16 audio.wav

And yes, you *DO* need to output at 44100Hz or 44.1Khz for the audio. Any other level and you can’t combine the flv & audio. Yes I tried and tried, but don’t fight it, and thank me for finding the flags to pass to lame.

Then use flvaddmp3 to combine the audio and the flv video into a final.flv.

flvaddmp3.exe video.flv audio.wav.mp3 final.flv

Now you can upload it to youtube, and from there embed or share it as you wish.

I had originally used pyvnc2swf, which will create a flash file directly, however it doesn’t deal that well with screen refreshes. But if anyone wants to use it, remember the default VNC port is 5900, and you must pick a file to ‘save as’ first then you can start the recording. Also in things like windows, I found having notepad open to full screen then minimizing it was a good way to force a screen redraw.

The first appearance of Windows NT

As mentioned in the great book Showstopper!, the first public demonstration of Windows NT was at the 1991 Fall Comdex.

And apparently it must have been quite a show.. In retrospect, but for stuff written down at the time there isn’t a heck of a lot to go on. I do find snip its like this after the fact:

“At the COMDEX show, Microsoft gives the first public demonstration of Windows NT. [909.232]”

But how about a good review? How about someone to kick the tires? I guess it was just too far fetched? Anyways I did find this ONE writeup in Infoworld:

Windows NT looks real at Comdex.

 

And it is just gushing about SMP support. But if you think about it, SMP support around 1991 was almost non existent. It either fell into people who took UNIX and tried to make it more SMP friendly (ie giant spinlocks) or people who offloaded specific tasks to different CPU’s (Novell Netware). NT was like Mach in that it was going to be something totally different written for SMP hardware in mind, and presenting a personality much like an old trusty OS, be it POSIX, Win32 or the NTVDM running other stuff. The other thing the article mentions is that 300 of these developer discs were made.

So with some luck, someone actually sent me an installed copy of this historic version of Windows, so let’s take a look shall we?

The only thing I really can compare this to is the later December 1991 release, but here goes.

 

So first here we are booting up. Not surprisingly, like all version of Windows NT we start with a blue screen. And here we know it’s the official “32-Bit Development Kit October 1991.” version. I wonder if they even sold/gave these out at Comdex to some selected people… But I’d imagine they didn’t.

And here we are at the login screen. Just like the December 1991 version there is no passwords, and you can even login as SYSTEM. The background & color scheme was set in the image, I bet changing them is trivial.

Here we are at the desktop. It feels more like Windows 3.0 then 3.1, it may very well be mixed in with the beta Windows 3.1 program manager for all I know.

Here is the command prompt. It looks very OS/2 like with the square brackets around the prompt. Just like December.

So I figured, let’s search through ntoskrnl.exe for any trace of OS/2…

And here it is!

Buried in the binary is the true name of Windows NT, NT OS/2. Not that it matters. Also notice all the NT api calls. It looks like these early kernels weren’t to scared to share their interface names..

Now this is a big deal, look at all the multitasking! In 1991 getting this kind of tasking out of Windows 3.0 was an impossibility! I’ve got 6 copies of WinBez open, along with Winshap bounding around minimized. I’ve got a command prompt open, and I compile some code, and it keeps on going.

But really pictures don’t speak words for it, here is it in action!
 

 

I know it’s small, it’s blogspot’s formatting, but you can always view the direct video on youtube here. And you too can watch me compile & kill a troll. Very exciting!

I’ll have to write up later how I did this….

Zork on Windows NT 3.1 Pre-Release

So I’ve had a few pre-releases, and I’ve not ported anything to it as yet so it’s been kind of silly. So at any rate I figured I’d clean up dungeon to run. So I managed to get the source onto the drive under qemu (-hdb fat:\temp\zork), and from there I got it to compile, and it crashed out.

Hard.

Well that was painful!

So I took a que from the sample directory, and saw how it built a simple hello world, and took notice of the ‘cvtomf’ process… No doubt this early pre-release stuff is not anywhere near as stable as what NT was when it was around late 1992 or when it shipped in 1993. So spending some 30 minutes with the makefiles I got an exe that didn’t bluescreen the OS…

But still crashed. If only I had a debugger… Oh wait, what is this? Some kind of built in debugger?

I’ve never used NTSD, or the “NT Symbolic Debugger” before. It’s like debug from MS-DOS days, just with far more bells and whistles… Although the pre-release versions are lacking a lot of these features, I did manage to find the #1 thing I end up using, and that is the callstack, it’s bt in gdb speak, but it’s nice to see who called who before it exploded.

Here you can see how the program flowed from the mainCRTStartup which then catapults into main, then we see it calling sigcatch & signal, then it dies. Well I’m pretty sure that Zork doesn’t need signals, and that Windows NT around 1991 was far from feature complete and I bet emulating Unix signals wasn’t exactly high on the priority list.. If anything they were going nuts about meeting some kind of Comdex show deadline, and trying to bring the MIPS port up to parity with the i386. So I did the logical thing, which was to remove the signal portions from f2c & libf2c, and recompile.

So here we go, All the hallmarks of 1991 and Windows, we’ve got solitare, reversi and Zork (Dungeon) translated from fortran into C, and actually running!

So here is October of 1991, and December of 1991. Both needed long filenames to compile, I just used a HPFS slave disk. I just used Windows NT 3.51 to transfer stuff in & out as it’s got TCP/IP to make it easy, as it’ll also read HPFS. I guess you could use the MS-DOS pkunzip and fix the filenames yourself but I’ll leave that to the reader. The source trees ought to be identical, I left the object files & executables in there.. Naturally the December pre-reelase won’t run the October executable… Or link correctly with it’s object files.

I’d also imagine it’ll work on any version of NT that ships with a cl386 SDK… and probably any modern one by fixing the reference to cl386 in the makefile.

Installing Lanman client on OS/2

For this install I’m going to use the lanman client that comes on the NT 3.51 server CD. I believe they included this thing in version 3.1 through version 4.0 of Windows NT. You can find it in the “CLIENTS\LANMAN.OS2\DISKS” directory. Also I bet you never realized there is a copy of Windows 95 on the 4.0 server disk, and there is a copy of Windows for Workgroups on the 3.x disks…. (CD ONLY!).

Anyways with the disk in hand (or in virtual image) go ahead and kick off the install on diskette 1.

The program does black & white on 2.0 while on 1.3 it is in colour..

Copy from the A drive to the C drive… no issues here.

While the client does have a number of lan drivers, it does not have the NIC driver that Virtual PC emulates. Luckily I’ve put it on another diskette

And there we go, the Digital Semiconductor 2104x/2114x 10/100 mbps Ethernet driver.

And now we get to select protocols. While TCP/IP is an option, the IP stack included in this version is really only good for connection to Windows NT servers. It cannot be used by other applications. Sadly there never was a ‘winsock’ type common library for IP stack providers in OS/2.

Review the bindings. It’s a shame IBM made this process to damned involved with LAPS.

Here you can type in whatever you want.

Save the configuration.

Ok everything is good, now for a reboot!

And just to show you upon rebooting, the OS/2 VM now opens up a command prompt and starts the login process. And it’s validated my Administrator account against the NT Server in question. Now all I have to do is map the M: drive to the mailstore, and install the client.

So with everything mapped we go to install on OS/2 and… It says no. Which I guess isn’t that surpising, as the WLO help programs have a habit of crashing on OS/2. But no matter if you install it on 1.3 you can simply xcopy the installed directory and bring it online.

And there you go!

Even better it can send and receive files.

I would imagine the next ‘exciting’ steps to take down this old path is adding users into the system, and getting it connected to the world. But I’m busy with my new Itanium at the moment so it’ll have to wait for a bit.

If anyone has any feedback let me know… I know this may seem incredibly complicated, but really it’s a boat load easier then dealing with AD & Exchange 2010. Not to mention the filesizes are insanely smaller.

Installing OS/2 2.0 on Virtual PC

Remembering what was..

Continuing where I left off, I’m going to install OS/2 2.0 into Virtual PC. Now I’ve gone ahead and done the dirty work of converting the disks into disk images using winimage. A total of 21 diskettes. Back in the day, loading this thing took.. FOREVER. And we weren’t so keen on throwing away an install, instead we actually fixed stuff. But at the same time, OS/2’s major problem was config.sys .. Knock the registry all you want, but the ‘last known good’ configuration can be a life saver.

I created a VM with Virtual PC 2007 (remember to set it’s affinity to a single core!), disabling the Hardware Virtualization, and binding it’s NIC to the loopback adapter. I also defined a 500MB hard diskette. I’m not going to go to crazy here so I don’t need GB of space.

With that all done, we are ready to start with the install diskette.

Now OS/2 has some weird timing loop thing, and it is very possible that on the first few boots you’ll just get a black screen. OS/2 was temperamental booting from floppies back then, and it still is. So keep on rebooting the VM, and eventually you’ll get a screen like this with the IBM notification, and it’ll prompt for diskette 1. That is correct, first boot from the installation disk, then disk 1. I know it’s counter intuitive.

From here it’ll welcome you to the installer. Just hit enter. I think I left some stuff out as a lot of it is just repetitive IBM speak.

Since the drive is ‘virgin’ there is no partitions so I’ll accept the default of one big happy partition. Then it’ll want to reboot, and go through the whole installation diskette 1 thing again.

Now I’ll select the FAT filesystem, mostly because the HPFS format checks every block, and will blow out the vhd to 500MB, and I don’t need the long file names just yet.

And then it’ll copy files diskettes 2-5 then it’ll prompt for the installation diskette again. In retrospect it’s funny but back in the day lots of people (myself included) hated that I needed to read from the install diskette again. I know it’s to copy the kernel to the hard diskette, but we always felt it’s bad for an installer to need to read something twice. But then again there were so many floppies to go through it just felt unnecessary.

Now that the hard disk is prepared, you’ll get the final notice and time to eject the diskette and reboot. Again it may hang at a black screen, just keep on resetting until you get the boot logo.

Now we can learn to use a mouse, or install the OS. I’m going to install the OS, and the whole thing since we’ve got the disk space to spare! 29MB isn’t bad seeing it includes a full copy of Windows 3.0, DOS & OS/2.

I’m going to accept the default hardware selection. I don’t know if s3 drivers even existed at this point for OS/2, I would suspect not, as OS/2 2.0 shipped with a 16bit video driver model. They addressed that in the xr06100 service pack, and in OS/2 2.1 .

Then we shuffle through the remaining diskettes for the OS.

Since it is a new install, there is nothing to migrate, so let it install the default Windows desktop.

Like this..

Now it’s time to configure the printer. By default OS/2 *MUST* have a printer.. And I should mention that from the 1.x days it was insane to configure/add printers. You had to create all the parts yourself (the queue, the driver port) it was a nightmare. This is a little easier..

Again I’m just going to select the null printer.

Now OS/2 is setup, and we can reboot into the desktop!

So there is OS/2 installed. What a snap, right?

Next up is the NetBEUI client.

Itanium….

This isn’t virtual, but rather the real deal. I scored an HP zx2000.

HP Itanium

My HP zx2000

Just got it out of the box, I had to remove the funky sides to get it under my desk… And I’ve just installed Windows XP onto it now. My first observation is that the included DVD drive from HP, the HL-DT-ST GDR8160B has got to be one of the slowest drives I’ve dealt with in a while. And kinda finicky as the first attempt at installing XP failed with all kinds of errors, while a swift kick and a power cycle got the thing running. And let’s see it in action..

This thing likes to tell you over and over that it’s the 64bit version. It may look like XP but it’s not the 32bit version. It is however much like the x86_64 version with no NTVDM, no WOW. But worse, no Virtual PC. It can run i386 win32 exe’s but at a performance penalty. I saw mention that the Itanium C compiler can be found in the November 2001 Platform SDK, so I downloaded that, and installed it.

It’s slow.

It’s annoyingly slow.

All that talk of EPIC, and moving the complexity to the compiler isn’t a joke. Did I mention, it is *SLOW*? I thought it was running an i386 version of the compiler but the taskman didn’t show any stars next to the processes so I’m assuming not, but I’m not sure. I also am assuming that the November 2001 SDK is timed with the “Windows 2000 Advanced Server Limited Edition” for the Itanium. So I figured for a quick test, I’d build some dungeon… Except the f2c interpreter broke in some strange manner. I’d first think it’s something to do with integer sizes, but it worked on x86_64.. So I cheated, used the i386 version of f2c, and built the library and dungeon. Also I found out about this flag, /As32 which builds exe’s in the 32bit address space. f2c will run once it’s built like that. And although compiling f2c takes forever, once built it is FAST.

It worked. The exe is over 900kb! Without at doubt when they called it EPIC they meant the compiler speed, and exe size. For the crazy, you too can play zork on your Itanium here.

And yes my attempt at building SDL bombed too. But I’ll have to spend more time with the box.

The way things were…. MS Mail & OS/2

So I’ve been spending the last day fighting some Active directory, and Exchange 2010 fun. I suppose if I wanted to be all new and exciting I’d document that journey. Maybe I will. But after all that fun, it had me remembering the way things used to be done, and really wondering how much further we’ve either come, or maybe…. not come.

So for the sake of it, I’m going to build out a postoffice, and connect the bastardchild of IBM & Microsoft, OS/2 to it!

How you gonna do it? PS/2 it!


So first I need to establish a server to run my postoffice on. The cool thing about MS Mail is that it could run on all kinds of things, from Novell Netware, Lan Manager, or any other file sharing network out there that MS-DOS’s lock could work with. Originally the product was for Macintoshes, before Microsoft bought it! The bad part, buried in there is that there isn’t a dedicated IPC like server, it really is a flat, shared, database. A bunch of files.

Just like MS-Access.

Really.

As luck would have it, there is a copy of MS Mail 3.5 on one of my Exchange CD’s so looking at the date, Windows NT was out at the time. So I figured for the sake of the experiment, I’d use Windows NT 3.51 . While I’ve used Windows NT 3.1 a bunch, I figured I’d try 3.51 . 3.51 came to us at a time of mass transition, when everything was going forward to Chicago (Windows 95), and the old program manager/presentation manager world was going to finally slip away.

Looking back it’s so archaic, it’s hard to believe that anyone thought progman/fileman were good ideas.

I also wanted to use Microsoft OS/2 1.3 however installing the network client causes it to trap. It does work on real hardware but that wouldn’t be quite as virtual as I wanted. Another wrench is that I’m on my Sprint access card waiting for something, and if I try to do some fun networking it disconnects me.

However I do have a workaround for Sprint’s lameness. You see “SmartView” isn’t all that smart, and thankfully it doesn’t care about interfaces *without* TCP/IP. So we take a loopback network adapter, and *ONLY* bind the Virtual PC protocol to it, by unclicking everything else..

And now we can connect our VM’s to this loopback interface. Then we could, say install an OpenBSD firewall VM that has 2 NIC’s one configured for usermode NAT, and the other on that LoopBack interface. We can now VPN to our hearts content, and even have a virtual LAN. Hell I bet you could even connect a physical Ethernet, connect Virtual PC to that as well, and plug that into a WAP. I hate it when stupid software tries to limit us, but you know… There is always a way around.

So getting back to the experiment at hand, I setup Virtual PC 2007 sp1 (making sure to tag it to a single core, imagecfg doesn’t work for some reason) and I disabled the hardware virtualization. I know OS/2 does some weird stuff with it’s LDT that most things cannot dodge, and it seems that NT 3.51 doesn’t play nice either. But no problem, luckily we can disable it.

I installed Windows NT 3.51 by first generating the 3 needed boot floppies to kick off the install. While IDE CD-ROM’s are supported by NT 3.5 & 3.51, they El-torrio boot method is not, so you need to make the 3 diskettes under MS-DOS if you’ve lost them (WINNT /OX) then you can boot off of those, and install. I setup a 2GB IDE disk, and partitioned it 512 (NTFS for NT) for C, 256 for E (FAT to swap) and finally a 1.2GB F drive to install the post office to.

Yes, the installer really is MS-DOS based. So you could run this thing on anything modern today… I would imagine even the ‘share’ hack for DOSBox could work.

Naturally we’ll create a new post office.

As I had mentioned above, I’m going to store mine on the F: drive. Don’t forget that you end up sharing out the data directory, and everyone maps it to the M: drive… If you install to the M: drive bad things happen as it expects the mail directories to be in the root… Although I guess you could just slam it in the root, but it seems… wrong.

I’ll call my post office, POSTOFFICE for the theme.

And the corporation may as well be any given MEGACORP. This was semi popular in small corporations. But it being based on fileshares meant it didn’t scale all that well. You could use special MTA’s (Mail Transfer Agents) to transmit mail from one post office to another.. We’ll get into that later.

I’m going to install with MS sharing hooks… But look a MS product that supports NetWare! Embrace, Extend & Extinguish!

I’m going to install the admin tools & agents. I don’t plan on using a modem, so scratch that!

Let’s keep the admin tools away from the users!

And let’s support MS-DOS, Windows 3.0 & OS/2. That’s right the OS/2 / Windows option is the same, that is because of WLO. This makes this one of the handful of things that shipped with WLO, (Windows Libraries for OS/2. It is a ‘port’ of the Windows 3.0 API to OS/2 as an underpinning. This was the foundation of porting Windows to NT, into Win32. Or at least that is what showstopper mentions.)

And deploy the clients to the drive that I’ll share for mail.

Everything looks good, so let’s go!

Files are copying….

And we are done!

And for the heck of it, I’m going to install the big exciting thing for Windows NT at this point, the Microsoft Mail Multitasking MTA. And it was a big deal at the time, because, naturally almost *NONE* of the other agents were multitasking (ie supported OS/2 in OS/2 mode). In fact it wasn’t un common for people to try running this stuff on Windows/386 or Windows 3.0 / 3.1 in enhanced mode with multiple MS-DOS VM’s. It was not a thing of beauty and stability. And don’t forget prior to OS/2 2.0, OS/2 could only run a single MS-DOS session, and only when it was in the foreground.

Kicking off the install.

Point it towards the mail directory.

By default the admin account it ‘admin’ and the password is ‘password’. We haven’t had a chance to change it, but those are the defaults.

I’m going to put the agent in the mailexe directory. It creates sub directories so it’s no big deal.

This isn’t a preconfigured store, so overwrite it, I don’t care.

Files copy…

Pick a group…

And we are done!

So now I’ve gone over how Sprint’s modem access is limited, and presented a way using VM’s to get around it. It’s really needed if you want to use a VPN (Virtual private network) so it is relevant to other people. Then I’ve installed Windows NT 3.51, and MS Mail 3.5 along with the MMTA. This is getting long, but in part two, I’ll setup OS/2 2.0 on Virtual PC. In part three I’ll get the network working along with some information on running MS Mail 3.5 on OS/2.