Wine lets you play Windows-based game applications in Ubuntu. However, the default setup does not offer a perfect gaming environment. This is true for two reasons. First, different games might require that you use different gaming configurations with Wine registry tweaks; they might even be optimized for different Wine versions. Second, a default setup only has one registry configuration, which means that only one registry configuration will be used for all installed games.
For the optimal gaming experience, you need different Wine registry configurations for each of the games you play in Wine.
For example, if you play Starcraft Broodwar, it has its own Wine registry configuration. If you play Counterstrike Source, it also has its own registry configuration, which is different from the one Starcraft Broodwar uses. In this way, you will never need to worry that a single tweak in a registry configuration for that single game will affect other games.
The solution to this problem is to use WinePrefix.
This tutorial is for Wine beginner users in Ubuntu who want to optimize their gaming experience and need to learn about WinePrefix.
Understanding WinePrefix Operation
By default, after you have installed Wine in Ubuntu, all games will be installed in the /home/user/.wine/drive_c/Program Files.
The wine directory is also hidden in the user directory. To see the contents of the wine directory, you need to go to Places –> Home Folder. To reveal the wine directory, go to View and then check “Show Hidden Files.”
The hidden folders and files can now be seen. Click “.wine” directory. You should see files and folders like those shown in the screen shot below:
The drive_c is a virtual Windows C drive, and the system.reg/user.reg/userdef.reg are the registry files, similar to a Windows registry.
These registry files are the ones that will be tweaked to optimize your gaming experience in Wine (sound and direct3d adjustments, etc).
WinePrefix works by creating another Wine directory, aside from the original .wine directory. This new directory is where you can install other games that need dedicated registry configurations.
WinePrefix creates the same default files and folders as in the original .wine installation. This means a newly-created Wine directory also has its own dedicated virtual Windows C drive and registry files.
Suppose an Ubuntu user named “codex-m” needs to install three Windows-based games (Starcraft, Counterstrike, Warcraft) using WinePrefix. The following might be the resulting Wine file system structure created by both default wine and WinePrefix installation:
The default Wine directory path (in blue) is still there where default programs are installed (non-gaming applications for example). The 3 game-specific Wine directory path (yellow, green and pink) are created by Wineprefix.
Creating a game-specific Wine directory using WinePrefix
Now you have a clear understanding of how WinePrefix works. In this section you will learn how to create a game-specific Wine directory using WinePrefix.
Note that in this tutorial, I use exact values to illustrate actual examples or commands. Remember to replace these example values with your own file, folder and game application names.
You can create one game-specific wine directory at a time. The following are the steps:
Step 1. Go to Applications –> Accessories –> Terminal.
Step 2. Make sure you are in your user directory/directory. To be sure, type the pwd command at the Linux prompt; it should return /home/yourubuntuusername. For example:
Step 3. You need to create the game directory (using the mkdir command) first in your user folder/directory. Name the directory using the name of the game to be installed. Suppose a game called “Grand Theft Auto San Andreas” will be installed using WinePrefix in /home/codex-m directory:
codex-m@codex-m-desktop:~$ mkdir grandtheftauto
Step 4. Now that the grandtheftauto folder has been created, let's create the Wine system files and directories for this specific game using Wineprefixcreate:
codex-m@codex-m-desktop:~$ WINEPREFIX="/home/codex-m/grandtheftauto" wineprefixcreate
Note: Depending on your Ubuntu/Wine versions, the wineprefixcreate command is deprecated. But you can still run it; it might provide some warnings, which you can just ignore.
Screen shot at the Terminal: http://www.php-developer.org/screenshot/screenshotterminalwineprefix.jpg
What happens is that a game-specific wine directory has been created in /home/codex-m/. When you go to this path, a new folder, “grandtheftauto,” has been created with the same files as the default Wine installation shown previously. Here is a screen shot:
blog comments powered by Disqus