Run PrivateInternetAccess GUI on Wayland

If Private Internet Access GUI is crashing when you try to start it using Wayland for your desktop, then this might be the answer. Or it might not… Depends 🙂

pia vpn on wayland crash fixed featured image
Reading Time: 2 minutes

If you’ve tried to run PrivateInternetAccess GUI on Wayland desktop environment, you may experience some issues, indeed, a complete crash. Searching online provides limited answers about how to fix this problem if it comes up.

Setting Electron Defaults Under Wayland

My problem, I think, was due to the fact that I’ve made some configuration changes to the system Electron application in order for Visual Studio Code to run on my HiDPI laptop without blurriness. Other apps also benefit from these changes which are well documented online. I’ve also added some environment properties in my startup such as;

MOZ_ENABLE_WAYLAND=1
QT_QPA_PLATFORM=wayland
QT_AUTO_SCREEN_SCALE_FACTOR=1

I’m not entirely sure how all those hang together (and please feel free to let me know if you do) but basically I think it tells QT (and therefore Electron applications that use Chrome based framework) to use Wayland itself instead of XWayland.

(BTW the top entry is to get Mozilla to support native Wayland, with the third entry being to help prevent Wayland apps becoming huge when transferring between a high DPI screen with a scaling factor and normal DPI screens).

Some applications support this, and some don’t. For some reason Private Internet Access GUI doesn’t seem to.

Global Wayland Settings, Overridden for One Application

So the solution for Private Internet Access seems to be ensure that PIA GUI client uses XWayland, not native Wayland.

To do this, you’ll need to edit the Private Internet Access Desktop file thus;

sudo nano /usr/share/applications/piavpn.desktop

Change the Exec line to;

Exec=env QT_QPA_PLATFORM=xcb /opt/piavpn/bin/pia-client %u

If I understand correctly this will tell PIA Client to use XWayland instead of native Wayland and in doing so it actually works again. It’s a little blurry on a HiDPI screen but at least it works. Presumably the same would work for any other applications that experience the same issue.

If this has been helpful please drop me a line below. If I’ve got anything wrong, please do feel free to correct me!

Thanks for reading!