How to setup a cdrom drive in Wine

Solution 1:

Set wine to see /media/wincd as its cd drive then with the iso file in you home folder run in terminal:

sudo mkdir /media/wincd
sudo mount -o loop -t iso9660 $HOME/mygame.iso /media/wincd
sudo ln -s $HOME/mygame.iso $HOME/.wine/dosdevices/d::

The mkdir command ensures the /media/wincd folder is present to mount the iso.

Change mygame.iso to the name of your iso file.

Change d:: at the end of the second command to a different letter with two colons if the cd is not drive d.

Solution 2:

I just solved this myself (installed StarCraft under Wine) and I ran into the same issue. Here are my notes for how to install and run StarCraft (from a legitimate original CD-ROM) on Ubuntu 20.04 under Wine.

First, I dislike relying on the CD-ROM itself, as it may get scratched or damaged, so the first step I took was to copy the CD-ROM into an ISO file. (Saves wear and tear; the CD-ROM itself stays on my shelf now.)

sudo cat /dev/sr0 > ~/starcraft.iso

Once this command completes (which takes a while), the CD-ROM can be removed. Next, create a mountpoint and mount the ISO file. I did this with the following in /etc/fstab:

/usr/local/games/disks/starcraft.iso /usr/local/games/mnt/StarCraft iso9660 loop,ro 0 0

Followed by sudo mount /usr/local/games/mnt/StarCraft.

At this point is when I ran the setup.exe file in that directory, which allowed me to install StarCraft (using the code on the original CD-ROM case). That worked fine, but then clicking "Play StarCraft" showed the error:

Starcraft is unable to read a required file. Your Starcraft CD may not be in the CDROM drive. Please ensure that the Starcraft disc is in the CDROM drive and press OK. To leave the program, press Exit.

I found an ars technica thread which gave the solution, which I'm quoting here in case of link rot:

  1. Run 'winecfg'.
  2. Click on the 'Drives' tab. The existing drives are 'C:' ('~/.wine/') and 'Z:' (the Linux root -- '/').
  3. Click the 'Add' button to add a new drive. (The new drive will be called 'D:' since it is after 'C:'.)
  4. In the 'Path:' field, enter the mountpoint of your CDROM drive, where the Starcraft CD will be mounted. Typically, this would be '/cdrom/'.
  5. Click 'OK' to exit winecfg.
  6. Mount your Starcraft CD at '/cdrom/' if you have not already done so.
  7. Run Starcraft.

(In my case, in step 4, I entered /usr/local/games/mnt/StarCraft.)