OS/2 2.1 and TCP/IP 2.0

So I thought I could simply take my OS/2 2.0 install on Qemu with an ISA NE2000 and simply upgrade it to OS/2 2.1 and it’d work, right?

WRONG.

Dead WRONG.

So after an hour screwing around with various drivers, I found of all things, the PCI NE2000 will work.  The driver is available os2site.com

Thankfully the NIF’s and OS2 bits work right so you can actually use LAPS to configure it, once you copy the NIF & OS2 files into the c:\ibmcom\macs directory.

LAPS to the rescue (for once)

And then with that in place configured for user mode networking (10.0.2.15/255.255.255.0/10.0.2.2 DNS 10.0.2.3)

All is working as expected.  I’m hoping that the DPMI emulation is better in 2.1 vs 2.0.  Although what is interesting is that after applying XR06200, my OS/2 2.1 is now 2.11 …

terraria networking

Personally, I couldn’t care less about Terraria, although it reminds me a bit of Zelda III back in the day, but it does have this multiplayer capability.  But it never mentions the TCP port.  Well the default port is:

7777

And if you have an Apple airport network, a teenager that needs to have ‘cut off times’ and sits 2 levels of NAT in, you’ll have to forward TCP 7777 all the way to their computer.  It’s not the end of the world but UPNP doesn’t work in nat-nat scenarios (thankfully) but the blasted game doesn’t mention when setting up a network game, oh by the way you’ll need to NAT TCP 7777.

Oh well that is all.

Running QEMU from a VPS

I’ll expound on this as I go on.  For now this will be an overview with separate articles going into each part.  I’ll go into the process of how I created my OS/2 2.0 BBS, bbs.superglobalmegacorp.com .

VPS’s (Virtual Private Servers) are getting cheaper as the days go on, and it only makes more and more sense to take advantage of these great things!  Almost all of them are geared to running Linux, a few to Windows, and well anything outside of those two is damned near impossible to find (I’ve seen ONE NetBSD VPS service).

So if you want to say run MS-DOS, OS/2, Xenix, or any other crazed OS (why not?!) you are basically SOL as they say, except of course, if you utilize our old friend Qemu.

The first thing you’ll need is a VPS.  Now there are thousands of providers out there, I can recommend what I use (and I’ve got a few) but as always, pick a plan that you feel comfortable with.  To get started on something small a budget of under $10 USD a month is perfectly fine.  Shop around and you can certainly find cheaper in the month to month space, and if you are willing to pay up front, I’ve seen them average down to $2.50 USD a month.  Yes for less then a Big Mac, you can have your own ‘server’ in the sky (or part of the cloud nonsense if you are into that).  Hell you can even setup your own global infrastructure, with servers in Europe, Asia and North America for about $20 a month!

Anyways you can find an overload of reviews, and listings on sites like  webhostingtalk.com, and lowendbox.  Again I know it can be overwhelming but googling around you can eventually find what you are looking for.

Now what is important for running Qemu on a VPS? I’d have to say, memory is the #1 thing, bar none.  Now the joy of running older OS’s is that they didn’t need much back then so any new VPS ought to be ‘extravagant’ to them, but keep in mind Qemu needs a fair bit of memory itself!.  I generally worked it out to consume with a ‘bare’ CentOS or Debian install with an 8MB VM to consume around 60MB of memory.

Keep that in mind, that with your VM the OS will need memory, as long as disk space is also needed.  So it all depends on what OS you plan on running.  I’ve run MS-DOS, OS/2, Windows NT, and 386BSD all on the ‘cloud’.. And 8MB was fine for 386BSD but really the VM was overtaxed for anything outside of serving the VM… This for me was fine.  Again keep this in mind if you had hopes of serving web pages, hosting a blog (wordpress needs like 512MB of ram++!!!!!) or whatever.  Another thing is the x86 vs .x86_64 (32bit/64bit) question, and for VPS’s that need to keep small you will want to run 32bit code.  Esp if your VPS is configured under 2GB of ram, really there is no big ‘deal’ in loading 64bit stuff, epically since the 64bit versions consume more memory.

If in doubt setup a VM at home with the same constraints you are shopping to see if you can even do what you hope to do.  This is the big advantage of VM software as you can test all of this from home, without any major pain!

Another thing to keep in mind is that with your own VPS you will be the one required to keep it up to date!  Pick a distro that you are somewhat comfortable with.  Personally I went with Debian in my VPS’s as that is what I’m the most comfortable with.  Also I’d HIGHLY recommend NEVER EVER installing a compiler on the VPS.  If someone does get onto your system, handing them a compiler is like a loaded gun.  At least make it more…. involved for them.  Also setup a VM at home with the same OS, same cpu, same flavor *WITH* compiler, so that way you can check updates at home, to make sure things work, and of course compile things like Qemu for your environment without worrying about things that are either incredibly stale in packages, or just not there at all.  The same goes for things like firewalls.  Again pick something you are most comfortable with, and try to stick with that. The majority of OS’s available are Debian, various Debian forks (Unbutu?!) and CentOS, the RedHat ‘free’ clone.

With a VPS selected and created, and a VM at home loaded up with the same OS you will want to build Qemu.  Now keep in mind that since you’ll be running this on a server that will *NOT* have any local X11, and to minimize memory consumption & disk space by not loading .. X11, you will need to create a version of Qemu that is VNC display only.  It’s not that difficult.  It’s covered in the config process.

With a version of Qemu built, and uploaded to your VM (I use scp) you will then need to decide if you are going to encrypt your disk images (can you really, really trust your host?) or if you are fine with the way things are, and you are going to run in the open.  Naturally ‘fixed/flat’ disk images will be faster and not as CPU intensive, but of course they consume more disk space.  If you are going to ‘overcommit’ your VM or just don’t want to have the empty space right away, I’d highly recommend making a swap disk for the VM, that way you won’t blow out your disks with swapfile growth/shrinks and eventual fragmentation and moves.

If you did choose to encrypt your disks, you will need the program ‘screen’.  It’s been around for a long long while, and every Linux distro should have it available.  You will need to run screen, then launch Qemu from within screen, then it’ll prompt for the password for each disk drive.  Once Qemu is operational you can disconnect the screen session and it’ll remain operational.  Doing so in a script would require you to store the password locally, and defeats the whole point of encrypted storage.

Beyond storage, you’ll want to select some kind of method for external communications with the world.  For an OS/2 BBS I simply take TCP port 23 and forward it to the VM’s port 23.  SIO & vModem take care of all the logic from there.  If  you wanted to telnet into a *NIX box, again tcp port 23.  Maybe you want to run Windows NT 4.0 Terminal server, in that case the default TCP port is 3389.  While NT 4.0 is limited to Internet Explorer 6.0 and Firefox 1.5, it still can be a handy thing to have a multiuser version of NT (like a windows mainframe) out there somewhere for some things, although its usefulness is dwindling.  Maybe you want your own Exchange Server, or even SQL 7 instance, again older software performs better in tight disk/memory constraints.

Another thing to keep in mind is CPU consumption.  You will want a guest OS that can idle.  Otherwise you will consume 100% of the CPU 100% of the time, and they *WILL* notice this, and kick you out.  Be mindful of VPS services, and you have to share CPU resources.  Again watch your task manager or ‘ps’ locally and watch how things behave.  I know for the BBS stuff, you have to watch what doors you are interested in running as some of them happily gobble 100% of the CPU.  OS/2 friendly stuff is the way to go (IMHO) as CPU hogging was a big deal back then, and it’s best to ride on the back of how people solved this stuff a while ago.  Also for MS-DOS people, things like Dbase III applications it’d be a “bad idea” to put them into the cloud.  Although if you get one with a higher SLA that lets you run 100% then.. have at it!

If Qemu runs ‘normally’ you can even set it up into a batch file loop that calls Qemu over and over as needed between reboots.  You could even do some ‘house cleaning’ between reboots, say make a backup, email a notice etc… It’s all up to you, and what you are capable of batch script programming wise.

Also you will probably want your VPS to automatically launch your Qemu VM, and the best way I’ve found to do this is via the GNU screen program.  I just added the following to my /etc/rc.local file:

screen -S qemu -d -m /usr/local/os2bbs/run.sh
screen -S cpulimit -d -m /usr/local/bin/cpulimit -e qemu53 -l 8

This gives me two named instances, and will automatically limit my Qemu to only 8% of the host CPU that way I don’t get kicked for being a CPU hog.  8% of a 3Ghz CPU is more than enough for stuff that ran comfortably on a 16Mhz machine back in the day.

Then that would about wrap it up, you would now have a Linux VPS running your own OS, so you could serve up whatever application you want in the cloud.  The best part is, because Qemu is multiplatform, and will run on various OS’s and CPU combinations, you can jump ship very quickly to other platforms as you see fit, as all you need to do is rebuild your Qemu hosted binary, then copy your disk images & startup scripts and you are good to go!

Not to mention there is nothing to stop you from building the VM on Windows, to upload to Linux, then maybe move to SPARC Solaris!

Screw Java, Qemu is the ultimate VM!

 

Building a LAN with VirtualPC on Windows.

I’m sure everyone has hit that limitation of virtual networking where you cannot say map a drive, or connect to a hosted site on a VM from a machine like a laptop.  While sometimes it is practical with wifi, other times it is not.  And well maybe you just don’t want to expose your virtual machines to the world.

Luckily there is a solution, and it’s built into the OS!

The first thing you need to do is install a ‘virtual network adapter’.

It’s pretty much the same, from 2000,XP,Vista,7 (and yes, 2003/2008), go to hardware, add a new component, then manually select a network adapter, and go to Microsoft as a vendor.

On 7 (probably vista as well) it is more.. convoluted.

Go to the control panel, and then search for ‘hardware’.  Then select “Device Manager”

Right click on your computer name, then select add legacy hardware.

And now it’ll kick off the add hardware wizard (does anyone know a simpler way to kick this thing off?)

Hit the next button..

And we are going to manually add the loopback adapter because it’s not a physical device, it’ll never get ‘discovered’.

So we select network adapters, then continue.

Scroll down the manufacturer list, and select Microsoft, then scroll down the right side, and select the “Microsoft Loopback Adapter”.

Then it will confirm the selection, hit next and it’ll install the driver.  Now go back to your control panel, and search for “view network connections” and you’ll now see the loopback adapter showup on the pane.  From here you can set your own ip address that you want to use, turn off your firewall and then you can map drives etc etc…

And as I had mentioned before you can even ‘share’ out your internet connection to your loopback network by right clicking on your internet facing connection, then hit the ‘sharing tab’.

Then simply click the radio buttons, and make sure your loopback is in the dropdown (The dropdown only shows if you have multiple connections, if you only have the two, then it is greyed out because.. it’s the only connection, nothing to worry about though!)

And to verify if you right click on the loopback, and bring up it’s properties, make sure the virtual machine bindings are checked off so that VirtualPC (or VirtualBOX) can bind into the loopback adapter.
And in the case of Virtual PC, with all of this done, just take your VM, and select the loopback on your network and go from there.

 

Phew that’s about the extent of it, but keep in mind if you are using SPRINT and their glorious dialer, it’ll detect more then one active interface with TCP/IP and it will either refuse to dial, or hangup immediately.  Naturally there is a way around it, that I had mentioned earlier.

At a minimum it’ll help me adding loopbacks into the newer windows versions, that have done their best to hide this functionality.

Installing OS/2 2.0 on VMware ESXi 4.0

Well the good news is that it works… mostly.

The install is SUPER tedious through the console with mounting and ejecting diskettes. But I was able to do all of that from the comfort of my home on a VPS that does VMWare, enscloud.com.

The great thing about OS/2 is that IBMINT13.I13 driver. I’m pretty sure trying to find a suitably old “LSI Logic SAS” driver may be quite difficult, but as long as the adapter does good old interrupt 13 services, OS/2 can drive it.

So with OS/2 2.0 installed, then updated, and TCP/IP installed I thought things would work as there actually is e1000 drivers floating around for OS/2…. Except all I get is a trap and death.

x

Trap 0006.  Talk about a bummer.

From some minor googling around it seems it’s a known issue, with no current fix.

OS2-on-vmware

So close, and yet so far away

Oh well.

** UPDATE in all likely hood all that is required is the unofficial update XR_B108, for OS/2 2.1 which apparently works with networking on VMware Player.

Google’s DNS vs OLD browsers..

I’ve never been that big on Netscape 3.0 but it does support HTTP 1.1 unlike say, IBM’s web browser, or so many old legacy things from the Windows 3.1/Win32s era.  So without thinking about it, I configured my OS/2 4.0 VM with the DNS server 8.8.8.8…

“The requested URL / was not found on this server”.. What the hell?

And no matter where I tried to go, this is what I got.  I don’t know what on earth it’s trying to do, but it’s certainly trying to pass me through google.  Is it some forceful way to see who’s using their services?  I know at some point they had some ‘browser acceleration’ feature that was a great way to get around corporate firewalls… But it’s long gone.

I’m not sure what was going on but I fixed it by simply changing my DNS to something like 4.2.2.4 and away it worked.

I know it’s largely useless, but if you wonder why older HTTP 1.0 stuff doesn’t work, and you are using Google’s public DNS scheme it could be this…. Or not. I don’t know.

OS/2 and virtual COM ports.

With TCP/IP working under OS/2 I went looking for the next thing that I’ve always wanted, and that is a good modem emulator.  Funny enough SIO the COM driver replacement for OS/2 actually includes this functionality.

And has for years… I just never knew it.

I know in the NT centric would we live in today, it’s all moot, but I thought it was really interesting for those of us that still hinge on modems… And freaky hardware, since OS/2 can let some things talk directly to the hardware without OS/2 drivers (IOPL=YES).

So for the sake of it, I downloaded version 1.60 of SIO, went through the install, then added a virtual modem as described to my config.sys .. And I placed a test ‘call’ with OS/2’s terminal program, and I was talking to my MUD!

So I thought I’d try something crazier, like load up a BBS, then configure it for four modems!

 

And it worked!

Sure there are some slightly easier to configure ways to achieve this (DOSBox includes modem support), and I suppose the better thing to do would be to give virtual modems to Qemu.  Then OS’s with no TCP/IP can benefit from this.

Qemu OS/2 TCP/IP networking

Well this should have been ‘easy’ but let me assure you it was not.  However this may save someone LOTS of effort if they ever want to get TCP/IP running in a fossil like OS/2 2.0.

First of all OS/2 2.0 will not install in new versions of Qemu.  I had to go all the way back to Qemu 0.9.0!  Although there is a tonne of floppy images to shuffle, OS/2 2.0 will install somewhat straightforwardly.  Once OS/2 is installed, You will almost surely want the xr06100 service pack.  I found I was unable to run MS-DOS or WinOS/2 sessions at all without either crashing the system, or trapping the entire OS.  But after loading the service pack it works as expected.

Now Qemu supports all kinds of network cards, from the NE2000 ISA, a PCI version of the NE2000, the rtl8139, an AMD PcNET adapter, and a bunch of Intel adapters.  And the annoying thing is that the OS/2 driver I have for the AMD PcNET adapter does not work at all.  It can’t find the card no matter how much I tried.  Which is funny when Netware 3.12 of all things can see it…

I tried all kinds of NE2000 drivers set for 0x300 irq 3 or irq 9 (I changed hw/pc.c to reflect what it was set to) to either not loading, or it’d load and transmit packets, but NEVER receive any packets.

The rtl8039 (ne2k_pci) and rtl8139 would also either not find the card, crash on binding, or send packets and again receive nothing.  To say it was very annoying was an understatement.

So I almost gave up, I found some update for the TCP/IP, u64092 went through the needed fun with loaddskf, and finally got working diskettes, and … It still didn’t work.

So in a fit of rage, I removed the 0x300/9 ne2000 in the config, so the next one, the 0x320, IRQ 10 one is in order, and….. It worked!  It even works with the Microsoft NE2000 driver!

So I go ahead and modify Qemu 0.14.1 to force the ne2000 to 0x320/IRQ 10, and it works great on the latest version!  It’s a shame it doesn’t install… But hopefully you only need to do that once!

So there we go, saved by the NE2000 again.

For anyone crazy enough to reproduce this, here is my config.sys & protocol.ini … I’ve also installed EMX, but I don’t think that really matters…

 

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.

Desqview/X

Desqview/X

I never used Desqview back in the day, as I didn’t have a good enough computer. A 286 with 1mb of ram just wasn’t enough to push the thing. And by the time I did get a 386, OS/2 2.1 was all the rage. But in that time between OS/2 2.x and the release of the 80386 CPU there was all kinds of programs to take advantage of the 386’s v86 mode.

Desqview X really is different in that it not only incorporates the desqview multitasking, but it also supports the X11 protocol found in the UNIX world. Sounds cool right? A friend wanted to run it, so he actually dug out a web page, chsoft.com with all the bits.

The first stumbling block is that Desqview requires that you use the memory manager QUEMM, which the majority of emulators we tried couldn’t work with it. Qemu 0.14.0 however proved itself up to the task, as long as you didn’t let it do the aggressive optimization, just let it install, and reboot.

Installing DesqviewX was pretty straightforward, the only catch was the video. VGA doesn’t work but the SVGA modes work fine. I just used the 800x600x256 mode.

With that out of the road, the next thing needed was a good mouse driver. For some reason the majority of the mouse drivers I tried just wouldn’t work with desqview, until I tried ctmouse.

Naturally for the whole X11 experence you need networking. The tcpip package on the desqview webpage uses some old netware thing with a ne2000 driver that is hard coded to 0x300 irq 4. Which won’t work in any machine I know since everyone has at least one com port. So I had to take the lsl & ne2000 parts from my Netware 3.12 client. But doing so revealed that the lsl wouldn’t run because of a lsl buffer pool error. And of course to work with slirp you need to be running ethernet_II instead of 802.3 …

So you’ll need a net.cfg like this:

link support
buffers 4 1504
mempool 8096
max stacks 4
link driver ne2000
port 300
irq 3
frame ethernet_ii

Naturally you’ll need to change the source to Qemu if you have your own build to use IRQ 3 instead of 9 (it’s in hw/pc.c), or use one of my binaries. It’ll configure via bootp and at the end you should be able to ping 10.0.2.2

Putting it all together, running it like this:

./qemu -L pc-bios -hda packet2.qcow -net nic,model=ne2k_isa -net user -redir tcp:6001::6000

On OS X has qemu listen on 6001 for X11 sessions, then redirect them into the VM on it’s X11 port. So I could then easily run xeyes like this:

xeyes -display 127.0.0.1:1

And the output appears inside of Desqview X. Likewise, removing the session security, and allowing remote connections in OS X’s X11 widget, then allowed me to send xeyes from Desqview to my mac like this:

xeyes.exe -display 10.0.2.2:0

And exeyes pops up on OS X as running from the Desqview VM.

I don’t know if it’s terribly useful, but I thought someone may get a kick that Desqview X can run on Qemu 0.14.0 In this day & age though you can get easier versions of X11….