How to use a .conf file with dosbox

What is dosbox?

Dosbox is a virtual machine that emulates the MS-DOS operating system within non-DOS-based Windows. Normally a natively DOS program, especially a game, that tries to run under Windows can run into serious problems. However, when you run that same program under Dosbox, Dosbox makes it believe that it's running under pure MS-DOS, and almost all programs will run happily (if you have enough processor power to run the virtual machine at a decent speed!).

What is a ".conf file"?

A .configuration file is a set of instructions to Dosbox that tell it exactly what kind of machine it should pretend it is and what that machine should have. For example you can tell Dosbox at what speed it should attempt to run (was your program designed to run on a 12mhz 286, or a 66mhz 486DX-2?), or that it should pretend to have a Gravis soundcard instead of a Soundblaster.

The .conf file also lets you have dosbox execute a number of instructions automatically when it starts, so that you can skip the normal startup steps, like having to mount a drive.

Since you can start Dosbox with any .conf file you want through its command line, building one of these files can turn any emulated program into a one-click shortcut that behaves exactly like a normal Windows program.

What you will need

Instructions

  1. Find where your Dosbox installation folder is. See if you have a "dosbox.conf" here. If not, you will need to start dosbox and type: "config -writeconf whatever.conf". Then you'll have a whatever.conf in your dosbox directory.

  2. Decide whether your configuration files will live in the dosbox directory, or with the program, or some other arbitrary place. It's a pain to change this after the fact, so decide on a system and stick with it. I personally favor putting the .conf files in with the programs they go to. Wherever you opt for, copy the dosbox.conf file into this location. You can rename the file if you like (and if you keep them all in the same place obviously you need to).

  3. Now you will want to edit the new configuration file so that it does whatever devious things need doing. Conf files are plaintext, and can be editted in standard Windows Notepad or whatever other tool you prefer.

    In my case, the game I want to run does not play nicely with Dosbox's auto speed, so I need to set the speed manually. Each configuration file effectively sets up an entirely different virtual machine configuration, so you can tweak each .conf file without fear of messing any other dosbox program up. Easier than custom boot disks eh?

  4. After you adjust the dosbox configuration, if needed, scroll to the end of the file and find the [autoexec] tag. Anything after this point will be run automatically when this .conf file is invoked, exactly as if you typed it yourself at the keyboard. Refer to the Dosbox documentation if you're unsure how to proceed. Save and exit when done. An example:

  5. Now, decide where you want the shortcut to your dos program to be. I'll use the desktop for now. Create a shortcut to dosbox.exe by right-click-and-dragging it to the new location:

  6. Right click the shortcut and choose Properties. Go to the Shortcut tab. In the field "Target:", go to the end of the line and add (note the space) " -conf {path to your .conf file}". If the path has spaces inside it, you'll need to put it in quotes starting with the drive letter. Apply your changes.

You are done.

Starting the program in dosbox, with all your settings and commands, should now be as easy as double-clicking the shortcut you edited.