I have a raspberry pi 2 and installed the Raspbian Version from 2015-05-05.

As "boot option" I chose "Console Text console..." because I don't want a full desktop.

I logged in from my remote PC via SSH (putty). I want to start Firefox but get the following error:

root@raspberry:~# firefox

(process:2425): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size =                                   = 0' failed
Error: no display specified

If I try to start xclock I also get an error:

root@raspberry:~# xclock
Error: Can't open display:

I want to start the programs on my display connected via HDMI. Even if I do this directly on my raspberry console it doesn't work.

How can I tell my raspberry to display this programs on my via HDMI connected Display?

  • I've just noticed it's sort of implicit here that you don't have any GUI desktop running. You cannot run a GUI app without a desktop.
    – goldilocks
    Jun 1, 2015 at 23:20
  • What is showing on your HDMI display?
    – Bex
    Jun 2, 2015 at 7:16
  • Hi Bex, the console session is showing on the HDMI display.
    – frupfrup
    Jun 2, 2015 at 8:26

3 Answers 3


You need the display number. To find that:

> xauth list
localhost.localdomain/unix:1  MIT-MAGIC-COOKIE-1  ea5bf

It's the number after the colon. Then set:

export DISPLAY=:1

Notice I included the colon. You should now be able to launch xclock or

firefox &

You have to be logged in as the same user who opened the display, or else run that root/sudo, which in the case of a web browser is a bad idea.

  • if i try this i get: root@raspberry:~# firefox & [1] 2335 root@raspberry:~# (process:2335): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed Error: cannot open display: :0.0
    – frupfrup
    Jun 1, 2015 at 14:55
  • Hmm -- works for me. I've edited in how to make sure the display number is correct.
    – goldilocks
    Jun 1, 2015 at 15:38
  • hm... okay maybe X is the problem. if i do xauth list i recive nothing...
    – frupfrup
    Jun 2, 2015 at 6:39
  • @frupfrup Did you start X? Is it installed?
    – Bex
    Jun 2, 2015 at 7:14
  • X musst be installed because with startX comand i get the "normal" Raspbian desktop. I also can leave this activ but i would like to start e.g. xclock directly from the console... or is this still impossible? - Sorry i am not an linux expert... :-/
    – frupfrup
    Jun 2, 2015 at 8:28

To start xWindows stuff over the ssh you need to add -X to the ssh command, so:

ssh -X ....

In putty it is a bit different - you need to enable X11 forwarding by following this procedure (for example :))

  • ok. Thx for this link. But i get the error mentioned in the comment before also if i type in "Firefox &" directly on console... i would even be happy if it would work on the console
    – frupfrup
    Jun 1, 2015 at 15:03
  • @Bostjan ... can you copy the highlights of the article you reference into your answer - the page might go away some time in the future and that would leave your answer without a key component.
    – Phil B.
    Jun 1, 2015 at 16:31
  • 2
    But the O.P. isn't trying to forward X (I think); s/he wants to start a GUI application on the remote machine's display after logging in via ssh. X11 forwarding is when you want to run a GUI application from the remote machine and display it on your local desktop. I can start xclock on another system with X11Forwarding no in sshd_config and without using -X, as long as I set the DISPLAY variable correctly. I can't promise it isn't something else to do with the sshd config, or the X server config, but this is not the issue.
    – goldilocks
    Jun 1, 2015 at 19:55

If you want to run xclock from console with out startx try : xinit xclock

NOTE: this is an alternative compromise :) But you need to run startx then you can run and X application(Gui Application).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.