Flatpak Application Not Launching on Linux When NoMachine Server Is Installed

Case: After setting up a NoMachine server and rebooting, certain flatpak applications fail to launch.

Note: The steps provided below are for Viber but will work for any other Flatpak app, presumably.

Solution

For The Terminal

Permanently add the LD_PRELOAD environment variable to terminal session:

  1. echo 'LD_PRELOAD=""' >> .bashrc
  2. source .bashrc

For .desktop Entry (start menu, panel launchers, etc.)

Edit desktop entry (with sudo) and add LD_PRELOAD="" environment variable to Exec:

Desktop Entry] 
Name=Viber 
Comment=Viber VoIP and messenger 
Exec=env LD_PRELOAD="" /usr/bin/flatpak run --branch=stable --arch=x86_64 --command=viber com.viber.Viber 
Icon=com.viber.Viber 
Terminal=false 
Type=Application 
Categories=Network;InstantMessaging;P2P; 
MimeType=x-scheme-handler/viber; 
StartupWMClass=Viber 
X-Flatpak=com.viber.Viber

Source

  1. Cannot open a Flatpak application on Linux when a NoMachine server installed – NoMachine Knowledge Base
  2. unity – Set variable in .desktop file – Ask Ubuntu

Did this solve your issue?