Running Windows applications on Lubuntu

While Windows applications are generally not compatible with Linux, there are multiple techniques to allow Linux users to run many Windows programs on Linux distros like Lubuntu. This guide will briefly cover two methods - the Wine Windows Compatibility Layer, and the use of virtualization.

Note: Before attempting to use these techniques, you should research if there’s a suitable Linux application that will work instead. Linux applications naturally work far better than Windows applications on Linux, and there are very good Linux alternatives for the vast majority of Windows software, including Microsoft Office, Adobe Audition, Visual Studio, etc. Much of the software you may be used to using on Windows may have Linux versions available, such as GIMP, Google Chrome, etc. Some of these programs were actually written for Linux first and then were ported to Windows, so your experience with the Linux versions may be as good or better than the Windows versions. Even if you can’t find a direct replacement for your original software, you can usually find a program or combination of programs that serves the same purpose even if it works differently, and you will almost certainly have a much better experience on Linux if you go this route.

Wine Windows Compatibility Layer

Wine is generally the easiest way to get a Windows program up and running. It is essentially an open-source rewrite of Windows, with some customizations to allow it to run within a lightweight container (called a Wineprefix) directly on Linux. Once Wine is installed, you can download and install Windows software the same way you would on Windows.

Wine does not work with all Windows software. Many applications will crash outright, behave in an unstable manner, or suffer performance penalties that make them unusable. Some of these applications can be made to work if you’re willing to put in the time and effort to do so. For the applications that do work, you may run into software bugs that aren’t present in Windows. However, for the most part, Wine does a fairly good job at getting Windows software to run on Linux.

It should be noted that Wine is not designed to be a security measure. Any software running within the Wineprefix has the exact same access and permissions as any Linux software. If a file can be read by the current user, it can probably be read by software within Wine, and if it can be written by the current user, it can probably be written by software within Wine. Additionally, since Wine enables Windows software to function on Linux, it also allows some Windows malware to potentially affect your Linux system. As a general rule, use only legitimate, trustworthy software from official sources.

To install Wine, you will need to enable 32-bit support on your system. To do that, run this command in a terminal:

sudo dpkg --add-architecture i386

This will allow you to install Wine properly.

You can use the version of Wine included in the Ubuntu repositories, or you can install the latest version from the Wine repositories. Ubuntu appears to include very outdated versions of Wine in the repositories, so it is recommended that you install Wine from the Wine repositories. Detailed instructions on how to do this are available here: Ubuntu WineHQ Repository - WineHQ Wiki I usually use the Staging branch of Wine (a somewhat experimental version that has more features than the Stable branch). I’ve not run into any serious problems with it. At the time of this writing, only the Development and Staging branches are available for Ubuntu 22.04.

Once Wine is installed, you’ll need to make it so that it runs your Windows software. In Lubuntu, double-clicking an EXE file will open it in LXQt File Archiver, which is not what you want. To fix this, right-click on a Windows executable file, and click “Properties”. In the “Open With:” drop-down, click “Wine Windows Program Loader”. Then click “OK”. You should now be able to launch Windows applications on your system.

Once you’ve installed Wine, it will need setting up. The first time you try to run a Windows program, Wine will automatically set itself up. You can also do this manually by running wineboot in a terminal. During the setup process, you will be asked to allow Wine to download and install Mono into your Wine installation. It is highly recommended that you do this, as some software may not work properly in the absence of Mono.

Once Wine is installed and set up, you should be able to run Windows software directly on Lubuntu. Simply double-click a Windows program or installer file within PCManFM-QT, and Wine should take care of the rest. Additionally, when you install Windows software on your system, it should show up in your Applications Menu under the “Wine” category.

There are some tools Wine provides that can be helpful for various tasks, like uninstalling old software, or tweaking Wine to try to get it to work with your software. Some of the more important tools are:

  • Winecfg. Allows you to tweak various Wine settings. Run winecfg in a terminal to open it.
  • Uninstaller. Allows you to uninstall software that you no longer use. Run wine uninstaller in a terminal to open it.
  • Control panel. Allows you to access control panel applets. Run wine control in a terminal to open it.
  • Wineboot. “Reboots” the Wine Windows system if necessary, without rebooting your whole computer. Run wineboot in a terminal to reboot Wine. Note that all running Windows applications should be shut down before running wineboot.
  • Wineserver. This is the heart of Wine, the part of it that allows the Wineprefix and Linux to work together to run Windows software. It also has some controls that can help you manage Wine. The most useful one is -k, which allows you to forcefully turn off the Wine Windows system, ensuring that it actually turned off after running wineboot. To force poweroff the Wine Windows system, run wineserver -k. Note that this will close all of your Windows applications without saving your data, so make sure to save your work and close your Windows applications before doing this.

At some point, you may accidentally mess up the Wineprefix (maybe a customization won’t go as planned, or some software will install, but then not uninstall). If this happens, the easiest way to fix it is to delete the Wineprefix and allow Wine to create a new one. To do this, you can open PCManFM-QT, click “View” and click “Show Hidden”. Click the “.wine” folder, and then delete it. This will uninstall all your Windows applications and wipe any data that you saved within the Wineprefix, including customizations. Once you’ve deleted the Wineprefix, Wine will automatically generate a new one when you try to run a Windows application.

If you don’t want to risk wiping your entire Wineprefix every time something goes wrong, you can use PlayOnLinux to manage your Windows software. PlayOnLinux creates a separate Wineprefix for every Windows application, so if you accidentally mess something up, you can remove just the one messed up app without affecting your other Windows apps. PlayOnLinux also allows you to download and use other versions of Wine for in the event a particular application runs well under one version of Wine, but not under a newer version. PlayOnLinux also comes with a variety of features to help get certain Windows software working in the event that it doesn’t function properly out of the box.

Virtualization

Virtualization software allows you to create virtual machines, which are essentially computers within a computer. Each virtual machine (abbreviated VM) can run its own operating system and applications without interfering with other virtual machines or the host system.

If you need to run Windows software that can’t run within Wine, you can purchase a Windows license and install Windows into a virtual machine, allowing you to use Windows and Linux at the same time.

First, some caveats and requirements:

  • Windows virtual machines are more compatible with Windows software than Wine, but some software may still not work or may function more slowly. Virtual machines usually provide only very simple graphics acceleration to the virtualized OS - as a result, graphically intensive software like video editors, 3D modelling software, CAD software, and many games may not work very well in a VM, if they work at all. Additionally, some software can detect that it is being run inside a virtual machine and will refuse to run. There are ways of enhancing VM graphical performance, and there are ways to hide the virtualization software from the OS and applications running inside the VM, but these techniques are beyond the scope of this guide.

  • Your system will need to support hardware virtualization in order to run virtual machines. Most 64-bit systems support hardware virtualization. If your system is one of the rare ones that doesn’t support hardware virtualization, you will not be able to run virtual machines. {1}

  • You will need a moderately powerful computer to run a Windows VM, since you will be running a full Windows 10 OS and applications at the same time as Lubuntu and its applications are running. You will be providing a significant chunk of your computer’s resources to the VM. At a bare minimum, you will need 4 GB RAM, 32 GB unused disk space, and a recent Intel Celeron or equivalent processor. For better results, you should have at least 8 GB RAM, 64 GB unused disk space, and an Intel Core i5 or equivalent processor.

  • Only Windows XP up to Windows 10 is supported by this guide. Windows 11’s has specific system requirements that may be difficult or impossible to meet depending on your hardware and virtualization software, and the virtualization software used in this guide (Gnome Boxes) is not compatible AFAIK without using advanced techniques. Such techniques are beyond the scope of this article. If you really want to try Windows 11, you’re on your own. Good luck. Windows versions earlier than XP may have problems running within a virtual machine without advanced techniques.

  • It is very highly recommended that you activate Windows during or after the installation process, for legal and performance reasons. You cannot legally use a Windows 10 license from a computer that was purchased with Windows 10 preinstalled - you will need a retail license. {2} You can purchase a retail Windows 10 license from within the VM after installation through the Windows Store. This will automatically activate Windows. Cheap Windows license keys from third-party vendors are almost without question illegal, and have a high chance of not working, so they are not recommended. Buy your license from Microsoft - that’s the safest way to go.

  • While this guide should theoretically support Windows 10, I don’t own and don’t intend to obtain a Windows 10 license, and so I have not tested a Windows 10 installation. The newest Windows I’ve tested this guide with is Windows 8.0. If you encounter any problems or unexpected results while trying to install a Windows 10 VM, let me know so I can help troubleshoot the problem and fix the guide if necessary. You can message me directly, or create a Lubuntu offtopic post.

First, you will need to enable hardware virtualization on your system. To do this, enter your system’s BIOS setup, and find an option for “Virtualization”, “VT-x”, “AMD-V”, or something similar, and turn it on. The procedure for entering BIOS setup may vary between computers, and the location of the virtualization option may also vary. If you’re having trouble, you can Google something like “HP Elitebook 8570p enable hardware virtualization”. This should allow you to find the manufacturer’s instructions on how to do this.

Once hardware virtualization is enabled, install Gnome Boxes. To do this, open a terminal with Ctrl+Alt+T, and type sudo apt install gnome-boxes, and press Enter. Type your password when prompted (it will not be visible), and press Enter. Finally, press Y, and then Enter again. When the installation finishes, log out of Lubuntu, and log back in.

With this complete, you are now ready to create a Windows VM. You will need a copy of Windows 10, which you can download directly from Microsoft by following this link: https://www.microsoft.com/en-us/software-download/windows10ISO Once Windows is downloaded, open Boxes, and click the “+” button in the upper-left corner to create a new VM. Click “Create virtual machine from file”, then browse to the location of your Windows 10 ISO and select it. Gnome Boxes should automatically detect that you’re using Windows 10, and download drivers for enhancing VM performance. Next, enable “Express Install” if it’s not enabled already, enter your intended username, password, and your Windows product key, and press “Next”. For good results, you should assign the VM at least 4 GB RAM and 64 GB disk space, though it is possible to use only 2 GB RAM and 32 GB disk space (though this will make your Windows VM unable to do much). Finally, click “Create”. The virtual machine installation process should complete automatically.

Once Windows is installed, you should see that the virtual machine preview in Gnome Boxes starts doing stuff. At this point, click on it. This will open your new Windows VM. Once you’re here, click on the triple dots in the upper-right corner of the window, and click “Preferences”. Switch “Allow running in background” on, then close the pop-up window. This will keep your VM from ending up in an odd state if you back out of it.

Once this is done, you should be ready to install your software into the VM and be done!


Notes:

{1}: OK, so it’s technically not totally true that you can’t use a VM without hardware virtualization. It is possible to use Oracle VM Virtualbox 6.0 or lower to run 32-bit virtual machines without hardware virtualization. This is a terrible, horrible, atrociously bad bad bad bad idea for a lot of reasons - it’s extraordinarily insecure, will perform poorly, might not work with a Windows 10 VM at all, may be difficult and dangerous to install on a modern version of Ubuntu, and it will limit you to only 32-bit software in the event that it does work. In short, don’t do it. This is included only for the sake of completeness.

{2}: If you’re using this guide to set up a Windows VM in a business environment, your workplace might use some form of volume activation, rather than retail licenses. If this is the case, you won’t need a retail license. If you need to, check with your IT department to find out how to handle Windows licensing at your workplace. If you’re scared to talk to IT about your project, you probably shouldn’t be doing this on your work PC.

8 Likes