LinuxCommandLibrary

dosbox

Emulate MS-DOS environment

TLDR

Start DOSBox with default settings

$ dosbox
copy

Run a DOS executable located at a specific path
$ dosbox [path/to/executable.exe]
copy

Mount a folder as C: and run an executable
$ dosbox [path/to/executable.exe] -c "MOUNT C [path/to/folder]"
copy

Start DOSBox in fullscreen mode
$ dosbox -fullscreen
copy

Exit DOSBox automatically after running a program
$ dosbox [path/to/executable.exe] -exit
copy

SYNOPSIS

dosbox [options] [program [program_args]]
dosbox [options] -c "command" [command_args]
dosbox [options] -conf configfile

PARAMETERS

-fullscreen
    Start DOSBox in fullscreen mode.

-nofullscreen
    Start DOSBox in windowed mode (opposite of -fullscreen).

-startwindowed
    Same as -nofullscreen. Starts DOSBox in a window.

-exit
    Exit DOSBox automatically when the emulated program terminates.

-c "command"
    Executes the specified command directly within DOSBox before starting any program or entering the DOS prompt. Can be used multiple times.

-conf configfile
    Load an alternative configuration file instead of the default dosbox.conf.

-lang languagefile
    Load an alternative language file for messages.

-machine type
    Set the emulated machine type (e.g., svga_s3, hercules, cga). Default is svga_s3.

-cycles amount | -autocycles
    Set the CPU cycles DOSBox uses. amount can be a number or 'max' or 'auto'. -autocycles attempts to adjust cycles automatically.

-memsize megabytes
    Set the emulated DOS memory size in megabytes.

-cpu type
    Set the emulated CPU type (e.g., pentium, 386, 486).

-core type
    Set the CPU core to use (e.g., auto, dynamic, normal, simple). dynamic is usually fastest.

-output surface
    Set the output surface for video (e.g., overlay, opengl, surface). Default is platform-dependent.

-scaler scaler
    Set the scaler to use for stretching the screen (e.g., normal2x, hq2x, advmame3x).

-priority priority
    Set the priority of the DOSBox process (e.g., higher, highest, normal, low, lowest).

-title title
    Set a custom window title for DOSBox.

-captures dir
    Set the directory for screenshots and video captures.

-mapper
    Start the keymapper program to configure key bindings.

-log
    Enable logging to a file for debugging purposes.

-debugger
    Start DOSBox with its built-in debugger.

-nogui
    Disable the GUI (if available), primarily used for automated scripts.

DESCRIPTION

DOSBox is an open-source, multi-platform emulator that creates a complete IBM PC compatible environment, including a DOS operating system. Its primary purpose is to run classic MS-DOS games and applications on modern operating systems (like Linux, Windows, macOS) that no longer natively support the DOS environment or its direct hardware access methods.

DOSBox handles the emulation of the CPU, graphics, sound cards (Sound Blaster, AdLib, Tandy, GUS), and input devices, ensuring that even very old software can run with correct timing and hardware approximations. It's an invaluable tool for retro gaming enthusiasts, software archivists, and anyone needing to experience vintage DOS programs without requiring actual legacy hardware. Users can configure virtual drives, memory, and various hardware settings to tailor the emulation to specific software requirements.

CAVEATS

  • Performance can vary greatly depending on the host system's hardware and the complexity of the emulated software. CPU-intensive DOS applications might require significant host resources.
  • Optimal performance and compatibility often necessitate careful tuning of the dosbox.conf configuration file. Default settings might not be ideal for all programs.
  • DOSBox is an emulator for the DOS environment, not a full operating system virtualization tool. It is not designed to install and run full versions of Windows 95/98/ME, though it might support some lightweight Windows 3.1 installations.
  • Users might need to press Ctrl+F10 to release the mouse cursor from DOSBox's capture, especially when running in fullscreen mode.

THE CONFIGURATION FILE

DOSBox relies heavily on its configuration file (typically `dosbox.conf`) for setup. This file controls almost every aspect of the emulator, from CPU speed and memory to graphics, sound, and mounted drives. Users can edit this file to optimize performance or resolve compatibility issues for specific games and applications. It is often located in the user's home directory under a `.dosbox` subdirectory or alongside the DOSBox executable.

MOUNTING DRIVES

Before running most DOS programs, users must 'mount' directories on their host system as virtual drives within DOSBox. For example, the command MOUNT C /home/user/dosgames (or `Z:\> mount c c:\dosgames` if using the `-c` option) would make the `/home/user/dosgames` directory on the host system available as drive C: inside DOSBox. This step is crucial for accessing programs and data stored on the host machine.

KEYBOARD SHORTCUTS

DOSBox has several useful built-in keyboard shortcuts:
Alt+Enter: Toggle fullscreen mode.
Ctrl+F10: Release/capture the mouse cursor.
Ctrl+F11 / Ctrl+F12: Decrease / Increase emulated CPU cycles.
Ctrl+F9: Shut down DOSBox.

HISTORY

DOSBox development began in 2002 by a team of programmers seeking to run classic DOS games on modern operating systems. As operating systems like Windows XP and subsequent versions increasingly dropped native support for direct hardware access and 16-bit DOS applications, DOSBox emerged as a critical solution. Its open-source nature fostered a strong community, leading to continuous improvements and broad compatibility, making it the de-facto standard for preserving and running vintage DOS software on current hardware. It gained significant popularity due to its ease of use and ability to make many previously unplayable games accessible again.

SEE ALSO

qemu(1), wine(1), mame(6)

Copied to clipboard