Jump to content

The ultimate guide on how to run PKHeX on Linux [updated 04/2024]


Taku86

Recommended Posts

I know there are already some threads about running PKHeX on Linux (like this or this) but they are all outdated and none of them is simple and straightforward enough. I feel like there’s still a lot of confusion about PKHeX and Linux, especially for what happened recently when the program switched from .NET 7 to .NET 8, so I’m making this thread hoping for it to become the ultimate reference for this subject. I'll keep it up to date.

---------------------------------------------------

Latest PKHeX version: 24.03.26
Status: WORKING
Known bugs:

  1. Drag & dropping save files into the program's window isn't really stable and could lead to a crash. This usually happens when you import/export boxes in a save file, and then import another one into the program. Always make a backup or try to avoid drag & drop at all by only using the File > Open option.

---------------------------------------------------

1) Installing Wine
Vanilla Wine is more than enough to run and use PKHeX, however it isn't stable enough if you use plugins (.dll files from the plugins folder), as you'll notice that some plugins prevent the program from starting. If you use plugins, the recommended version of Wine is Wine Staging, which includes more up-to-date patches that support much more plugins.
Please refer to your distribution's documentation if you don’t know how to install Wine or Wine Staging. Just make sure to be at least on version 9.3 (or higher), this is very important.

Using PKHeX is a matter of a couple of commands and everything will work fine without having to go through a bunch of settings in programs like Lutris and Bottles, which I don't recommend unless you know what you are doing.

2) Creating a Wine prefix
It's better to create a separated Wine prefix (the “Windows environment”, for those who don’t know what a prefix is) so that it won't conflict with others (if you have any). You can do that with the following command:

WINEPREFIX=/path/to/your/prefix/pkhex wineboot

Replace /path/to/your/prefix/pkhex with the folder you want to create the prefix in. For example:

WINEPREFIX=/home/anon/Prefix/pkhex wineboot

Let it set up everything. If it asks for the Mono installation you don’t need it, so you can click on cancel.

2024-02-25_17-47.png.e00a7b262917e469fd04f04223658304.png

3) Installing .NET Desktop Runtime 8
PKHeX needs the 64 bit version of .NET Desktop Runtime 8 to work. You can download it from here.
This is the global page with every download link, just in case the given link dies because of a version change (it is currently 8.0.4).

Launch the following command to start the installer:

WINEPREFIX=/path/to/your/prefix/pkhex wine /path/to/the/installer/windowsdesktop-runtime-8.0.4-win-x64.exe

As seen before replace the paths with your own ones. For example:

WINEPREFIX=/home/anon/Prefix/pkhex wine /home/anon/Downloads/windowsdesktop-runtime-8.0.4-win-x64.exe

Go through the installation process.

2024-02-25_17-57.png.07570e04b79dfaeb125c8aa9afa776b3.png

3.1) CJK fonts
CJK stands for Chinese, Japanese and Korean. These fonts are not shipped by default with Wine, therefore names or OTs of Pokémon in these languages won't be displayed. The "shinify" icon is also affected by this. Although this is optional, we can fix this by installing CJK fonts with Winetricks (you have to install the package first):

WINEPREFIX=/path/to/your/prefix/pkhex winetricks cjkfonts

Again, replace the path with the one of your prefix.

WINEPREFIX=/home/anon/Prefix/pkhex winetricks cjkfonts

This could take a while, so be patient.

4) Launching PKHeX
PKHeX can now be launched with this command:

WINEPREFIX=/path/to/your/prefix/pkhex wine /path/to/pkhex/executable/PKHeX.exe

In my case:

WINEPREFIX=/home/anon/Prefix/pkhex wine /home/anon/Games/Pokémon/PKHeX/PKHeX.exe

2024-02-25_18-27.png.459d235e718a5c43c6fd64d44cc37e2e.png

4.1) Note on .NET
If you have .NET installed on your system (it is available natively for Linux, it's the Desktop Runtime needed by PKHeX that isn't) PKHeX might not launch. If this is the case for you make sure to add the following arguments to the command:

WINEPREFIX=/path/to/your/prefix/pkhex env -u DOTNET_ROOT -u DOTNET_BUNDLE_EXTRACT_BASE_DIR wine /path/to/pkhex/executable/PKHeX.exe

In my case:

WINEPREFIX=/home/anon/Prefix/pkhex env -u DOTNET_ROOT -u DOTNET_BUNDLE_EXTRACT_BASE_DIR wine /home/anon/Games/Pokémon/PKHeX/PKHeX.exe

5) Making a launcher for PKHeX
In case you don’t want to use the terminal every time you want to launch PKHeX you can create a launcher for it. For example you can make a simple bash script for it.

Paste the following content into a text editor and save the file wherever you want and with whatever name you want:

#!/bin/bash
WINEPREFIX=/home/anon/Prefix/pkhex wine /home/anon/Games/Pokémon/PKHeX/PKHeX.exe

As always replace the paths with yours.

Of course this can also be the command seen in paragraph 4.1:

#!/bin/bash
WINEPREFIX=/home/anon/Prefix/pkhex env -u DOTNET_ROOT -u DOTNET_BUNDLE_EXTRACT_BASE_DIR wine /home/anon/Games/Pokémon/PKHeX/PKHeX.exe

Now make the file executable by running:

chmod +x /path/to/your/script

For example:

chmod +x /home/anon/Games/Pokémon/PKHeX/Launcher

Now you can simply open PKHeX by double-clicking the launcher.

Edited by Taku86
  • Like 2
  • Thanks 1
Link to comment
Share on other sites

  • Taku86 changed the title to The ultimate guide on how to run PKHeX on Linux [updated 04/2024]

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...