|  | 
|  | 1 | +--- | 
|  | 2 | +title: Setting up your OS for development on Arch Linux | 
|  | 3 | +description: This section provides a step-by-step guide for setting up your development environment on Arch Linux. | 
|  | 4 | +--- | 
|  | 5 | + | 
|  | 6 | +> [!TIP] | 
|  | 7 | +> Arch Linux is a rolling release distribution. This guide was tested in October 2025 with kernel `version 6.15.9-arch1-1`. | 
|  | 8 | +
 | 
|  | 9 | +To develop with MonoGame in C#, you will need to install the .NET SDK. As of MonoGame 3.8.2 the minimum supported version is .NET 8. | 
|  | 10 | + | 
|  | 11 | +## Install .NET 8 SDK | 
|  | 12 | + | 
|  | 13 | +1. Open a new **Terminal** window. | 
|  | 14 | +2. Enter the following command in the terminal to install the latest .NET 8 SDK: | 
|  | 15 | + | 
|  | 16 | +    ```sh | 
|  | 17 | +    sudo pacman -Syu | 
|  | 18 | +    sudo pacman -S dotnet-sdk-8.0 | 
|  | 19 | +    ``` | 
|  | 20 | + | 
|  | 21 | +## Install additional workloads | 
|  | 22 | + | 
|  | 23 | +If you intend to also work with platforms such as `Android` or `iOS`, you will need to install the additional .NET workload templates for those platforms which include additional features and simulators to support those platforms.  Just run the following commands from the terminal for the platforms below you wish to install. | 
|  | 24 | + | 
|  | 25 | +> [!IMPORTANT] | 
|  | 26 | +> For mobile development with iOS and Android, you must also install the MAUI workload even though MonoGame does not use MAUI. The MAUI workload contains the debugging tools required to run and debug mobile .NET applications. Without it, you will not be able to properly debug your MonoGame mobile projects. | 
|  | 27 | + | 
|  | 28 | +### [Android](#tab/android) | 
|  | 29 | + | 
|  | 30 | +```cli | 
|  | 31 | +dotnet workload install android | 
|  | 32 | +``` | 
|  | 33 | + | 
|  | 34 | +### [iOS](#tab/iOS) | 
|  | 35 | + | 
|  | 36 | +```cli | 
|  | 37 | +dotnet workload install ios | 
|  | 38 | +``` | 
|  | 39 | + | 
|  | 40 | +### [Maui](#tab/maui) | 
|  | 41 | + | 
|  | 42 | +```cli | 
|  | 43 | +dotnet workload install maui | 
|  | 44 | +``` | 
|  | 45 | + | 
|  | 46 | +### [Android, iOS, and Maui](#tab/all) | 
|  | 47 | + | 
|  | 48 | +```cli | 
|  | 49 | +dotnet workload install android ios maui | 
|  | 50 | +``` | 
|  | 51 | + | 
|  | 52 | +--- | 
|  | 53 | + | 
|  | 54 | +> [!NOTE] | 
|  | 55 | +> You can use `dotnet workload search` to detect any other available workloads you wish to use. | 
|  | 56 | + | 
|  | 57 | +## Setup Wine For Effect Compilation | 
|  | 58 | + | 
|  | 59 | +Effect (shader) compilation requires access to DirectX.  This means it will not work natively on macOS and Linux systems, but it can be used through [Wine](https://www.winehq.org/). | 
|  | 60 | + | 
|  | 61 | +MonoGame provides a setup script that can be executed to setup the Wine environment for Effect (shader) compilation. | 
|  | 62 | + | 
|  | 63 | +1. Open a terminal window | 
|  | 64 | +2. Install Wine and required dependencies | 
|  | 65 | + | 
|  | 66 | +    ```sh | 
|  | 67 | +    sudo pacman -S wget curl 7zip wine | 
|  | 68 | +    ``` | 
|  | 69 | + | 
|  | 70 | +    > [!IMPORTANT] | 
|  | 71 | +    > Arch Linux recently transitioned the Wine package to a pure wow64 build to align with upstream Wine development.  Because of this, when you install Wine using pacman, you will not get a separate `wine64` executable that the MonoGame tools will expect. | 
|  | 72 | +    > | 
|  | 73 | +    > Reference: <https://archlinux.org/news/transition-to-the-new-wow64-wine-and-wine-staging/> | 
|  | 74 | +    > | 
|  | 75 | +    > This means you will need to create a symlink for MonoGame to reference with the following command | 
|  | 76 | +    > | 
|  | 77 | +    > ```sh | 
|  | 78 | +    > sudo ln -s /usr/bin/wine /usr/local/bin/wine64 | 
|  | 79 | +    > ``` | 
|  | 80 | + | 
|  | 81 | +3. Now that the prerequisites are installed, download the [mgfxc_wine_setup.sh](https://monogame.net/downloads/net8_mgfxc_wine_setup.sh) script and execute it by entering the following command in the terminal: | 
|  | 82 | + | 
|  | 83 | +    ```sh | 
|  | 84 | +    wget -qO- https://monogame.net/downloads/net8_mgfxc_wine_setup.sh | bash | 
|  | 85 | +    ``` | 
|  | 86 | + | 
|  | 87 | +    > [!TIP] | 
|  | 88 | +    > When running the Wine setup script, you may see a popup asking to install **Wine Mono** for .NET support.  You can cancel/close this popup.  It's not needed because the MonoGame script installs the actual Windows .NET SDK instead. | 
|  | 89 | +
 | 
|  | 90 | +    > [!NOTE] | 
|  | 91 | +    > This script will create a new directory called `.winemonogame` in your home directory.  If you ever wish to undo the setup this script performed, just simply delete that directory. | 
|  | 92 | +
 | 
|  | 93 | +4. After the script completes, you must add the `MGFXC_WINE_PATH` environment variable to your **system environment** for it to be accessible to all applications: | 
|  | 94 | +
 | 
|  | 95 | +    ```sh | 
|  | 96 | +    echo 'MGFXC_WINE_PATH="'$HOME'/.winemonogame"' | sudo tee -a /etc/environment | 
|  | 97 | +    ``` | 
|  | 98 | +
 | 
|  | 99 | +    > [!IMPORTANT] | 
|  | 100 | +    > Unlike other Linux distributions, such as Ubuntu, Arch Linux may not automatically load environment variables from your user profile at `~/.profile` for all applications.  Adding `MGFXC_WINE_PATH` to `/etc/environment` ensures it is available system-wide, including for GUI applications (such as the MGCB Editor) and IDEs | 
|  | 101 | +
 | 
|  | 102 | +5. For the environment variable to take effect, you can either log out and back in (recommended) or reboot your system. | 
|  | 103 | +
 | 
|  | 104 | +6. After logging back in, verify the environment variable is set: | 
|  | 105 | +
 | 
|  | 106 | +    ```sh | 
|  | 107 | +    echo $MGFXC_WINE_PATH | 
|  | 108 | +    ``` | 
|  | 109 | +
 | 
|  | 110 | +    > [!NOTE] | 
|  | 111 | +    > When running the above command you should see an output similar to the following | 
|  | 112 | +    > | 
|  | 113 | +    > ```sh | 
|  | 114 | +    > /home/yourusername/.winemonogame | 
|  | 115 | +    > ``` | 
|  | 116 | +
 | 
|  | 117 | +## Next Steps | 
|  | 118 | +
 | 
|  | 119 | +Choose from one of the two IDE options on Arch Linux: | 
|  | 120 | +
 | 
|  | 121 | +- [Setting up VSCode](./2_choosing_your_ide_vscode.md) | 
|  | 122 | +- [Setting up Rider](./2_choosing_your_ide_rider.md) | 
|  | 123 | +
 | 
|  | 124 | +## Troubleshooting | 
|  | 125 | +
 | 
|  | 126 | +### Issue: "wine64 not found error" | 
|  | 127 | +
 | 
|  | 128 | +If the setup script fails with `wine64 not found`, ensure you created the symlink from step 2 above | 
|  | 129 | +
 | 
|  | 130 | +```sh | 
|  | 131 | +sudo ln -s /usr/bin/wine /usr/local/bin/wine64 | 
|  | 132 | +``` | 
|  | 133 | +
 | 
|  | 134 | +### Issue: Shader compilation fails with "MGFXC effect compiler requires a valid wine installation" | 
|  | 135 | +
 | 
|  | 136 | +This means the `MGFXC_WINE_PATH` environment variable is not set.  Ensure you: | 
|  | 137 | +
 | 
|  | 138 | +1. Added it to `/etc/environment` as shown above in step 4 | 
|  | 139 | +2. Logged out and logged back in | 
|  | 140 | +3. Can see it with `echo $MGFXC_WINE_PATH` | 
|  | 141 | +
 | 
|  | 142 | +### Issue: Wine creates a `.wine-mgfxc` directory instead of using `.winemonogame` | 
|  | 143 | +
 | 
|  | 144 | +This is another symptom of the environment variable not being set.  Follow the steps in the previous issue to resolve it. | 
|  | 145 | +
 | 
|  | 146 | +### Issue: Wine version too old | 
|  | 147 | +
 | 
|  | 148 | +The MonoGame setup script requires Wine 8.0 or later.  Check your version: | 
|  | 149 | +
 | 
|  | 150 | +```sh | 
|  | 151 | +wine --version | 
|  | 152 | +``` | 
|  | 153 | +
 | 
|  | 154 | +If it's too old, update your system: | 
|  | 155 | + | 
|  | 156 | +```sh | 
|  | 157 | +sudo pacman -Syu | 
|  | 158 | +``` | 
0 commit comments