• Civilization 7 has been announced. For more info please check the forum here .

[Civ2] Running Civ2 MGE on a Linux Virtual Machine

lexloafron

Chieftain
Joined
Jun 9, 2024
Messages
2
Hello all, I put together a guide on an alternative way to run Civ2 MGE on Windows 10. In theory, this should work on any version of Windows that supports VirtualBox, though I have only tested this on Windows 10.
I didn't see a similar guide in other threads so thought I'd share it here.

Forgive the janky links. Apparently, CivFanatics doesn't support Markdown format? A .md version of this guide is attached to this post if you'd rather view it in its original markdown format.

A note before beginning​

This guide was written assuming the user has minimal experience with virtual machines, Virtual Box, or Linux in general. If you have experience in these things, you can probably skip a lot of the description.

Caviats​

  • The game sounds have a strange popping sound that I haven't figured out how to fix yet. Or if it's fixable at all. It seems to be related to how WINE works with sound cards and sound drivers
  • this is tested for Civ2 MGE. I see no reason it wouldn't work for other versions, but your mileage may differ.

Prerequisites:​

  • linux mint 21.1 iso image, (download from here: https://www.linuxmint.com/edition.php?id=305)
    • I used Mint 21.1, you can probably use the latest version, but you may need to use the latest Wine version then.
  • installed Oracle VirtualBox
  • Either a .iso digital copy of the Civ2 cd of your choice, or a .bin and .cue digital copy of the Civ2 cd. You will need to obtain these yourself.
    • If you have a working Civ2 CD, the way that uses the least amount of sketchy software is to do this on Linux using either the [dd command](https://askubuntu.com/a/226933) to get an .iso or [cdrdao recommended by the Arch Wiki](https://wiki.archlinux.org/title/Rip_Audio_CDs) to get a .bin and .cue.

VM setup instructions​

These are just the steps to setting up a regular virtual machine running Linux Mint using Virtual Box.
You could also refer to [this random video off YouTube](https://www.youtube.com/watch?v=2VNLewtNk1A) or any other video or resource for installing VirtualBox and a Linux Mint VM
  1. in virtualbox, click New
  2. give the virtual machine an appropriate name, (like minty-civ2), specify the directory its files are supposed to go, if you don't like the default location
  3. click the ISO Image dropdown > other > select the linux mint iso file you downloaded
  4. check the Skip Unattended Installation checkbox if it's there (unattended install didn't work for me when I did it)
  5. click Next
  6. give the vm 4096 B of ram and 2 processor cores (or more if you want, but mine seemed to work with 2)
  7. click Next
  8. leave the virtual hard disk settings at their default (create a virtual hard disk now, 25 GB capacity, and pre-allocate full size left unchecked)
  9. click Next, review the summary, and click finish
  10. select the virtual machine and click start
  11. Let the virtual machine boot up. It will take you to a black screen with white text (welcome to the grub menu). The top option should be selected and it should say something like "Start Linux Mint 21.2 Cinnamon 64-bit". Select that option with the arrow keys if necessary, and press Enter
  12. Once it boots into the desktop, doubleclick the "Install Linux Mint" cd shortcut.
  13. click through the installer. Most of it is language and keyboard layout, time zone, username/password, etc. At the 4th page, check the "install multimedia codecs" box before clicking continue
  14. at the install page (5th page) select "Erase disk and install Linux Mint" (this is only writing to the vdi, since it's a virtual machine) and click Install Now.
  15. click continue in the confirmation popup
  16. select timezone and click continue
  17. set name, computer name, username, and password. (I used vbox, minty-civ2-vm, vbox, a). I left it set to "Require my password on log in" and did not check "Encrypt my home folder".
  18. click continue and let it install. this may take a few minutes
  19. Click "Restart Now" when the "Install Complete" screen pops up
  20. It will go to a black screen with the Linux Mint logo, and a message saying "Please remove the installation medium, then press ENTER." The linux mint iso might be automatically removed by virtualbox, but check in the little cd icon in the bottom bar of the window (the IDE Secondary Device 0). Then press ENTER once you've ensured the iso is removed.
  21. You'll be taken to the login screen for the vbox user. Enter your password and you should boot into a clean Linux Mint install

Installing support software on the virtual machine​

notes​

  • when running sudo, you will be prompted for your password, since it's the run as admin command
  • installation commands will prompt you to enter y or n to confirm or deny installation

installing guest additions​

Guest Additions is an add-on for VirtualBox provided by Oracle. Installing it allows easy virtual machine resolution resizing and useful things like shared folders and sharing clipboard (copy on the host machine, paste into the guest machine, and vice versa)
open the terminal with Ctrl+Alt+t or clicking it in the toolbar. it should be the third option
run the command sudo apt install virtualbox-guest-x11 to install virtualbox guest additions.
reboot the virtual machine for guest additions to take effect
at this point, in the file bar, I would select Devices > Shared Clipboard and set it to "Host to Guest" so that you can copy text from your main computer into the virtual machine.

installing wine​

WINE is a tool that will allow a Linux machine to Windows programs.
Note that the following commands are specific to Linux Mint 21.1. For an updated set of instructions, see [this wine guide](https://wiki.winehq.org/Ubuntu). It's for Ubuntu because Linux Mint is itself based on Ubuntu.
Run the following commands in the virtual machine's terminal to install wine:
sudo mkdir -pm755 /etc/apt/keyrings
mkdir: make directory
  • p create parent directories as necessary (i.e.: if /etc or /etc/apt didn't exist, make them too)
  • m755 sets the permissions of the `keyrings` folder. don't worry about it
  • running this will ensure that the keyrings folder exists.
sudo wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
  • sudo: superuser do. this runs the command as admin. you will be prompted for whatever password you selected when creating the virtual machine
  • wget is a web download command
  • -O specifies where to write the one file you are downloading with this command (winehq.key)
  • this is to download the certificate for verifying the wine sources that we are about to add so that the OS will trust the sources
sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/jammy/winehq-jammy.sources
  • another wget
  • -N switch is something to do with timestamps
  • -P specifies what directory to put the downloaded file in (in this case `/etc/apt/sources.list.d/')
  • this is to download files to tell the apt package manager where to find latest wine
  • /!\ If you are using a Mint later than 21.1, you may need to change `jammy` to the code-name of the Ubuntu version that your Linux Mint version is based on.
sudo apt update
  • this tells the apt package manager to refresh its data, including its source information like what we just added
  • it will also download any available updates for installed packages
  • it will probably tell you to run `sudo apt upgrade`, do that if you want to leave this machine connected to the internet for tinkering, but if you don't want to, just ignore it
sudo apt install --install-recommends winehq-stable
  • this tells the apt package manager to install the winehq-stable package, which contains the latest stable version of wine, and its dependencies
  • this may take a few minutes

configuring wine​

run winecfg in the terminal. It should bring up a window asking you to install Wine Mono.
Click install.
Once the mono installer is done, winecfg will open.
This will bring up a ui for configuring Wine. near the bottom, there is a dropdown menu for "windows version." Select Windows XP, then click OK

installing Civ2​

These instructions assume you are using a .iso file.
If you instead have a `.bin` and `.cue` file pair, skip to [the next section](#setting-up-a-shared-folder) to set up a shared folder, copy the `.bin` and `.cue` into the virtual machine, and skip to [the music section](#if-you-want-to-have-the-music) to set up using the `.bin` and `.cue`. Whenever the following instructions refer to mounting the `.iso`, mount the `.bin` and `.cue` instead.​
  • insert the Civ2 iso file in the virtual machine via virtualbox by right-clicking the little disk at the virtualbox window's bottom bar, and selecting the civ2 iso file.
  • a cd named `Civ2:MGE v1.0` should appear on the desktop. doubleclick it to open it in file explorer. Rightclick in the file explorer window and click "open in terminal"
  • In that terminal, run the command `wine Autorun.exe`. This should bring up the Civ2 autorun menu, and you should install as normal. I let it install in its default c drive location (this is actually just a folder in `<your user's home folder>/.wine`), choose typical install, left its program folder at default, allowed it to make a desktop shortcut, and did not register or verify directX 5 compatability.
  • I unchecked view readme in the Setup Complete window, but left "Install Intel Indeo drivers" checked, then clicked Finish. It may give an error that it "couldn't run the Indeo installer, please run it from the disk", or something like that.
  • If this happens, then back in the terminal, run `cd "Win_95nt Indeo"` and then run `wine IVI_95NT.EXE`. This should bring up the indeo installer. Click through it; install for a Window NT system (it's the default option); don't bother reading the release notes.
  • now we need to run the civ2 patcher, so we get to set up shared folders after all..

setting up a shared folder​

  1. run `sudo usermod --append --groups vboxsf <your vbox user>` (for me the command is: `sudo usermod --append --groups vboxsf vbox`)
    1. linux is weird. you need to be a member of the vboxsf group to access shared folders.
  2. shut down the virtual machine
  3. in the virtualbox window, select the virtual machine, click settings, click "Shared Folders". Click the tiny little folder with a plus icon on the right side of the new window, near the top.
  4. click the "folder path" button and select the folder you want to share. I recommend making an empty folder that you copy whatever files you want to share into rather than just sharing an existing folder
  5. Folder name should auto-populate. Check the automount box and click ok
  6. click ok in the shared folder settings window.
  7. Start the vm back up

running the civ2 patcher​

This patcher was created by FoxAhead and can be found [on GitHub](https://github.com/FoxAhead/Civilization-II-64-bit-Editbox-Patcher). It fixes a rather game-breaking issue with Civ2 on Windows 10 and beyond that causes the game to crash any time a text box is brought up, which happens when you build a city, among other places.
  1. in the host, copy the `civ2patcher.exe` into the shared folder you created
  2. in the virtual machine, open the shared folder in the terminal
  3. run `wine Civ2x64EditboxPatcher.exe`
  4. click browse in the patcher window
  5. navigate to what wine thinks is the C drive, and find civ2.exe in program files (x86)
  6. Select civ2.exe and click "Patch!" and "yes"
  7. close the patcher
now you're almost ready to run civ2.
For me, civ2 had an issue where it would resize its windows as screens changed in civ2 (for instance, it would resize the civ2 window when you clicked "OK" in any of the menus for creating a new standard map. When you got into the actual game, this would mess up the UI, so it couldn't be played.)
to fix this, run winecfg, select the graphics tab, check the "Emulate virtual desktop" box, and select a resolution for the desktop size (I used 1600x900)

if you want to have the music​

(and who wouldn't?)
At this point, civ2 should be playable, except with one problem:
The in-game music does not play and can't be started. This is because of technical limitations of the .iso file format. A .iso file cannot encode music tracks, so it's not possible to play the music with a .iso.​
A .bin and .cue pair of files can encode music tracks, so to get the music to play, we need a copy of the civ2 disc as a .bin and .cue file pair
To mount the bin/cue, we will install the cdemu package in the virtual machine.

install cdemu​

Cdemu is in a Private Package Archive (PPA) rather than official ubuntu repositories. add the ppa, and install it with:

Code:
sudo add-apt-repository ppa:cdemu/ppa
sudo apt update
sudo apt install gcdemu

mounting the bin/cue​

use the following command to mount the bin/cue

Code:
cdemu load 0 <path to .cue>
           ^the index of the cdemu device to mount on
      ^command to mount a bin/cue

making sure wine correctly recognizes the audio portion of the cd​

make sure that after you install cdemu and mount the bin/cue for the first time, you remove the drive that wine made for the civ2 iso, and add the device file that cdemu mounts the bin/cue to.

removing the iso drive
  • run winecfg
  • go to the "Drives" tab
  • click the letter of the drive that has the Civ2 iso in it (it should be named something like "Civ2MGE v1.0")
  • click "remove"
adding the bin/cue drive
  • now click "Add". this will bring up a small window where you select the drive letter that wine will assign this drive to. I recommend D or E.
  • select the newly-added drive and click the path text box and enter the device path that cdemu mounts device 0 to. Usually cdemu mounts to /dev/sr0, but you can verify this in the cdemu gui.
verifying bin/cue mount point
run gcdemu in the terminal. This will add an icon to your toolbar tray.
right-click the tray icon, and click "Device #00"
in "device mapping" it will show "SCSI CD-ROM device:" The path this is set to is what you should set the Wine drive to point to.

Conclusion​

At this point, you should be able to mount the bin/cue with the cdemu load command above if it isn't mounted already, and run Civ2 complete with music
 
Hello all, I put together a guide on an alternative way to run Civ2 MGE on Windows 10.
I'm feeling kind off confused with that ?

Civ2MgeWin10.gif
 
Genuinely curious what your use case is for doing it this way. That's quite the tower of compatibility layers!
 
Genuinely curious what your use case is for doing it this way. That's quite the tower of compatibility layers!
My reasons for this method are:
  1. Getting the videos working. In my experience, the videos (intro, wonder videos, high council advisors, emissaries) only work on Win10 if you enable Windows XP compatibility mode. But my systems slow to a snail's pace when I do this. In the above method, the videos work out of the box.
  2. future-proofing: Windows could at any time change something in an update that breaks something. WINE and Linux distributions are typically quite good about maintaining archives of old versions, so even if a later update breaks something, you can still revert to an old version. Also, this avoids the eventuality of when Windows stops supporting 32-bit programs in later Win 11 or the eventual Win 12.
  3. cross-platform. This solution should work just as easily on a Mac or Linux system as on Windows. Though this kind of only applies if you have an Intel Mac computer.
  4. Minimal dependence on sketchy programs. All the parts (linux, WINE, VirtualBox, etc) are either open source or trustworthy. Other similar solutions like running a Windows XP vm require you to be able to activate a Windows XP vm, and get a windows key for that. From what I've seen, the places you can get old windows images don't look very trustworthy. Similarly, to get the music working, you need to use something like Alcohol 120%, which is paid, and I don't particularly feel like trusting it.
 
Top Bottom