TranslateProject/sources/tech/20230210.4 ⭐️ How to Install DOSBox in Ubuntu to Play Old Games.md

169 lines
5.2 KiB
Markdown
Raw Normal View History

[#]: subject: "How to Install DOSBox in Ubuntu to Play Old Games"
[#]: via: "https://www.debugpoint.com/install-dosbox-ubuntu/"
[#]: author: "Arindam https://www.debugpoint.com/author/admin1/"
[#]: collector: "lkxed"
2023-02-12 16:06:35 +08:00
[#]: translator: "gpchn"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
How to Install DOSBox in Ubuntu to Play Old Games
======
**Learn how to install DOSBox in Ubuntu and configure it to play old DOS games.**
DOSBox is a free and open-source operating system emulator that can run inside modern Linux systems. It has several components which emulate older hardware so that ancient programs and games can run.
All these make it possible to enjoy the older games and applications in modern Linux distributions.
In this guide, I will show you how to install DOSBox, configure it and play a sample game.
### Install DOSBox in Ubuntu
The main package of DOSBox is available in all the major repo of Linux distributions.
For Ubuntu, Debian, Linux Mint and related distributions use the following command to install it:
```
sudo apt install dosbox
```
For Fedora, CentOS, RHEL and related distributions use the following:
```
sudo dnf install dosbox
```
Arch Linux users, use the following command to install it.
```
pacman -S --needed dosbox
```
That will conclude the installation. Now its time to configure and run.
### Running DOSBox
After installation, type the following from the terminal.
```
dosbox
```
It will show you the following screen showing the DOSBox prompt. This first-time run is essential because it creates the DOSBox configuration file.
Type `exit` to close DOSBox for now.
![DOSBox first time run][1]
The configuration file gives you several options to tweak settings. The file is created at your home directory path `~/.dosbox/dosbox-[version].conf` for Ubuntu.
For fedora, it loads the staging config file from this path`~/.config/dosbox/dosbox-staging.conf`.
By default, you can keep the configuration unchanged. However, if you want, you can change it.
For example, if you want to start DOSBox fullscreen, you can enable and disable the switch. Heres a sample:
```
fullscreen=false
fulldouble=false
fullresolution=original
windowresolution=original
output=surface
autolock=true
sensitivity=100
waitonerror=true
```
You can find all the settings in the official [documentation][2].
### Download old games and run
There are many websites which provide old DOS games. I have used the following website, which provides a fair set of old games which can be played in the modern system.
So, visit the following page and download any game you want.
[Download DOS games][3]
Create a directory in your /home folder and name it dosbox.
```
cd ~mkdir dosbox
```
Now, extract the game which you downloaded (it should be a .exe file) and create a separate folder inside `~/dosbox`.
For example, I downloaded the game “Mario & Luigi (1994)”. And I created a folder called “mario” inside the “dosbox” folder. And placed the game file inside it.
![Keep the game in a separate folder][4]
Now launch dosbox from the terminal.
```
dosbox
```
And type the following to mount the game in a virtual C: drive.
```
mount c ~/dosbox/mario
```
After the above command is complete, change the drive to C:.
```
c:
```
And now, you can type the games file name to run the game.
```
mario
```
![Running the game][5]
![Mario running in DOSBox in Ubuntu][6]
### Keyboard or controller mapping
By default, DOSBox should detect the keyboard or any controller you may have plugged in. However, if you want to change game keybindings, you can run the below command from the terminal.
```
dosbox -startmapper
```
It will give you the following screen with the events tagged to each key. You can click on any key and change it according to your taste.
![DOSBox keyboard and controller mapping][7]
### Conclusion
I hope you managed to run your favourite dos game after installing dosbox in Ubuntu and other distros. DOSBox is one of the coolest pieces of software you can use to run any program, such as [Turbo C][8] and others.
If you have any trouble or questions, let me know in the comment box.
Enjoy!
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/install-dosbox-ubuntu/
作者:[Arindam][a]
选题:[lkxed][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lkxed
[1]: https://www.debugpoint.com/wp-content/uploads/2023/02/DOSBox-first-time-run.jpg
[2]: https://www.dosbox.com/wiki/Dosbox.conf#Sections
[3]: https://archive.org/details/softwarelibrary_msdos_games?tab=collection
[4]: https://www.debugpoint.com/wp-content/uploads/2023/02/Keep-the-game-in-a-separate-folder.jpg
[5]: https://www.debugpoint.com/wp-content/uploads/2023/02/Running-the-game.jpg
[6]: https://www.debugpoint.com/wp-content/uploads/2023/02/Mario-playing-in-DOSBox-in-Ubuntu.jpg
[7]: https://www.debugpoint.com/wp-content/uploads/2023/02/DOSBOox-keyboard-and-controller-mapping.jpg
[8]: https://www.debugpoint.com/setting-up-dosbox-in-ubuntu-to-run-turbo-c/