Creating a DOS Games Server

This post assumes you've followed my guide to Setting up Xen on Ubuntu 12.04. and will talk you through the steps required to set up a web-accessible server for playing classic DOS Games (I've got Commander Keen, Duke Nukem 3D and Quake in mind!).

Either create a new Ubuntu VM, or clone an existing one, launch and then connect via console.

First we want to install DOSBox

apt-get install dosbox

Next, we want to configure X-Forwarding (dosbox makes quite a mess of our console if we try and run it otherwise!)

nano /etc/ssh/sshd_config

Ensure X11 Forwarding is set to Yes

Add an unprivileged user (do you really want to be logging in as root to play games?)

sudo adduser gamesuser
sudo passwd gamesuser

Now we should be able to SSH into the VM (run ifconfig if you don't know the IP)

ssh -XY gamesuser@ip.address

We should get a window open on our local machine when we run

dosbox

If that worked then we've got some very basic config to do, exit dosbox and then run the following

nano ~/.dosbox/dosbox-0.74.conf
#Add the following to the end of the file, in the autoexec section

mount c ~/.dosbox/drive/

#Save and close
mkdir ~/.dosbox/drive

Now, when you run dosbox, the C: drive is automatically mounted. If you're keen to start installing games rather than doing the last few bits of configuration, copy your installers to that directory, then call them from DOSBox.

 

Automatically running on login

The only time you're actually going to login to that account is when you're wanting to play games, so edit /home/gamesuser/.bashrc and add the following line to the end of the file

dosbox

 

Additional Considerations

You should also think about securing the system further than we've done here - for example switching off plaintext authentication is likely to be a wise move.