DOSBox is an open-source software that creates a virtual MS-DOS compatible environment, including sound, graphics, and basic networking. It enables you to run DOS applications without any modifications.
Using this wonderful app, you can run your classic DOS games and compilers like Wolfenstein 3D, Prince of Persia, Turbo C++, and MASM on your Linux PC.
DOSBox makes use of Simple DirectMedia Layer (SDL), a library designed to allow low-level access to hardware components like a mouse, keyboards, sound system, and graphics. It has made the whole process of porting easier to various platforms. Currently, DOSBox runs on several platforms like different Linux, Windows, and macOS.
Installing DOSBox Emulator on Linux
Ubuntu users can download DOSBox from Ubuntu Software Center.
For any other Debian distribution, use the apt or apt-get command to install DOSBox.
sudo apt-get install dosbox
DOSBox will be installed, and you can find it under the applications menu. For other Linux distributions, you will have to download the tar.gz file from the link below.
You can also download the setup using wget command.
After downloading the tar.gz setup file, we need to compile and install the app using the procedure below.
Step 1) Open Terminal and navigate to the tar.gz directory. For this article, we placed the setup on the Desktop.
Step 2) Since it’s a compressed file, we need to extract it. Use tar command.
tar zxf dosbox-0.74-3.tar.gz
Note, your file name might be different depending on the DOSBox release you downloaded or the site from which you downloaded the setup.
Step 3) Navigate to the extracted file.
Step 4) Execute the configurations file
Note, you need to have a GCC compiler installed; otherwise, it will raise an error. “no acceptable C compiler found in $PATH.”
Step 5) Create an executable program and library to start the installation.
Step 6) Start the installation process.
Getting started with DOSBox
Launch DOSBox from the application menu. A window will pop up with two panes. The status pane and the command line pane.
Before running any application in DOSBox, we need to mount a directory that shall hold all the necessary files. Just like a virtual machine, the DOSBox environment is separate from your filesystem.
To mount the directory you want to access inside DOSBox, use the following command syntax.
mount <label> <path-to-mount>
The label can be any letter like C, D, etc. Let’s use C for this particular post. Path-To-Mount can be any preferred location. Here, we will mount a folder on the Desktop named, DOSBOX_Programs.
mount C /home/tuts/Desktop/DOSBOX_Programs
Once you have mounted your directory of choice, you can now proceed to install your classic games. However, there are still a few tweaks you can do to make to personalize DOSBox to your liking. To do this, we need to access the DOSBox configuration (conf) file.
It is a hidden folder located in the home directory. All hidden files start with a (.) dot. In case you are not able to see these hidden files, hold CTRL + H.
Open the folder, and you should see the DOSBox conf file. Open the file using any text editor installed on your computer.
One of the tweaks we should perform is making DOSBox automatically mount the directory assigned to it. Whenever you log out or reboot your computer, you will have to mount the directory again using the commands above.
To automate this process, open the DOSBox conf file and add the following lines at the bottom. Don’t forget to replace the path with your path.
mount C /home/tuts/Desktop/DOSBOX_Programs C: cd /home/tuts/Desktop/DOSBOX_Programs
Another tweak you can perform is open the DOSBox window in fullscreen when launched. You can do this by changing the fullscreen parameter from false to true. You can go through the various parameters in the DOSBox configuration file and personalize it to your liking.
Note, it is essential to make a copy of this file just in case you tamper with the original configurations causing some errors to your DOSBox application.
Installing DOS games in DOSBox
It is a shooting video game released in May 1992 and very popular in its time. Since it was designed to play on MS-DOS, Wolfenstein cannot run on other platforms.
To get started with the installation, first, download the zipped file from the link below.
Copy the data to the directory you mounted in DOSBox and extract it. On the DOSBox command line, type the following commands. As usual, replace the path in the below command-line with your file path.
mount C /home/tuts/Desktop/DOSBOX_Programs C: cd [file-name] e.g cd 1WOLF14 install
Once the installation process is complete, launch Wolfenstein 3D by typing the command wolf3d to run the game.
Prince of Persia
It was a video game developed for Apple II in 1989. Just like the title says, the game takes place in ancient Persia. The player controls the Prince, who ventures through dungeons to save prisoners and defeat the grand vizier Jaffar.
Unlike Wolfenstein 3D, you don’t need to install Prince of Persia. All you are required to do is download the zipped file, extract the contents in the DOSBox directory, and type prince in the command line to start the game.
Extract the contents in the DOSBox mounted directory. On the DOSBox console, type these commands.
mount C /home/tuts/Desktop/DOSBox_Programs C: cd PRINCE prince
Those are a few DOS games that you can install and run on your Linux PC using the DOSBox emulator. There are several others including DOOM, Quake, Cosmo Dragon, dark Forces, etc. that you can enjoy playing on your Linux PC in a similar way. You can also use DOSBox to run DOS compilers like Turbo C++ and MASM (Microsoft Macro Assembler).