Friday 22 May 2020

Running KDE / QT5 apps on Windows Subsystem for Linux

I've recently started playing with Windows Subsystem for Linux on Windows 10.  Installing Ubuntu 20:04 worked well, and after installing vcxsrv (from here) and running the following command from a Ubuntu command line I can run graphical programs too.

echo "export DISPLAY=:0.0" >> ~/.bashrc

The above line adds the export into the .bashrc file so that it runs every time the console opens (and saves having to remember to export the display before trying to launch a program).

Sound is tricky to get set up (no luck yet) but I'll add a new post if (or when) I manage to get that working.  The biggest problem I've encountered so far is trying to run QT based programs - like any of the KDE apps such as Krita.

They install OK, but when trying to launch them you get an error like this:

krita: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory

The libQt5Core libraries are already installed.  The fix is to install binutils and strip some info from the library:

sudo strip --remove-section=.note.ABI-tag /usr/lib/x86_64-linux-gnu/libQt5Core.so.5

This is the location of the library on my system - if you are running a 32 bit system you may need to change to path of the library to match where it is installed.

 Since running the above command I've been able to run KDE apps without getting the missing library error.