How to Install and Run Wine on a Raspberry Pi

This tutorial will show you how to install and use Wine on a Raspberry Pi.

Raspberry Pi Wine

Wine is a compatibility layer for Linux-based operating systems that allows you to run Windows native applications. What Wine does on your Raspberry Pi is translate a call to a Windows API to something the Linux operating system can understand.

It has become an incredibly popular software to install on Linux as Wine enables you to run the many pieces of software that have never been ported. For example, Wine is a core component of the Steam Deck that allows it to run Windows games on their Linux distributions

Installing Wine on to your Raspberry Pi will give you access to running software that isn’t available on Linux.

Of course, to make the most out of this compatibility layer we will need to install software that allows us to run x64 and x86 applications on our Pi. Most Windows applications aren’t compiled for ARM.

Considering how badly Windows on ARM performs on a Raspberry Pi, using Wine is your best solution to run any Windows native applications on your Pi. The benefit is that you can continue to utilize the lighter-weight Linux alongside these applications.

Equipment

Below is a list of all the equipment we used to run Wine on our Raspberry Pi.

Recommended

Optional

We tested this tutorial on a Raspberry Pi 5 running the latest version of Raspberry Pi OS Bookworm (64-bit).

Installing Wine on a Raspberry Pi

Over the following steps, we will walk you through the entire process of installing Wine onto your Raspberry Pi.

Please note that before running this guide, we assume you have never attempted to install Wine. Previous installations of Wine will break this guide.

Preparing your Pi

1. Before setting up Wine on our Raspberry Pi, we will want to update the operating system to ensure we are running the latest packages.

You can update the package list cache and upgrade any out-of-date packages using the following commands.

sudo apt update
sudo apt upgrade

2. Our next step is to install the “wget” package. We will use this tool to download the Wine packages. Additionally, we will also ensure that the “lsb-release” package is installed.

Typically, these packages come pre-installed on Raspberry Pi OS but to be safe, run the following command.

sudo apt install wget lsb-release

3. Once you have updated your Pi, we can move on to installing Box86. This will allow you to translate x86 applications to your Raspberry Pi’s ARM architecture.

To set this up, follow our tutorial on installing Box86 onto the Raspberry Pi.

https://pimylifeup.com/raspberry-pi-x86/

4. If you are running a 64-bit operating system, you will also want to install Box64 to your Pi. This is just like Box86 but works strictly with 64-bit applications.

You can install this software to your Raspberry Pi by following our Box64 installation guide.

https://pimylifeup.com/raspberry-pi-x64/

Installing Wine on the Raspberry Pi

5. These next few steps will walk you through installing Wine itself on to your Raspberry Pi.

Getting Ready

6. Before we download and install Wine, we will set a simple bash environment variable with the version we intend to use.

This will make running commands later in the guide much simpler.

WINE_VERSION=9.0.0.0

7. The next thing we want to do is set the “OS_VERSION” environment variable to store the current releases code name. We will use this when we download Wine as it ensures we install the version for your variant of Raspberry Pi OS.

OS_VERSION=$(lsb_release -cs)

Downloading and Installing Wine64

8. If you are running a 32-bit operating system, you must skip this section and focus on just installing the 32-bit release of Wine.

With how Box64 works, we will want to install all of the ARM64 equivalents to the libraries that Wine 64 requires.

Doing this will allow Box64 to pass those libraries directly to their ARM equivalent rather than having to emulate the x86 and x64 calls.

You can install all of the libraries used in the current release of Wine 64-bit by using the following command.

sudo apt install -y libasound2:arm64 libc6:arm64 libglib2.0-0:arm64 libgphoto2-6:arm64 libgphoto2-port12:arm64 \
libgstreamer-plugins-base1.0-0:arm64 libgstreamer1.0-0:arm64 libldap-common:arm64 libopenal1:arm64 libpcap0.8:arm64 \
libpulse0:arm64 libsane1:arm64 libudev1:arm64 libunwind8:arm64 libusb-1.0-0:arm64 libvkd3d1:arm64 libx11-6:arm64 libxext6:arm64 \
ocl-icd-libopencl1:arm64 libasound2-plugins:arm64 libncurses6:arm64 libncurses5:arm64 libcups2:arm64 \
libdbus-1-3:arm64 libfontconfig1:arm64 libfreetype6:arm64 libglu1-mesa:arm64 libgnutls30:arm64 \
libgssapi-krb5-2:arm64 libjpeg62-turbo:arm64 libkrb5-3:arm64 libodbc1:arm64 libosmesa6:arm64 libsdl2-2.0-0:arm64 libv4l-0:arm64 \
libxcomposite1:arm64 libxcursor1:arm64 libxfixes3:arm64 libxi6:arm64 libxinerama1:arm64 libxrandr2:arm64 \
libxrender1:arm64 libxxf86vm1:arm64 libc6:arm64 libcap2-bin:arm64 libstb0:arm64 libfaudio0:arm64
Installing the Main Module

8. We can now use the command below to download the 64-bit version of Wine on to your Raspberry Pi.

With this, we insert the values we set in the “OS_VERSION” and “WINE_VERSION” variables.

wget https://dl.winehq.org/wine-builds/debian/dists/${OS_VERSION}/main/binary-amd64/wine-stable-amd64_${WINE_VERSION}~${OS_VERSION}-1_amd64.deb -O wine-stable-amd64.deb

9. Once you have downloaded the 64-bit variant of Wine, you can extract the contents of the package on your system by running the following command. We extract this to the root (/) of your Pi so that it will be installed just as if we were installing this package normally.

We can’t install this like a normal package since the operating system won’t like the fact it has been compiled for x64 and not ARM.

sudo dpkg-deb -x wine-stable-amd64.deb /
Adding the Support Files

10. With Wine64 now installed, we need its supplemental libraries and files. These are what help add a lot of the functionality to Wine.

You can download the Debian package that contains these support files by running the following command.

wget https://dl.winehq.org/wine-builds/debian/dists/${OS_VERSION}/main/binary-amd64/wine-stable_${WINE_VERSION}~${OS_VERSION}-1_amd64.deb -O wine-support-stable-amd64.deb

11. After downloading the package, install the additional Wine libraries to your Raspberry Pi by running the command below.

sudo dpkg-deb -x wine-support-stable-amd64.deb /

12. The final package we require to run the 64-bit version of Wine is the one that includes all of the symbolic links and documentation.

This is what links the files we installed earlier to the “/usr/bin/” directory.

wget https://dl.winehq.org/wine-builds/debian/dists/${OS_VERSION}/main/binary-amd64/winehq-stable_${WINE_VERSION}~${OS_VERSION}-1_amd64.deb -O winehq-stable-amd64.deb

13. Once downloaded, install the package by running the following command.

sudo dpkg-deb -x winehq-stable-amd64.deb /
Testing your Wine 64 Installation on the Raspberry Pi

14. At this point, you should now have successfully installed the 64-bit version of Wine on to your Raspberry Pi.

You can verify this by launching Wine64 by running the following command in the terminal.

wine64

Below you can see that our Pi started up Wine 64 using Box64. We can now use this to run Windows software on our Raspberry Pi.

You can continue to the next section to install the 32-bit version of Wine. Having both is helpful as it will you run both x64 and x86 applications.

Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Cortex-A76 with 4 Cores
Will use Hardware counter measured at 54.0 MHz emulating 3.4 GHz
Params database has 89 entries
Box64 with Dynarec v0.3.1 27ed1093 built on Sep  2 2024 15:08:07
BOX64: Wine64 detected, WINEPRELOADRESERVE=""
BOX64: Didn't detect 48bits of address space, considering it's 39bits
WINE prereserve of 0x10000:0x8000 done
WINE prereserve of 0x110000:0x30000000 done
WINE prereserve of 0x7f000000:0x3000000 done
Counted 26 Env var
BOX64 LIB PATH: BOX64 BIN PATH: ./:bin/:/usr/local/sbin/:/usr/local/bin/:/usr/sbin/:/usr/bin/:/sbin/:/bin/:/usr/local/games/:/usr/games/
Looking for /usr/bin/wine64
Apply RC params for wine64
Applying BOX64_MAXCPU=64
Rename process to "wine64"
Using native(wrapped) libdl.so.2
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libpthread.so.0
Using native(wrapped) libutil.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libbsd.so.0
Using emulated /opt/wine-stable/bin/../lib64/wine/x86_64-unix/ntdll.so
Using emulated /lib/x86_64-linux-gnu/libunwind.so.8
Using native(wrapped) liblzma.so.5
Usage: wine PROGRAM [ARGUMENTS...]   Run the specified program
       wine --help                   Display this help and exit
       wine --version                Output version information and exit

Setting up 32-bit Wine on the Raspberry Pi

15. To run the 32-bit version of Wine we will need to install a bunch of packages. These are all libraries used by Box86 when running Wine on the Raspberry Pi.

You can install all required libraries using the following command within the terminal.

sudo apt install -y libasound2:armhf libc6:armhf libglib2.0-0:armhf libgphoto2-6:armhf libgphoto2-port12:armhf \
libgstreamer-plugins-base1.0-0:armhf libgstreamer1.0-0:armhf libldap-common:armhf libopenal1:armhf libpcap0.8:armhf \
libpulse0:armhf libsane1:armhf libudev1:armhf libunwind8:armhf libusb-1.0-0:armhf libvkd3d1:armhf libx11-6:armhf libxext6:armhf \
ocl-icd-libopencl1:armhf libasound2-plugins:armhf libncurses6:armhf libncurses5:armhf libcups2:armhf \
libdbus-1-3:armhf libfontconfig1:armhf libfreetype6:armhf libglu1-mesa:armhf libgnutls30:armhf \
libgssapi-krb5-2:armhf libjpeg62-turbo:armhf libkrb5-3:armhf libodbc1:armhf libosmesa6:armhf libsdl2-2.0-0:armhf libv4l-0:armhf \
libxcomposite1:armhf libxcursor1:armhf libxfixes3:armhf libxi6:armhf libxinerama1:armhf libxrandr2:armhf \
libxrender1:armhf libxxf86vm1:armhf libc6:armhf libcap2-bin:armhf libstb0:armhf libfaudio0:armhf
Installing the Main Win 32-bit Module

16. With all required libraries now installed, we can download the 32-bit release of Wine onto the Raspberry Pi.

All you need to do to download this version of Wine is to use the following command. Using the environment variables we set earlier will allow us to download the version of 32-bit Wine we require.

wget https://dl.winehq.org/wine-builds/debian/dists/${OS_VERSION}/main/binary-i386/wine-stable-i386_${WINE_VERSION}~${OS_VERSION}-1_i386.deb -O wine-stable-i386.deb

17. After downloading the package, you can install the 32-bit release of Wine onto your Raspberry Pi by running the following command.

This command will extract the contents of the package to the root of your Raspberry Pi.

sudo dpkg-deb -x wine-stable-i386.deb /
Installing the Additional Support Files for Wine on the Raspberry Pi

18. Before we continue, you must skip this section if you are running a 64-bit operating system and have already installed Wine64 to your Raspberry Pi. Following these will break everything we set up earlier.

If you are only running the 32-bit release of Wine, you must install additional libraries. To get these libraries, we will download another Wine package using the command below.

wget https://dl.winehq.org/wine-builds/debian/dists/${OS_VERSION}/main/binary-i386/wine-stable_${WINE_VERSION}~${OS_VERSION}-1_i386.deb -O wine-support-stable-i386.deb

19. You can install the package you downloaded by running the following command within the terminal.

sudo dpkg-deb -x wine-support-stable-i386.deb /

20. The final piece of the puzzle we need is the WineHQ package. This package contains a set of documentation and symbolic links that make using Wine on your Raspberry Pi significantly simpler.

You can download the package containing these files using the following command.

wget https://dl.winehq.org/wine-builds/debian/dists/${OS_VERSION}/main/binary-i386/winehq-stable_${WINE_VERSION}~${OS_VERSION}-1_i386.deb -O winehq-stable-i386.deb

21. After downloading the WineHQ package, use the command below to install all of the required support files.

sudo dpkg-deb -x winehq-stable-i386.deb /
Testing Wine is Running Properly on your Raspberry Pi

22. We can verify that the 32-bit version of Wine is now installed on our Raspberry Pi using the following command.

wine

If everything has worked properly, you should see something like what we have shown below appear within the terminal. The message here says that Box86 is processing this executable and we have been given a list of commands that you can utilize.

Box86 with Dynarec v0.3.7 a49c2862 built on Sep  2 2024 14:55:18
Usage: wine PROGRAM [ARGUMENTS...]   Run the specified program
       wine --help                   Display this help and exit
       wine --version                Output version information and exit

Testing your Wine Installation on the Raspberry Pi

With Wine now installed and running on your Raspberry Pi, let us give you a quick example of how you can use it to run Windows-based applications.

For this example, we will be simply using Wine to launch one of its inbuilt tools. In this case, this tool will be the Wine re-implementation of the file explorer. This is a good tool to know how to access as it interacts with the Wine prefix and is what a translated app will see.

1. To launch Wine’s inbuilt file explorer on your Raspberry Pi, you only need to run the following command within the terminal.

This same command will give you an idea of how you can use Wine to run an executable. All you need to do is swap out “explorer” with the name of the executable you want to launch.

wine explorer

2. Below you can see that we have file explorer up and running on our Raspberry Pi. We can now interact with the Wine prefix, including running any executable that you may have downloaded to your Pi.

Open File Explorer using Wine on the Raspberry Pi

Conclusion

Hopefully, at this stage, you will have managed to get Wine running on your Raspberry Pi alongside Box86 and Box64.

Wine is a great translation layer that allows you to easily run a huge number of Windows based applications on a Raspberry Pi without losing a significant amount of performance.

Please feel free to post a comment below if you have had any issues with getting Wine to run on your Pi.

If you liked this tutorial, we highly recommend that you explore some of the many other Raspberry Pi projects we have on offer.

Leave a Reply

Your email address will not be published. Required fields are marked *