…and why CrossOver may work better

On July 3rd 2019 we had our first real meetup. Not to be confused with the meeting before this one. Zero day. Which wasn’t really a meeting, as much as it was just breaking the ice.

Overall this meetup went pretty well. Most people that attended probably didn’t really have a use case for Wine. However, I feel that everyone was able to learn something! As the ABQLUG has more time to grow, I hope to bring on more hosts.

But that is not why you are here. You’re here for some Wine. And maybe for some of my cheese… *crickets*

What is Wine?

Most people would probably first say that: Wine… Is Not an Emulator. But what does that mean?

The Wine developers’ definition of an emulator would be software that is designed to emulate all of the Windows system calls that any given Windows application may produce.

Emulation is great, especially if you are aiming to separate the host from the emulated software. However, there might be a case in which you may want more direct integration into the host system. This is where Wine comes in. Wine will translate Window’s system calls into system calls that are understood by your Linux system. The biggest difference, noticeable by the user, will be that there is minimal overhead in regards to CPU and memory consumption. And again, the lack of separation of files from the host system to the guest system.

When should one use Wine?

You should try out Wine when there are very little hardware resources to emulate the Windows OS, although this is likely a non-issue with newer machines.

I would also recommend trying out Wine when you only have one or two Windows applications that you need to use. For more than that, or for the more complex programs (like Photoshop or After Effects); then you should consider running a full fledged virtual machine.

How does one know when they should not use Wine?

If you can’t get the desired Windows application installed and set up using Wine within several hours, its probably not worth investing time into it.

I got Ancestral Quest 15 installed and setup in less than an hour. I spent almost two days playing around with Quicken 2016 Deluxe and got nowhere. Once Wine and Winetricks are installed, it is pretty easy to test to see if Wine will work for the software you want to use….

Things to keep in mind…

When we preformed this live, it was demoed on an old HP laptop that was running Linux Mint 19.1 (updated 07/03/2019).

If you are not using the current LTS version of Ubuntu (18.04), these commands should work without any modifications. If not, please leave a comment below.

I downloaded all of the desired Windows software to the /Downloads/ folder in my home directory. ~/Downloads (both AQ15Setup.exe and Quicken_Deluxe_2016.exe are used in this tutorial )

If you are unsure as to what prerequisite software you need. There are three things that you can do…

  1. You can look at the website the Windows software came from. Sometimes you can find information in a FAQ, or on a system recommendation page.
  2. If no information is easily accessible from the developers’ website (likely), then use Wine’s AppDB list. https://appdb.winehq.org/
  3. You can try Google searching to see if you find any success. Be careful about really old posts though. Wine/Winetricks has changed a lot over the years. Typically you would search something like this: Quicken 2016 wine

Later on when I cover CrossOver for Linux, I used the trial version. Which seems like a good choice if you would rather try out their software before you decide if you want to buy it…

Terminology:

Winebottle – A directory that is setup for one specific Windows application that is going to be used with Wine. Winebottles have to be invoked manually. If WINEPREFIX is not used in your command, Wine will look at it’s default Winebottle… ~/.wine

WINEARCH – The system architecture that Wine should use to translate system calls. win32 vs win64. You should almost always choose win32…

WINEPREFIX – The folder location of the Winebottle.

Winetricks – A GUI wrapper (CLI too) for Wine. It allows for easier overall Wine management. Also offers easy installation of prerequisite software that Wine typically needs to function fully.

Mono – An open-source implementation of the .NET Framework. It lacks certain features that the actual .NET framework provides. If you’re going to be using dotnet at any point, do not install Mono.

Gecko – Basically, Wine’s version of Internet Explorer. Written in Gecko. Gecko is a web-browser layout engine created by Mozilla.

Repository – A server (or set of servers) that hosts software for users to download and install.

2022 Update

I found this GUI tool that might be easier to get started with Wine. It’s called Bottles.

You can install Bottles (GUI) via flathub.

I still use Wine from the terminal. But this seems like a very useful tool for those that prefer to use a GUI.

How to install Wine on Ubuntu… the correct way…

If you simply do this in your Terminal:

sudo apt install winehq-stable

You’re doing it wrong

This will more than likely install an older version of Wine. Packages in Ubuntu and Debian generally are outdated. This usually isn’t a big deal. However, for Wine and Winetricks, it is. So adding a new repository would be the best way to download and install the newest version of Wine. Installing Winetricks is a different procedure. That is covered later in this post.

I used this wiki page as a guide for this: https://wiki.winehq.org/Ubuntu

NOTE: If you are not using Ubuntu 18.04. Replace the bionic name with the relevant name to your version of Ubuntu.

Open Terminal and type this into Terminal:

sudo dpkg --add-architecture i386

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 76F1A20FF987672F

sudo apt-add-repository "deb https://dl.winehq.org/wine-builds/ubuntu/ bionic main"

sudo apt update

sudo apt upgrade

sudo apt install --install-recommends winehq-stable fonts-wine curl

The first command will add the developers’ GPG repository key. So that way your machine will trust software that comes from the custom-added WineHQ repository. This command will use the GPG keyserver round-robin: pool.sks-keyservers.net.

Otherwise you will get this error:

Err: https://dl.winehq.org/wine-builds/ubuntu bionic InRelease

The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 76F1A20FF987672F

The second command will add the new repository to your sources.list (additional-repositories.list if you’re on Mint 19.x). If you are using Ubuntu 18.04 or Linux Mint 19.x then no changes will need to be made to the command… Otherwise, you might need to charge the part that says “bionic” to your version. If you are not sure what you should use, try this command:

lsb_release -cs

The third command updates the apt metadata, which then tells apt what is available to download and install.

The fourth command will install the latest software on your Ubuntu-based machine.

The fifth command will install the preferred version of Wine, plus all the recommend packages that are flagged as recommended (as opposed to required packages). Installing the recommended packages might help during your Wine use. I personally haven’t tested to see what happens if I didn’t install the recommended packages for Wine.

Curl will allow us to grab files from the internet from within the terminal.

How to install Winetricks… And set up auto-updating

I used this wiki page as a guide for this: https://wiki.winehq.org/Winetricks

The recommended way to install Winetricks is through their github page. Type this into your Terminal:

curl -O https://raw.githubusercontent.com/Winetricks/winetricks/master/src/winetricks

chmod +x winetricks

sudo mv winetricks /usr/local/bin

echo 'export PATH=$PATH:/usr/local/bin' >> ~/.bashrc

The first command will download the Winetricks file, and will place the file into your PWD (present work directory).

The second command will allow the newly downloaded Winetricks file to be executed.

The third command will move the file into a location where you may be able to open the program more easily. Installing software from the package manager will usually do this for you, FYI.

Not all Linux distributions support invoking software from /usr/local/bin. So the fourth command will allow us to invoke Winetricks easily. >> appends to a file, where as > will replace the file…

Since you installed Winetricks manually, Winetricks will not update when we run apt upgrade. You could use this command to update Winetricks manually:

sudo winetricks --self-update

However, there is a better way…

Use this command to alter your apt configuration. Winetricks will be triggered to update every time you do an apt update command:

echo 'APT::Update::Post-Invoke-Success { "/usr/local/bin/winetricks --self-update"; }' | sudo tee -a /etc/apt/apt.conf.d/100hooks

Echo will “pipe” that string of text into a file called /etc/apt/apt.conf.d/100hooks. By default that file doesn’t exist, so it will create that file, if needed.

How to install Ancestral Quest 15 (The good side of Wine)

Now, it is time to create your first Winebottle, so you may install your first Windows program. Feel free to name these directories whatever makes sense to you…

mkdir -v ~/winebottle-aq15

cd ~/winebottle-aq15

The fist command will create the Winebottle.

The second command will then enter that Winebottle’s directory.

Now it is time to set it up the Winebottle:

WINEARCH=win32 WINEPREFIX=~/winebottle-aq15/ winetricks

This command will start Winetricks. It will tell Winetricks to use a 32-bit architecture for the Winebottle, and also where the Winebottle is located. You should get a small box that says that Wine is being set up for that Winebottle.

Each time Winetricks is opened Winetricks will look to see if Gecko and Mono are installed. You do not need either for the two Windows applications I presented in this tutorial. I can’t think of any direct examples where you would need them. If you are installing dotnet at any point, you need to skip Mono. Gecko is basically Wine’s version of Internet Explorer.

Once the Winebottle has been set up, you will see a new Winetricks window pop up. You will want to enter the wineprefix to directly work with the Winebottle.

Choose “Select the default wineprefix”, then hit “OK”

You might see a message that Winetricks would like to use your Wine-related data to help Winetricks better learn how users use their software. You may opt-in or out. If you chose to opt-in you will then see a command that will opt you out of their data collection.

Most Windows software will want/expect at least a Windows 7 Winebottle. In the current version of Wine, this is set to Windows 7 by default. You may check this with the winecfg option when Winetricks is opened.

For this example (Ancestral Quest 15) we do not need to install any extra stuff. So you may close all of the Winetricks windows.

Cancel. Then Cancel again.

Now lets enter this into Terminal so we may enter the “C: drive.” (In this particular Winebottle)

cd drive_c

Now we will want to copy the Ancestral Quest installer into the C: drive.

cp -v ~/Downloads/AQ15Setup.exe AQ15Setup.exe

Lets install Ancestral Quest 15:

WINEARCH=win32 WINEPREFIX=~/winebottle-aq15/ wine AQ15Setup.exe

This will open up a familiar Windows installer. Click through the installer. Defaults are probably best for most software. At the end, you should have a desktop icon for Ancestral Quest 15. If not, you might have to logout and back in, or make one from your app launcher.

At this point we are finished Installing Ancestral Quest 15. The very few people that still use this software should know how to import their old data. From my playing around with the trial version of Ancestral Quest 15, I observed no bugs. However, I did notice that there was some bugs found from a different user. Though I don’t use Ancestral Quest, so I couldn’t reproduce their issue, nor their workaround.

This made a very good example of how Wine works in an ideal circumstance. This should make for an excellent representation to the good side of Wine.

Now it’s time for the bad and ugly side of Wine… (Quicken 2016 Deluxe installation)

More modern software might not work very well with Wine. A direct example is Quicken 2016 Deluxe, software I don’t personally use. However, this is preventing a ABQLUG member from converting over to Linux on his laptop, so I gave it a shot…

However, even though I worked through the problems of installing Quicken 2016, it actually wouldn’t launch for me. It would just sit at a blinking window until it would timeout, and give me a window to close Quicken. If this happens to you, you can use xkill to close the broken Quicken window. So this was a fail, however, you can actually install Quicken 2016 with CrossOver for Linux. This is covered towards the end of this post. You might want to consider skipping that part, unless you want to see the bad and ugly side to Wine…

First, you will want to clear your Terminal screen. Then create and enter the directory for the next Winebottle.

clear

mkdir -v ~/winebottle-quicken2016

cd ~/winebottle-quicken2016

Since Wine and Winetricks are installed, we may now configure the Quicken 2016 Winebottle. If you are starting the tutorial at this point and haven’t installed the current version of Wine, please read this post from the beginning.

WINEARCH=win32 WINEPREFIX=~/winebottle-quicken2016 winetricks

Again, if Winetricks asks to install Mono or Gecko, click on cancel. When the Winetricks GUI comes up, you will wan to enter the Winebottle.

Choose “Select the default wineprefix”, then hit “OK”

From here we will want to install dotnet40 since Quicken 2016 needs .NET 4.0.

To bring up this menu, choose this option:

Install a Windows DLL or component

You are presented with a long list of all the software that Winetricks may install for you. Keep in mind that you do not need to go crazy here; only select what you need. If you need a version of .NET, this will install all the prerequisite software for that particular version of .NET. So if you see that the developer wants you to have .NET 4.0, just select dotnet40. If you are installing Quicken 2016, as demonstrated in this tutorial, all you will need is dotnet40.

If you know you need DirectX software, you may also select that in the same menu. DirectX software is labeled dxvk. Visual C libraries maybe installed with vcrun20xx. Select what you need, but only what you need.

If you are unsure of what you will need, try to install the Windows software without any prerequisite software installed in your Winebottle. Usually you will get an error code that will send you down a rabbit hole that will (hopefully) tell you what prerequisite software you need to install. You might want to see if the application developer has any mention as to what software you need on your Windows machine. Search here as a resort: https://appdb.winehq.org/

If you know you need a certain font you may install it now. Otherwise if you need to change the version of Windows your Winebottle uses, you may do that through winecfg. Although the version will probably change once you install prerequisite software. If it does change, do not bother fighting Winetricks to change it back…

Once all the prerequisite software you need is installed, close the Winetricks window(s).

Enter this into your Terminal to enter the “C: drive.” (In this particular Winebottle)

cd drive_c

Copy over the Quicken 2016 installer to the Winebottle.

cp -v ~/Downloads/Quicken_Deluxe_2016.exe Quicken_Deluxe_2016.exe

You will then need to start the process of installing Quicken 2016 through Wine:

WINEARCH=win32 WINEPREFIX=~/winebottle-quicken2016/ wine Quicken_Deluxe_2016.exe

Once you go through the graphical installer, you will receive an error message saying it could not install the PDF driver. This driver is actually in the Quicken_Deluxe_2016.exe file. You will want to use perl to replace a specific line in the installer to skip this step, thereby allowing you to install Quicken 2016. I used this webpage to help me figure this part out…

First, to do this, you need to create and enter a new directory so you can edit the installer:

mkdir -v perl-edit

cd perl-edit

You will then need to copy the Quicken 2016 installer to the new directory:

cp -v ~/Downloads/Quicken_Deluxe_2016.exe Quicken_Deluxe_2016.exe

Now you will want to use 7zip to un-archive (unzip) the Quicken 2016 installer:

7z x Quicken_Deluxe_2016.exe

If you do not have 7zip installed. You will want to install the p7zip-full package:

sudo apt install p7zip-full

Now that we have all of the contents from the Quicken installer, we may now edit the .msi file with perl. Thereby skipping the PDF driver during the Quicken 2016 installation.

perl -pi.bak -0777e 's/NOT REMOVE="ALL"InstallPDFDriver/NOT_REMOVE="ALL"InstallPDFDriver/' DISK1/Quicken\ 2016.msi

Now that you used perl to edit the installer. You must install Quicken from a different .exe file.

WINEARCH=win32 WINEPREFIX=~/winebottle-quicken2016 wine perl-edit/DISK1/Setup.exe

Now you may install Quicken 2016 through the Windows installer. Once installed you will see that Quicken 2016 is FUBAR. At this point in time I do not know why, or how to fix this…

Then, there is CrossOver for Linux…

CrossOver for Linux can make Wine even easier to use than Winetricks. However, CrossOver only supports some software. Even then, if newer versions of the once supported software come out. It may or may not get future support. So this is not a perfect solution for all Wine problems. But it is definitely worth trying out.

CrossOver is developed from Code Weavers. Code Weavers is the largest dontaor for the Wine Project. The sales from CrossOver supports these donations.

If you’re a gamer, you’re probably asking yourself where does Proton fit into all of this? Proton is developed by Steam. Proton is used to play Windows games, through the Steam client, on you Linux machine. This is not covered here… Maybe a future topic?

Back to the tutorial… Keep in mind that I only used the trial version of CrossOver for Linux for this tutorial.

You may see what is currently support from this webpage: https://www.codeweavers.com/compatibility

If you want to download their installer, they want you to submit their form. You may do that here: https://www.codeweavers.com/products/crossover-linux/download-now#deb

However, if you Google around, you can find a directory with all of their installers. For Ubuntu you will want to download the .deb version: https://media.codeweavers.com/pub/crossover/cxlinux/demo/

Now that the file is downloaded, you will want to type this into Terminal to install the trial version of CrossOver. Replace crossover_18.5.0-1.deb with the version you just downloaded…

sudo dpkg -i ~/Downloads/crossover_18.5.0-1.deb

You will likely get an error that you need to install some prerequisite software.

You may easily fix this with:

sudo apt install -f

Make sure CrossOver is installed correctly:

sudo dpkg -i ~/Downloads/crossover_18.5.0-1.deb

You should notice that CrossOver is now installed. You should either have an icon on your Desktop, or in your application launcher.

Once you have CrossOver opened… Click on:

Install Windows Software…

You will want to type the name of the Software you would like to install. For this example I typed Quicken 2016, then I found that they have the exact version needed. Click on the name, or press enter once the name has been highlighted, then select…

Continue

If you see Quicken 2016 Mondo, that is probably the better choice for Quicken 2016. However, I don’t have access to the Mondo patch file since I don’t own the software. You should be able to do this if you own the software.

CrossOver will then ask you for the Quicken 2016 Deluxe installer. Choose the installer file (not the folder). Then select where the downloaded Quicken_Deluxe_2016.exe file is. Then select…

Continue

CrossOver should want to create a new Winebottle by default. If not, you should do so.

Under the “Install & Finish” tab, it should show all green check-marks, indicating everything should be good. Click on…

Install

It seems that CrossOver has fixed the graphical errors that we encountered with Quicken 2016. From here you should be able to launch Quicken 2016 once CrossOver is done installing Quicken 2016.

Success!

Conclusion

I walked away from this feeling like Wine is probably a good replacement for a Virtual Machine, though it’s far from perfect.

I still recommend using a virtual machine in most instances, however, older software might be fine with Wine. You won’t know until you try!

If I wasn’t clear on something, please let me know in the comments!

I may or may not add pictures to this in the future. Based on demand, mostly.

~Jared

How to install mono-complete

I wrote out a mini guide on how to install the newest version of mono-complete on Ubuntu 18.04 and Linux Mint 19.x.

I figure that this might be a good place to stick this for now. Although I don’t think there would be a time where this would be need for Wine…

Install at your own risk…

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee -a /etc/apt/sources.list.d/mono-official-stable.list
sudo apt update
sudo apt upgrade
sudo apt install mono-complete

Last Edit: 2019-07-31

Meetup 001 | Wine in 2019…
Tagged on:                                 

One thought on “Meetup 001 | Wine in 2019…

  • July 10, 2019 at 11:35 pm
    Permalink

    Really great post, Jared. Ever since I first installed Linux I’ve been stumbling in the dark around Wine and hoping to find an overview as enlightening and helpful. In my case, your post is to winehq.org what tldr is to man pages.

    I only have a couple of applications I need to run under Wine. I could run these under a Windows virtual machine, but that’s a pain in the wazoo what with the insane Windows update routines and Microsoft’s constant wheedling and machinations to try to cause you to compromise your privacy. And when Wine works correctly, it really works well and seamlessly.

    I’ve been doing a ridiculous amount of distro hopping of late, utilizing both virtual machines and systems installed to USB sticks. Most of the time Wine sets up and runs my desired programs well, but my Kubuntu installs (though now more or less conquered through some kludgey workarounds) have given me some real headaches. With some of the new-to-me information you’ve provided here, I expect I’ll get those nailed too relatively soon.

    The long and short of Kubuntu situation is that I usually have to resort to running my program under Wine via terminal and a particular obscure executable from directly within the program files directory.

    I mention this here because having previously discovered that particular workaround happened to save my bacon today with a new Debian install.

    I’ve been testing Debian 10 stable “Buster” with the Gnome desktop. I’ve done several (semi-informed) installs of Wine under Debian Xfce previously. With the readily available high-quality Debian documentation, all have gone very smoothly, as did the one under Gnome today.

    However, Gnome is still a bit unfamiliar to me and there was ultimately one serious glitch that really threw me.

    I installed Wine in said manner. Then I installed, registered, and opened my program, clicked Activities and observed the new program icon on the favorites menu/panel/dockbar on the left of the Gnome desktop.

    Then I went back into my program, created and saved a test file, and then quit the program. This in the manner traditional for the (relatively old) program from an integral command-line interface within the program. Perhaps notably, I did not close the window from the Activities dropdown menu.

    Whereupon the program icon was gone from the favorites menu/panel/dockbar, the program was unknown to the desktop searchbar, and there was no icon to be found via the Show Applications icon in the favorites menu/panel/dockbar. Nor could the program be run again via the terminal command ‘wine program-name’. To all intents and purposes, my program, freshly and successfully installed under Wine, had completely disappeared.

    Fortunately, through prior experience with the kludgey Kubuntu workaround mentioned above, I knew where the cryptically-named executable lived in the program files in the .wine directories and I was able to open the program again by said means. Whereupon the icon dutifully reappeared on the menu/panel/dockbar. From there I was able to right-click the program icon and permanently install it to that location.

    Thereafter the program was known to the desktop search bar and appeared properly in the Show Applications desktop icon displays. The program can now be started in the familiar ways typical of any Debian Gnome default application.

    All of which is to say, I suppose, that when dealing with Wine, be prepared for the strange and unexpected.

    Reply

Leave a Reply

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