The basic problem
The absolute basic problem with buying a Garmin product, be it a Garmin GPS, smartwatch, smartwig or a freakin’ Garmin dildo is that any of the apps does not support Linux. Event if there is a pretty large community around the Garmin Open Source section, most of the devices use proprietary stuff for firmware uploads and general updates of data.
Setting the scene
I have recently acquired a Garmin Fenix 6 smartwatch, because I was fed up with the socialist built Mi semi-smart watch from the Stratos(phere) 3, that regularly stopped working or syncing. This, more than often left me with unfinished workouts, or no logs at all. I do wish from the new device to be capable of doing it’s job flawlessly – especially for the money. By doing it’s job, it is primarily for logging workouts with accurate enough heart rate, O2 measurements are a bonus.
The Garmin family does come at a cost. Not everything can be done from a smart phone, so, a computer is needed. A standard computer comes with an operating system. The operating system (meaning Windows) or MacOS. Anything else is not supported and you can go flick yourself.
The solution
The first ever thing that comes into your mind when you need to run a WIndows executable on a Linux machine, well, contrary to popular belief – a VM! This is my personal experience / preference, because I was almost never completely successful with running Win32/64 binaries in Wine. And when, they had a lot of stuff either missing, or garbled. Especially fonts, or when additional packages are required. And ESPECIALLY, when the binary tried to interact with a peripheral. As it comes, the USB connected watch would be the later here.
While I have found very little evidence of people successfully running GarminExpress in Wine, I decided to try this route first, contrary to my previous experience.
I have no idea how people determine which extra packages are needed for a particular application to run successfully, but I’ve found a very promising video on Youtube: https://www.youtube.com/watch?v=hg01Z6VCox0
Long story short, the sequence of this video is as follows:
- Prepare the environment for binary (including the packages: dotnet,vcrun,corefonts and d3dcompiler)
- Additional settings for the env to really be Win7
- Run the installer with a specific setting to emulate the task bar. This step proved to be crucial
- Modify the Wine launcher to reflect the option of virtual desktop AND a taskbar
Quick and dirty commands
# WINEARCH=win32 WINEPREFIX=/home/ventil/GarminExpress --unattended winetricks dotnet472 vcrun2010 corefonts d3dcompiler_47 # WINEARCH=win32 WINEPREFIX=/home/ventilGarminExpress winetricks win7 # WINEARCH=win32 WINEPREFIX=/home/ventil/GarminExpress wine explorer /desktop=garmin,1200x720 /home/ventil/Downloads/GarminExpress.exe
1, Env preparation
Short recap of what is listed on the Garmin site as requirements:
- Windows 7 Service Pack 1 or newer
- Microsoft .NET 4.7.2 (included in the download)
- 1024 x 768 display
- USB port
- 1 GB RAM
- High-speed Internet access (not for use with dial-up, mobile, or satellite connections)
- Up to 20 GB free disk space
WINEARCH=win32 is quite self-explanatory, this will be set up for a 32-bit architecture, not a 64-bit
WINEPREFIX=/home/ventil/GarminExpress is the destination directory which will be used as the Windows emulated home, C drive and whatever you configure. This is also the path where the binary will be installed. Under “Program Files”
winetricks – this defines you want to configure the environment, not launching an app. This is to be followed by the list of packages to include in the env. The more you select, the more it needs to download, the more will the win home grow. Currently, I have no idea how to determine which packages are needed for the desired application / binary
dotnet472 – is currently the last stable version for wine. GarminExpress refused to work with previous versions, so make sure that you try out different versions of .NET if you encounter problems. Side note: you’ll need to set up the env from beginning after deleting the WinePrefix. In all, it is listed in the requirements, isn’t it?
vcrun2010 – Visual C++ 2010 libraries (mfc100,msvcp100,msvcr100) (Microsoft, 2010). How somebody determined this needs to be there? No idea, was not able to find any info on this. Just keep in mind that a lot apps are dependent on this. How to determine the version? Well…
d3dcompiler_47 – the latest version of MS compiler. Why? Ehm…
It might be that the last 2 packages are part of the SP1 for Win7, who knows?
2, Additional Win7 Setting
This is actually quite clear and already present in the requirements taken from the Garmin site.
3, Running the installer
wine – obviously start wine, followed by what should actually be run.
explorer /desktop=garmin,1200×720 – this is the crucial part. We need to run explorer to setup a fictive, virtual desktop with some name and a resolution of 1200×720. This is my choice, but you can clearly see that the minimal required is 1024×768. Funny enough, 720 was accepted for the vertical resolution, np.
/home/ventil/Downloads/GarminExpress.exe – as the last argument, the downloaded installation binary. This should be replaced by whatever path you have downloaded it to.
Additional concerns
Keep in mind, that the versions of packages and OS version required might change for future releases of GarminExpress. Please check this first with the requirements on their page.
Also, there might some issues with the USB permissions, when WIne would not have access to the hardware descriptor file. Please consult your OS documentation on how to make this available, or which groups should the user be part of… Arch Linux had 0 issues in this regard.
4, Final step, modify the launcher
Launcher content on your desktop: ventil@temelin:~/Desktop$ cat ‘Garmin Express.desktop’
[Desktop Entry] Name=Garmin Express Exec=env WINEPREFIX="/home/ventil/GarminExpress" wine C:\\Program\ Files\\Garmin\\Express\\express.exe Type=Application StartupNotify=true Icon=7F32_express.0 StartupWMClass=express.exe
Should be changed to:
[Desktop Entry]
Name=Garmin Express
Exec=env WINEPREFIX="/home/ventil/GarminExpress" wine explorer /desktop=garmin,1920x1080 C:\\Program\ Files\\Garmin\\Express\\express.exe
Type=Application
StartupNotify=true
Icon=7F32_express.0
StartupWMClass=express.exe
Have you notices the subtle difference? Just adding the section with the explorer and desktop settings. This emulates a taskbar as well. This is (sadly) needed.
Enjoy!