DOSBox – Runs Old MS-DOS Games/Programs in Linux

Ever wanted to play old DOS games or use old compilers like Turbo C or MASM to run assembly language code? If you have and were wondering how then DOSBox is the way to go.

What is DOSBox?

DOSBox is open-source software that emulates a computer running MS-DOS. It uses the Simple DirectMedia Layer</strong (SDL) which makes it very easy to port to different platforms. As a result, DOSBox is available for a wide range of Operating Systems like Linux, Windows, Mac, BeOS, etc.

Installing DOSBox in Linux

If you are on Ubuntu or Linux Mint, you can install it directly from the Software Center. For other Debian based systems in general, you can use sudo apt-get to install it. The command for it is as follows.

$ sudo apt-get install dosbox

For other Linux flavors like RHEL, CentOS, and Fedora, you can compile and install it from the source as follows. Download the latest source file using the following wget command.

# wget https://nchc.dl.sourceforge.net/project/dosbox/dosbox/0.74-3/dosbox-0.74-3.tar.gz

Navigate to the directory in which the file was downloaded and run the following commands to install it.

# tar zxf dosbox-0.74-3.tar.gz
# cd dosbox-0.74-3/
# ./configure
# make
# make install

How to Use DOSBox

DOSBox can be run from a terminal by executing the following command, it will open up the terminal window, with a Z:\ prompt.

$ dosbox

Once you start DOSBox, you’ll have to first mount the part of your system wants to access inside DOSBox.

mount <label> <path-to-mount>

To mount your whole Home directory as C, you can run the following command.

mount C ~
Dosbox Running in Linux Mint
Dosbox Running in Linux Mint

Then type in C: If you have to mount the same directory and cd into the same location every time, then you can automate the whole process with the help of the DOSBox configuration file.

This file is located in the ~./dosbox directory. The name of the file will be the dosbox-[version].conf where version is the version number of DOSBox which you installed. So if you have installed version 0.74, you’ll run the following command:

$ nano ~/.dosbox/dosbox-0.74-3.conf

So, if you want your DOSBox to automount the home directory and go into the ~/TC folder every time DOSBox starts, you can add the following lines at the end of the configuration file.

mount c ~
c:
cd TC

There are many more options available in the configuration file. For example, if you want DOSBox to always start in full-screen mode you can edit and change the value of a fullscreen parameter from false to true.

Many other options and description of them is given in the configuration file itself. Also, if you want to add comments anywhere in the configuration file, you can do so by using the # character at the start of that particular line.

Installing Few Games and Programmes

If you are a student of Computer Science in India then you must have used this at some point in time in your School or College. Although it is a pretty outdated compiler most Colleges still use it because of their inability to keep up with modern compilers.

1. Turbo C++

Download the latest TC++ from the below link and extract its contents in your home directory.

  1. http://turbo-c.soft32.com/

Now start DOSBox and run the following commands.

mount c ~
c:
cd tc3
install

Change the source drive to C in the installation menu.

Turbo C++
Turbo C++

Keep the directory for installation as the default one and start the installation procedure.

Install Turbo C++
Install Turbo C++

After this, TC++ would have been installed in the location C:/TC. You can run it using the following commands.

cd /TC
cd bin
tc
Start Turbo C++
Start Turbo C++

2. Wolfenstein 3D

It was one of the most popular first-person shooter games in the ’90s when it was released and is even today widely popular in the DOS games world. So if you want to have some vintage video game action, the steps to install it are given below.

Download the zip file from the below link and extract its contents to your home directory.

  1. http://www.dosgamesarchive.com/download/wolfenstein-3d/

Now start DOSBox and run the following commands.

mount c ~
c:
cd wolf3d
install

Select C drive as the installation drive as shown in the screen-shot below.

Wolfenstein 3D
Wolfenstein 3D

Select the default directory for installation and press enter.

Install Wolfenstein 3D
Install Wolfenstein 3D

After this, Wolf3d would have been installed in the location C:/Wolf3d. Once inside the C:/Wolf3d directory, you can enter “wolf3d” to run the game.

Start Wolfenstein 3D
Start Wolfenstein 3D

3. MASM(Microsoft Macro Assembler)

If you want to run assembly language code then you need an assembler like MASM or TASM (Turbo Assembler).

Download the rar file from the below link and extract its contents to your home directory.

  1. http://sourceforge.net/projects/masm611/

Now start DOSBox and run the following commands.

mount c ~
c:
cd masm611/disk1
setup

Let all the files be installed to their default locations and select the Operating System in which you want your programs to run.

MASM
MASM

Once the setup is finished, you can run asm files by running the following commands from the C:/MASM611/BIN directory.

masm <filename>.asm
link <filename>.obj
<filename>

4. Prince of Persia

This was the first game that I played on a computer! It was very popular while I was growing up in the early 2000s in India. So if you too have fond memories like me of playing this game as a kid and would like to revive them, here are the instructions to install it in DOSBox.

Actually, you don’t need to install it, you just need to download the zip file extract it somewhere and you can play the game in DOSBox directly by entering “prince” from that location. Here are the steps for it.

Download the zip file from the below link and extract its contents to your home directory.

  1. http://www.bestoldgames.net/eng/old-games/prince-of-persia.php

Now start DOSBox and run the following commands.

mount c ~
c:
cd prince
prince
Prince of Persia Game
Prince of Persia Game

This was my very first article on Tecmint, so please feel free to comment on how you thought the article was and any suggestions if you have them for me. Also, you can post your doubts as comments if you run into some problem during the installation of any game/program in DOSBox.

If you liked this article, then do subscribe to email alerts for Linux tutorials. If you have any questions or doubts? do ask for help in the comments section.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

9 thoughts on “DOSBox – Runs Old MS-DOS Games/Programs in Linux”

  1. This is coming from a user with Linux beta on a Chromebook that is trying to install a game and run it off of DOSBox from gog.com.

    When I run the “sudo apt-get install dosbox” it says:

    dosbox is already the newest version (0.74-2-3+deb10u1).
    0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
    

    and I can’t find the file to unzip and install it.

    any pointers?

    Reply
  2. Thanks a lot…..i was searching for a way to work with MASM on centos. I have to try it. glad to know that i can do it…..Thanks again…

    Reply

Leave a Reply to anitha Cancel reply

Have a question or suggestion? Please leave a comment to start the discussion. Please keep in mind that all comments are moderated and your email address will NOT be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.