Learn through the super-clean Baeldung Pro experience:
>> Membership and Baeldung Pro.
No ads, dark-mode and 6 months free of IntelliJ Idea Ultimate to start with.
Last updated: January 23, 2025
While Linux distributions such as Ubuntu have been extremely popular among engineers and open-source enthusiasts, the gaming scene has been pretty dull.
The number of games natively supported on Linux has been increasing steadily, but the most popular games, new or old, still don’t provide Linux versions, and the user base of Linux is still too small to be making games for.
The good news is that we don’t necessarily need Linux versions of a game to be able to play it on Linux. This is because there are plenty of emulators and compatibility layers that will run games designed for Windows, Android, PlayStation, and even Nintendo consoles on our Linux systems. Hence, this should suffice for most light-to-medium gamers.
In this tutorial, let’s look at how we can use some of these tools to run non-Linux games on Linux.
Windows is the most widely used desktop operating system, and naturally, most games have a Windows version. We can run Windows games (or any Windows application) on Linux using a compatibility layer called Wine. Using Wine, we can run most .exe files on Linux systems. Let’s see how to install Wine and run a Windows game on it.
Before we install Wine, we need to enable 32-bit architecture support on our system (assuming it’s 64-bit):
$ sudo dpkg --add-architecture i386
Next, we’ll add the key for the WineHQ repository:
$ sudo mkdir -pm755 /etc/apt/keyrings
$ wget -O - https://dl.winehq.org/wine-builds/winehq.key | sudo gpg --dearmor -o /etc/apt/keyrings/winehq-archive.key -
Subsequently, we can add the WineHQ repository itself:
$ sudo wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/ubuntu/dists/noble/winehq-noble.sources
Note that the above command contains the distribution codename (‘noble’ for 24.04), and for other versions of Ubuntu, we need to substitute the corresponding codename. Finally, we can proceed to install the latest stable version of Wine:
$ sudo apt install --install-recommends wine-stable
Once the installation is complete, we can run Windows programs from the terminal using the wine command.
For demonstration, let’s run the game Little Fighter 2, a free game released in 1999, using the wine command:
$ wine lf2.exe
Let’s see what this opens up:
The above screenshot shows the start screen of Little Fighter 2 running with Wine on Ubuntu.
If we’d like to avoid the command line, we can also use one of the GUI front-ends for Wine, which include Heroic Launcher, Lutris, and Bottles. Another option is to use the Steam client with Proton, which uses Wine under the hood.
Genymotion is an Android emulation product that’s available as a cloud service and a desktop application. It’s not open source, but there’s a free plan for personal use. To use this plan, we need to install Genymotion desktop from the link, create an account, log into the desktop application, and select ‘personal use’ when we use it for the first time.
Once we’ve downloaded and logged into the desktop application, we’ll see the opening screen:
To run Android games, the first thing we’ll need is a virtual device, which can run the Android OS inside it. To do this, we’ll click the plus button in the top right corner. This will open up a list of devices to choose from:
Let’s pick a device, say Google Pixel 9, and complete the setup process. Once the installation is complete, we can boot the virtual device to see a phone screen running inside a desktop window.
The simplest way to install a game on this virtual device is to drag an APK file from the PC’s file browser into the Genymotion window. Let’s try this with an APK of the 2048 game downloaded from F-droid:
Once we drag the APK into the device window, Genymotion automatically installs and opens the APK in the virtual device:
The above screenshot shows the 2048 game running inside a virtual Android device on a Linux system.
The only other feasible option to run Android apps/games on Linux systems, as of now, seems to be Waydroid. It’s open source and uses a container-based approach. However, it’s supported only on Wayland desktops and doesn’t work well on X-based desktop environments. There are other commercial Android emulators, such as Bluestack and Noxplayer, but they don’t support Linux.
Mednafen is a multi-system emulator that bundles emulators for multiple gaming consoles into one neat package. The emulator also supports mapping keyboard keys or even a joystick to console controls. Let’s look at the list of systems it emulates, as mentioned on the project home page:
To play console games using Mednafen, first, we’ll need the ROM files for the games we want to play. Assuming we have some game ROMs obtained through legal means, let’s go ahead and see how this works.
Mednafen is available in the default Ubuntu repositories. Therefore, it can be installed using apt:
$ sudo apt install mednafen
We typically use the mednafen command-line tool with a GUI front-end called Mednaffe, which is also installed by the above command. So, we can simply launch the GUI now.
Once we launch the Mednaffe app, we see four tabs, shown in the picture below:
First, we have the game list. Here, we can add folders containing ROMs and launch any of these ROMs. Subsequently, we can configure settings globally or for each system separately. Finally, there’s a tab that shows logs.
In this article, we looked at how we can play non-Linux games on our Linux system. While Linux isn’t the best OS for a hardcore or professional gamer, it does suffice for most recreational and occasional gaming with a suite of emulators and compatibility layers that can run games originally made for Windows, Android, and other gaming consoles, such as Nintendo, PlayStation, and Sega.