How to Install and Use Wine to Run Windows Apps on Linux

You can still use those Windows programs you know and love

If you migrated to Linux, you might wonder about those Windows apps you depend on. There's a tool called WINE, which enables computer programs developed for Microsoft Windows run on Linux. Not every Windows application runs under WINE, but many do.

How Does WINE Work?

WINE is a set of libraries that function together to enable Windows applications to install and run on Linux. One portion of WINE, which is visible to Windows applications, is the Windows Application Programming Interface (API). The other portion, which is visible to Linux, is a combination of the Linux and X11 (the Linux graphic display server) APIs.

WINE also includes a special Windows program loader, which enables it to see a .exe file (a Windows executable file), load it (along with its required Windows files), and connect everything together. It's a rather complicated layering of tools, but in the end, it works seamlessly.

To find out what Windows applications work on Linux, via WINE, check out the WINE Application Database.

Here's how to install WINE on Ubuntu Desktop 19.04 and then install the Notepad++ application.

Install WINE

The first task is to install WINE. The installation isn't challenging. Here's how to successfully install WINE on Ubuntu Desktop 19.04:

  1. Open the terminal window application from the GNOME Dash.

  2. Install WINE with the command:

    sudo apt install wine -y

    You may get a message like, "Package 'wine' has no installation candidate. Try using the sudo apt-get install wine-stable -y command instead."

    To install the latest version of WINE, run:

    sudo apt install wine-development -y
    Screenshot of installing WINE on Ubuntu.
  3. When prompted, type your user password.

  4. Wait while the installation runs. Wine has a decent number of dependencies.

  5. That's it. WINE is installed and ready to go.

Use Wineconfig to Set Up WINE

Next, set up the proper WINE environment. WINE needs a directory that is configured so it can fool the installers into thinking the applications are installed in a standard Windows directory, such as the C: drive. Here's how you do that:

  1. From the terminal window, issue the command winecfg.

    Your Linux machine may need to install other software, called dependencies, before it can install WINE. Follow the prompts and agree to the steps.

  2. When the WINE Configuration tool opens, click the Drives tab, then make sure C: exists and it's target folder is ../drive_c. This should be created by default.

    Screenshot of the WINE Configuration tool.
  3. Leave the WINE Configuration tool open.

Configure WINE for Notepad++

Installing the Windows app can be done quickly from the command line, but first, make sure WINE has all the configuration information necessary. To do this, follow these steps:

  1. Open a web browser, download the .exe installer for Notepad++, and save it to the Downloads directory.

  2. From the WINE Configuration window, click Applications and then click Add application.

    Screenshot of the Add application button.
  3. Select the Look in drop-down arrow, choose your username, then select Downloads.

    Screenshot of locating the downloaded file.
  4. Choose npp.7.7.1.Installer.exe, then select Open.

  5. Select the Windows Version drop-down arrow, then choose Use global settings.

    Screenshot of global settings option.
  6. Select OK.

Install Notepad ++

At this point, you can now install the application.

  1. In the terminal window, change to the Downloads directory with the command cd ~/Downloads.

  2. Install the app with the command wine npp.7.7.1.Installer.exe.

    Screenshot of installing Notepad++ with WINE.

    You don't have to type the entire set of numbers and dots in a filename like this. After you change the directory to Downloads, enter wine npp, then press the Tab key on the keyboard. If you're in the right directory and the file is there, it automatically expands and types the full file name. Press the Enter key when it does so.

  3. Choose your desired language for the app, then select OK.

    Screenshot of the language selection option.
  4. Select Next.

    Screenshot of the opening installation window.
  5. Select I Agree.

    Screenshot of the EULA.
  6.  Select Next.

    Screenshot of the Install location window.
  7. Choose the extra components you want, then select Next.

    It's perfectly fine to leave these options as is and click Next.

    Screenshot of the extra components configuration window.
  8. Select Install.

    Screenshot of the Install button.
  9. Allow the installation to complete, then select Finish.

Notepad++ opens and is ready to be used. You have installed your first Windows app on Linux, using the compatibility layer WINE.

Run the Application

There is one caveat to installing applications through WINE—how to start the app. Upon the initial installation, the application automatically starts. If you can't figure out how to relaunch the application or if the desktop launcher doesn't work, you'll need another tool.

Installed along with WINE is an application called WINE File Manager. From that tool, you can navigate to the directory housing the installed application and launch it. Here's how:

  1. From a terminal window, issue the command winefile.

  2. Navigate to C > Program Files (x86) > Notepad++, then double-click the notepad++.exe entry.

    Screenshot of launching Notepad++ from within the WINE File Manager.
  3. Use the application.

When you finish using the application, close it as usual. When you need it again, open the WINE File Manager and launch it.

Although this might not be the simplest method to run Windows applications (nor is every Windows application supported), having these apps running on a secure and reliable platform (Linux) is a great way to have the best of both worlds.