Keen in Linux

From KeenWiki
Jump to: navigation, search

This page intends to be a complete tutorial on how to setup your Linux system to run Keen and other DOS applications. Therefor the DOS Emulator DOSBox is needed. Some distributions already include DOSBox in their installation media or online package repositories, but most likely it's an outdated version. In this Tutorial there are several ways shown on how to install and configure DOSBox on a Linux based machine, which is either by compiling, by installing via terminal or by installing via a graphical interface.

What you need

  • A Linux distribution ( DOSBox works fine on both x86 and x64 versions).
  • Any of the Commander Keen games (Originals/Mods).
  • DOSBox itself (either via installing or by downloading the latest source code version at the official website.

If you get the latest version at DOSBox's website, you might need to install additional dependences/development packages for building it from source code. The pro is you can get some machine-specific optimizations that may or may not improve DOS programs performance. The dependencies for version 0.70 are:

  • GNU C/C++ compilers, GNU Make: provided by most distributions
  • SDL library (+development package, see above): vital for DOSBox.
  • SDL Sound (+development package): ?
  • SDL Image (+development package): ?
  • C/C++ development files

Compiling DOSBox

Note: if you are not building from source code you can skip this section (go to: install DOSBox in RedHat or in Ubuntu/LinuxMint).

Download DOSBox' source code (should be a tarball named dosbox-X.Y.tar.gz, with X and Y the version numbers) and decompress it in any folder where you have read/write access with your regular user account. You can do it via a graphical user interface tool (such as Ark) or manually from a text Terminal (you'll have to use it anyway):

$ tar -zxvf dosbox-X.Y.tar.gz

That will decompress the package to the current directory. Then, you might want to check the README and INSTALL files provided in the DOSBox source root directory. You'll probably want complete optimizations, so just:

$ ./configure --enable-inline

To generate the makefiles. You can use any switches with configure if you need them, but don't forget to run configure.

$ make

Running make in the same directory the configure script is located at, will start the building process. At the end, assuming everything built successfully, you can do:

$ make install

And everything will install to the target directory provided by you (./configure --prefix=somedir) or the default (/usr/local). If you are installing DOSBox in /usr/local or any other directory where only root can write to, you'll have to

$ sudo make install

instead. If you don't know the root password (i.e., it is not your computer), you might have wanted to use the --prefix switch in the configure call, so that make install is performed in a directory of your user without root privileges. For example:

$ ./configure --enable-inline --prefix=$HOME

Installs DOSBox to your user home directory when doing make install, so the final DOSBox executable should be in $HOME/bin/dosbox.

Installing DOSBox via Terminal

Note: If you followed the steps above (i.e. built the program from its source code) skip this section.


Installing DOSBox RPM package in RedHat via Terminal, you need to have root permissions. Just access the root account and install the RPM:

$ su
$ rpm -i dosbox-X.Y.rpm
$ exit

DOSBox will be installed in the /usr tree.


Installing DOSBox in Ubuntu/LinuxMint via Terminal, you need to have root permissions. Open the Terminal and type:

$ sudo apt-get install dosbox

DOSBox will be installed in the ~/.dosbox tree.

Alternative you can install DOSBox via your Software-Center or Synaptic.

Mounting Keen's directory in DOSBox

Run DOSBox via Terminal by typing:

$ dosbox -c mount C /media/hdaY/somepath

Where -c (etc.) is for automatically mounting /media/hdaY/somepath (real directory) to DOSBox's drive C: (replace the C with any letter you want). After that, assuming you have KEEN.EXE in /media/hdaY/somepath, you just have to enter in DOSBox's command prompt:


Note: mount directories which contain 8.3 filenames (8 letters filename, 3 letters extension) to avoid issues with your DOS-based programs.

Creating a shortcut to run Keen in DOSBox (Ubuntu/LinuxMint)

To create a link in order to run a Commander Keen game in DOSBox, two files need to be created. One is a Shell-Script which mounts Keen's directory in DOSBox (seen above), the other one is a link for your Dash which calls this script.

Therefore open up your favourite editor (e.g. gedit, Kate, Mousepad, Leafpad) and type:

dosbox some/path/to/KEEN4E.EXE 

The first line tells to execute the file using the shell. The second line calls DOSBox and mounts via the directory parameter the Keen executable into DOSBox. In this case the original KEEN4E.EXE is called. If you are going to link a mod, you might change this to Play.bat or whatever the very batch file is named.

Save this as a Shell-Script with a distinctive name like

To make this script executable open up a terminal and type:

chmod +x /path/to/script/

In a second step you need to create a Dash-link that calls this very script. Again open up an editor and type:

[Desktop Entry]
Name=Keen 4
Comment=DosBox + Commander Keen

Save this file under the path ~/.local/share/applications and name it Keen4.desktop. Now you can open the game in DOSBox by simply typing Keen4 into your Dash.

Configuring DOSBox

Depending on your system specs running Keen might be a straightforward step. However, having problems to run Keen (i.e. it lags, sound does not work, it needs more memory) there is a configuration file included in the DOSBox' install folder (dosbox.cfg / dosbox.conf). Being a well documented file, you can open it with a texteditor and manually edit it to solve your very problem.

Alternative you can look for GUI frontends in DOSBox' downloads page.

External Links

German Ubuntu-Wiki entry for DOSBox

See also

Keen in Windows