Automatically Mounting A Directory As A Drive In DOSBox On Linux

DOSBox is an amazing way of running old programs on new hardware, but when you start the program you need to mount the relevant directories before you can use the programs.

To mount a directory use the following command (inside DOSBox).

mount c /home/user/somedirectory

You can now change to the "c" drive to use the mounted directory.

The only issue is that you need to do this every time you start DOSBox.

To get around this you need to create autoexec commands that will automatically mount the correct directory when you start DOSBox. Inside DOSBox, run the following command (replacing the "user" with your current username).

config -writeconf /home/user/dosbox.conf

This will create a configuration file in your user directory.

Now, quit DOSBox by typing "exit" and edit the newly created dosbox.conf file in your editor of choice. Scroll down (quite a way) to the section marked with "[autoexec]", this section will detail commands that are run every time you start DOSBox.

Add the following line to this section, adding multiple lines if you need multiple directories to be added.

mount c /home/user/somedirectory

Now, when you start DOSBox the directories listed here will be mounted automatically. You just need to change to the "c" drive (or the drive letter you specified) and start using it.

You can do the same thing with CDROM drives, but the command here is slightly different. Once you have the CDROM mounted in Linux you need to supply the "-t" flag to stipulate that the drive is of that type.

mount d /media/cdrom0 -t cdrom

The drive letters might vary here, depending on your Linux distribution and setup.

Add new comment

The content of this field is kept private and will not be shown publicly.