Wine Environment Variables
WINEPREFIX
Wine uses a virtual C: drive instead of your real C: drive. The directory in which this is located is called a wineprefix.
When you open any application using Wine, it will use the default location for wineprefix which is ~/.wine
, but you can change this location by using WINEPREFIX environment variable.
You can find more about wineprefix in this link » [link]
How to use WINEPREFIX
Open the terminal, and type this command:
|
|
If you want to install 7z1900-x64.exe using Wine on a wineprefix at the home folder with the name wine-test, you can use this command:
|
|
- If you define a wineprefix that does not exist, Wine will create a new wineprefix with the name and location you defined.
- Wine creates 64 bit wineprefix by default which can be used to run 64 bit applications, and 32 bit applications as well, but there are some significant bugs that prevent many 32 bit applications from working in a 64 bit wineprefix. To solve this issue, you can create a new 32 bit wineprefix using the
WINEARCH
environment variable.
WINEARCH
WINEARCH
environment variable can be used to define the architacture of the wineprefix you want to create (32bit, or 64bit). It is mostly used to create 32 bit wineprefix which is needed to install and to run 32 bit applications.
How to create 32bit wineprefix
Open the terminal, and type this command:
|
|
WINEDLLOVERRIDES
Wine uses its internal builtin DLLs by default, but It is not always possible to run an application on builtin DLLs. Sometimes native DLLs simply work better. Although these DLL overrides can be set using winecfg, you might want to use the WINEDLLOVERRIDES
environment variable to set them.
When DXVK is installed on a wineprefix, d3d9
, d3d10core
, and dxgi
will be set to native, so if you want to set all of them to builtin with a certain game, you can open the terminal, and type this command:
|
|
There are 4 different override options to choose from
Override option | What it does |
---|---|
b | (Builtin): Use the DLL provided by Wine |
n | (Native): Use the DLL provided by Windows |
b,n | (Builtin then Native): Try to load Builtin DLL first, and if it fails, load Native DLL |
n,b | (Native then Builtin): Try to load Native DLL first and if it fails, load Builtin DLL |
WINE
Winetricks uses the default wine installed on your Linux distro, but you can use custom wine build by using WINE enviornment variable like this example:
|
|
WINEESYNC
-
Wine Esync is used to increase performance a little bit with some games, but it could crash your games during loading or during playing the game, so it is recommended to use Wine Fsync instead.
-
Wine Esync is not included in Wine-Staging anymore, but it is included in Wine-TKG, and Wine-GE.
-
WINEESYNC is turned off by default in Wine, and in order to use it, you need first to check if your Linux distro supports it before enabling it, or your will get an error like this: eventfd: Too many open files and then things start crashing, because you’ve probably run out of file descriptors. Esync creates one eventfd descriptor for each synchronization object, and some games may use a large number of these.
Linux by default limits a process to 4096 file descriptors which probably was reasonable back in the 90s but is not anymore. Fortunately Linux distros like: Debian, Ubuntu, and Linux distros that are based on Debian or Ubuntu have a reasonable number of file descriptors by default. I do not know what other Linux distros that increased the default limit to a reasonable number, but if you want to check, open the terminal, and type this command:
ulimit -Hn
If it returns with a number like: 1048576, then you are safe, but if it returns with a lower number, you need to increase it.
How to increase the limit of eventfd file descriptors
- Open the terminal, and type this command:
|
|
- Add this line:
|
|
-
Press ctrl + x to close the file, and press Y, then enter to confirm the changes.
-
Restart your session.
But on Linux distributions using systemd (most of Linux distros use systemd), the settings in /etc/security/limits.conf
will be overridden by systemd’s own settings.
If you run ulimit -Hn
and it returns a lower number than the one you have previously set, then you need to add this line:
|
|
in both /etc/systemd/system.conf
and /etc/systemd/user.conf
Then use this command:
|
|
and restart your session.
How to use WINEESYNC
WINEESYNC is not enabled by default, you need to enable it manually when launching Wine like this:
Open the terminal, and type this command:
|
|
After you open any application with WINESYNC enabled, you will see a terminal message like this:
esync: up and running.
-
WINEESYNC environment variable can only be used with Wine-Staging.
-
You do not need to enable WINEESYNC with Proton, because It is enabled by default.
-
If you open one application with WINEESYNC enabled, and wineserver still working in the background, you can not open another application without enabling WINEESYNC for this application as well, or it will fail to start, but you can kill wineserver using this command from the terminal:
|
|
or this command:
|
|
More information about Wine Esync can be found in this link » https://github.com/zfigura/wine/blob/esync/README.esync
WINEFSYNC
Valve offers fsync as a replacement for esync, because esync relies on the kernel’s eventfd() functionality which needs special setup and can cause file descriptor exhaustion problems in event-hungry applications.
How to use WINEFSYNC
Open the terminal, and type this command:
|
|
After you open any application with WINEFSYNC enabled, you will see a terminal message like this:
fsync: up and running.
DRI_PRIME
If you use a laptop with a dedicated AMD GPU, you will need to use DRI_PRIME environment variable to run any OpenGL games using your dedicated GPU on any Linux distribution, or when you try to run Direct3D game using WineD3D. It is not needed when you use a Desktop PC, or when running Vulkan games, or games running through DXVK, because they use your dedicated GPU by default, so if you run a Vulkan games, or you have DXVK installed inside a wineprefix, you do not need to use DRI_PRIME environment variable.
How to use DRI_PRIME
|
|
-
This command only works with AMD dGPUs only.
-
If you use a laptop with a dedicated Nvidia GPU, you need to use Nvidia PRIME instead.
Nvidia PRIME
Vulkan
For Vulkan games, and games running through DXVK use this env variable:
|
|
OpenGL
For OpenGL games, and games running through WineD3D use this env variable:
|
|
GameMode
GameMode optimizes Linux system performance on demand. It is made by Feral Interactive which ports native games for Linux and MacOS. (You need to install GameMode first before using it). For more information follow this link » https://github.com/FeralInteractive/gamemode
How to use GameMode
Open the terminal, and type this command:
|
|
vkBasalt
vkBasalt is a vulkan post processing layer for linux. It is similar to ReShade (You need to install vkBasalt first before using it). For more information follow this link » https://github.com/DadSchoorse/vkBasalt
How to use vkBasalt
Open the terminal, and type this command:
|
|
AMD FSR
You can use AMD FSR on any Windows Vulkan game, or a game running through DXVK or VKD3D, but you need an AMD GPU.
How to use AMD FSR
Open the terminal, and type this command:
|
|
You can control image sharpness using this variable » WINE_FULLSCREEN_FSR_STRENGTH=[N]
[N] can be replaced by a number from 5 to 0 (5 is the minimum, and 0 is the maximum)
|
|
WINE_FULLSCREEN_FSR_STRENGTH=[N]
, the default value will be used » 5MangoHud
MangoHud is a Vulkan and OpenGL overlay for monitoring FPS, temperatures, CPU/GPU load and more (You need to install MangoHud first before using it). For more information follow this link » https://github.com/flightlessmango/MangoHud
How to use MangoHud
Open the terminal, and type this command:
|
|
OpenGL
You need to add MANGOHUD_DLSYM=1 before mangohud env variable for some OpenGL games that may also need dlsym hooking (most of them need it).
|
|
Mesa overlay
Mesa overlay displays GPU name, driver version, FPS, and frametime (This overlay only works only with Vulkan games and games running through DXVK, and it only works with AMD and Intel GPUs).
How to use Mesa overlay
Open the terminal, and type this command:
|
|
Gallium HUD
Gallium is another HUD from Mesa which works only with OpenGL games.
How to use Gallium HUD
Open the terminal, and type this command:
|
|
DXVK HUD
DXVK HUD displays many useful information like fps, frametimes, GPU load, and VRAM. For more information follow this link » https://github.com/doitsujin/dxvk
How to use DXVK HUD
Open the terminal, and type this command:
|
|
PULSE_LATENCY_MSEC
This environment variable that can be used to delay the sound to fix sound issues like the constant crackling sounds that happens with some games like Battlefield 1, and The Elder Scrolls - Skyrim - Special Edition.
How to use PULSE_LATENCY_MSEC
Open the terminal, and type this command:
|
|
WINE_LARGE_ADDRESS_AWARE
This environment variable can prevent 32bit games running through dxvk from crashing after reaching 4gb of RAM.
WINE_LARGE_ADDRESS_AWARE
|
|
How to use Windows command line arguments
You can use Windows command line arguments on Wine by adding them after the executable of the game.
The Medium (video game) uses DX11 by default, but if you want to change it to DX12, you can use the command line arguments -dx12 by following these steps:
Open the terminal, and type this code:
|
|
If you have any questions, write it down below, or you can contact me directly by my E-mail account.
If you want to get notified when we post a new content by adding our RSS feed to your feed list, or by joining our Telegram channel.
If you find this post helpful, please consider sponsoring.
Sponsor