Issues with "Missing X Server or $DISPLAY"

Heyo! I’m new to snap craft, utilize the newest version of debian, and have been trying to install GeForceNow on my device. Went ahead and installed the example snapcraft of VLC, works perfectly fine, I can access the command menu in terminal. However, when I attempt to run both GeForceNow and GeForceNow-Electron (two separate attempts to install), I get this output:

Using user agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.101 Safari/537.36 Process arguments: /snap/geforcenow/12/linux-unpacked/geforcenow,--use-tray-icon,--no-sandbox,--disable-seccomp-filter-sandbox No protocol specified [6105:1012/] Missing X server or $DISPLAY [6105:1012/] The platform failed to initialize. Exiting.

I’m not going to lie, I don’t know what this means, and none of the issues I’ve been able to find on forums deal with this issue with this program, always occurring within Puppeteer. The same error occurs with geforcenow-electron, and while I think I completed the installation correctly it’s possible I did a stupid and messed up with it. Anybody got any advice on how to handle this?

-Mysterious Stranger

I can tell you what it means, but that may not solve your problem.

The error means “I tried to connect to an X server and failed”.

The failure could be for several reasons:

  1. there is no X server
  2. the DISPLAY environment variable isn’t correctly set
  3. the x11 snap interface is not connected

It is also possible that your environment uses the newer shinier Wayland in preference to X11, in which case your failing application should try to use that.

The way to check the snap interfaces is with the command: snap connections <snap-name>. For example:

$ snap connections vlc
Interface               Plug                        Slot                     Notes
audio-playback          vlc:audio-playback          :audio-playback          -
audio-record            vlc:audio-record            -                        -
avahi-control           vlc:avahi-control           -                        -
camera                  vlc:camera                  -                        -
desktop                 vlc:desktop                 :desktop                 -
desktop-legacy          vlc:desktop-legacy          :desktop-legacy          -
dvb                     vlc:dvb                     -                        -
home                    vlc:home                    :home                    -
jack1                   vlc:jack1                   -                        -
mount-observe           vlc:mount-observe           -                        -
mpris                   -                           vlc:mpris                -
network                 vlc:network                 :network                 -
network-bind            vlc:network-bind            :network-bind            -
opengl                  vlc:opengl                  :opengl                  -
optical-drive           vlc:optical-drive           :optical-drive           -
pulseaudio              vlc:pulseaudio              :pulseaudio              -
removable-media         vlc:removable-media         :removable-media         -
screen-inhibit-control  vlc:screen-inhibit-control  :screen-inhibit-control  -
unity7                  vlc:unity7                  :unity7                  -
x11                     vlc:x11                     :x11                     -

In this case you see the vlc:x11 plug is connected to the system :x11 slot.

Otherwise, you can find support for the problem snap with snap info. For example:

$ snap info vlc | grep contact