QT on WSL2: reMarkable coding on Windows

A little guide on how to get the QT creator GUI running on Windows WSL2. In this case we set up a development environment to create applications for the reMarkable tablet.

QT on WSL2: reMarkable coding on Windows

Get started with the reMarkable toolchain:

This toolchain is actually from the official reMarkable team. We just need to download and execute it as follows:

wget https://remarkable.engineering/deploy/sdk/sumo_qt5.12_toolchain.sh
sudo chmod +x sumo_qt5.12_toolchain.sh && ./sumo_qt5.12_toolchain.sh

In order to access the toolchain, we now need to source the folder every time we actually want to use it. (you could make it permanent too though) Depending on which path you chose earlier this might look a bit different:

source /usr/local/oecore-x86_64/environment-setup-cortexa9hf-neon-oe-linux-gnueabi

Install QT Creator (GUI) on WSL2

First a few dependencies:

sudo apt-get install -y --no-install-recommends libegl1-mesa libfontconfig  libglu1-mesa libsm6 libxi6 libxrender1 mesa-common-dev
# these are optional if you want to remove qt lib warnings:
sudo apt install -y nvidia-340 mesa-utils && glxgears

Then qtcreator:

sudo apt install qtcreator

Now we could try to start it but it will only show errors as there is currently no display connected. In order to get a display working, we can install an xserver variant on windows. I used VcXsrv as it includes creating firewall entries automatically.  You can find the source here. After installing, start it with XLaunch, accept the firewall entries (if prompted) and go through the setup: display number: 0, Start no client and select Disable access control. Now you should be good to go back to the WSL console and start qtcreator on your windows host with qtcreator:

Now the Qt creator compiler settings ( Tools -> Options -> Kits):

  • Qt Versions
    Name: rM Qt %{Qt:Version} (qt5)
    Path: /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/qt5/qmake
  • Compilers: (with both Add -> GCC -> C and Add -> GCC -> C++)
    Name: rM GCC
    Path: /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gcc
  • Debuggers: (with Add)
    Name: rM GDB
    Path: /usr/local/oecore-x86_64/sysroots/x86_64-oesdk-linux/usr/bin/arm-oe-linux-gnueabi/arm-oe-linux-gnueabi-gdb
  • Kits:

Now add your device directly:

Devices -> Add -> Generic Linux Device

  • IP address: either the IP your device has in WiFi or when connected via USB.
  • Username: root

In case you do not have a private key file yet, go to WSL, type ssh-keygen select your home dir as location and maybe a custom name e.g. remarkable. Now copy the key to your device with ssh-copy-id -i remarkable root@[device-ip].

Add your private key file (~/remarkable) and finish. There might be an error that rsync can not be found but as long as the test, in general, completes everything is fine. (we don't need rsync for that) Now go back to Kits and select the device you just created on the Device.

Now when you type some code you may get some errors about variable has incomplete type: This is because it actually uses clang for this. Disable that by going to Help -> About Plugins -> ClangCodeModel and removing the check. Then restart qtcreator.

Uncheck Enable QML in Projects -> Build & Run -> rM -> Run -> Debugger Settings.

Now you can get started :)


Subscribe to Senpai.Club

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
[email protected]