If you are seeing the error
Unable to access CD Drive when trying to play a game on DOSBox, this guide may be able to help you. These caveats apply:
- I am referring to DOS games as distributed by GOG.com. I do not know whether this can generalise to other game stores.
- My distro is currently Debian 11 (Bullseye). This is typically a good indicator that it should work on other current distributions, but your mileage may vary.
- I have been successful with Heroes of Might and Magic, Heroes of Might and Magic 2: Gold and Alone in the Dark. It may work with other games, but there is no guarantee.
So with that out of the way, let's proceed. I will use Heroes of Might and Magic as an example.
Install the game with Wine
First, you will have to download the "offline" version of the game, as available on your library on GOG.com after purchase:
You should now have a file called something like
setup_heroes_of_might_and_magic_1.2_(1.1)_(33754).exe. You can install it using Wine:
This will bring up a graphical wizard tool that should install the game. At the end there will be a "Launch" button, but unfortunately it will not work. That is not a problem and we will get to actually running the game in a moment:
After the installer has run, you should be able to find the installed files in your Wine directory:
1$ find $HOME/.wine/ | grep -i heroes 2$HOME/.wine/drive_c/GOG Games/HoMM/HEROES.EXE 3$HOME/.wine/drive_c/GOG Games/HoMM/HEROES.CFG 4(...many files listed...) 5$HOME/.wine/drive_c/ProgramData/Microsoft/Windows/Start Menu/Programs/GOG.com/Heroes of Might and Magic/Documents/Manual.lnk 6$HOME/.wine/drive_c/ProgramData/Microsoft/Windows/Start Menu/Programs/GOG.com/Heroes of Might and Magic/Documents/Support.url
Situation after install
If you try running the game with Wine or DOSBox (providing the path to
HEROES.EXE) it will not work either. Wine will tell you that the game
is a DOS application, you need to install DOSBox, while DOSBox will tell you
Unable to access CD Drive.
OK, so let's get that CD Drive going now. The installation includes an ISO image of the CD, so we need to tell DOSBox about it. The file has the
.gog extension and it can be found among the installed files:
(Note: in some cases, the file you need is not the one with the
.gog extension. More detail below.)
This is the process:
- Open DOSBox on the game directory.
- Mount the ISO image as a CD-ROM drive.
- Run the game.
So let's do just that.
Actually running the game
First run DOSBox on the game directory:
By passing the game directory as argument, we get the
C: drive mounted there. So in the example above, directory
C:\ within DOSBox is the same as folder
$HOME/.wine/drive_c/GOG\ Games/HoMM in my Linux machine. This will mean fewer keystrokes for us in the next steps, as well as the safety of the DOS software not being allowed access all of our hard drive.
Now we can use the tool
imgmount within DOSBox to mount the ISO image as drive
D:, like so:
If that worked correctly and you got similar output, you should now be able to run the game from within DOSBox:
And the game should now launch succesfully.
A variation: different directories and the
I was able to run Alone in the Dark with a couple of variations on this method.
An initial but minor detail is that this game is bundled with files split into two directories:
JACK, corresponding to the game proper and the bonus spin-off Jack in the Dark. However the ISO file is still in the root directory:
So when we run the game, we will need to
cd into the
INDARK directory and then actually run
A more important detail is that mounting the ISO image
GAME.GOG is not enough. Instead it is the file
GAME.INS that has to be provided to
imgmount. This file appears to be a sort of playlist that points to
GAME.GOG while also providing info about audio tracks in the CD.
So with these two details in mind, the game can be run as follows. Start by running DOSBox on the game directory:
Then mount the ISO image, but via the
Finally, we go into the
INDARK directory and run the game:
And that should land you on the mansion of horrors.
However note that the presence of a
.ins file is not guarantee that this is the correct file to use. In the case of Heroes of Might and Magic 2: Gold, the file is present but I could not get the game to work correctly if I used the
.ins file instead of the
.gog file. Go figure.
Taking a shortcut
To avoid running three commands every time you want to play the game, you can use the argument
-c to DOSBox, which allows you to run it with prepared commands ahead of the target program. In my example of Heroes of Might and Magic, it would be like this:
1$ dosbox "$HOME/.wine/drive_c/GOG Games/HoMM/HEROES.EXE" -c "imgmount d \"$HOME/.wine/drive_c/GOG Games/HoMM/homm1.gog\" -t iso"
And this is a variation for the case of Alone in the Dark:
1$ dosbox "$HOME/.wine/drive_c/GOG Games/Alone in the Dark/INDARK/INDARK.EXE" -c "imgmount d \"$HOME/.wine/drive_c/GOG Games/Alone in the Dark/GAME.INS\" -t iso"
Those lines are a mouthful, but you can use them to create shortcuts and run the games with short commands. Watch out for the spaces, escaping, etc!
The GOG install also provides configuration files for DOSBox, which look like this:
These include launchers for several situations, as well as tweaks for DOSBox such as default fullscreen mode, clock speed settings, etc. I have been experimenting with them a bit, and I have not been able to make them work as provided. My impression is that they have two problems:
- They assume a Windows host (instead of Linux), so they reference paths with backslashes (eg:
..\GAME.INS) in contexts where a host path is required. I was able to make them work by changing those to forward slashes (eg:
- They reference at least one feature (mount overlays) present in DOSBox v0.75, which is actually from the non-official fork that GOG distribute with the game.
But these files are not really necessary and I have not needed them to play the games. Still they may be interesting to you, so it is worth being aware of them.
I pieced this guide together after reading articles on the topic from FreezeNet, DOSGamers, the DOSBox Wiki, and a forum post that I cannot find now (!) but was particularly useful.
Perhaps there's an easier way to do all this and I missed it, as I'm not a hard-core gamer. If you find it, please hit me up with it on the socials!