I am attempting to run an application (ParaView) in client-server mode with its graphics rendering being done on the remote (server) end. I am using SSH as my means of connecting to the server, but do not wish to use X-forwarding since it slows down the rendering process.

However, every time I try to open the application on the server's display, I get an error to this effect:

Invalid MIT-MAGIC-COOKIE-1 keyError: cannot open display ':0'

I have conducted extensive research into this matter and have already tried the following suggested procedure to no avail:

  1. Used "xauth list" to get the MIT-MAGIC-COOKIE-1 value for my local host's display.
  2. Logged into the remote host via ssh.
  3. Used "export DISPLAY=:0" on the remote host.
  4. On the remote host, used "xauth add" to overwrite the cookie value for the remote host's display with that of the local host's.

I'm convinced that this is the correct procedure, but that I'm just not transferring the right cookies to the right displays.

Again, I would like to be able to use ssh to effect the opening of applications on the remote computer's display. Ideally, I would like the entire process to be done via xauth rather than xhost, and once again, I have no need to use X-forwarding. What might I be missing or doing wrong?

  • 2
    Is there an X server running on the server's console? I don't understand where you want the program's output to be displayed. Your procedure is clearly wrong since you're getting the local host's cookie but you don't display on the local host. If there is an X server running on the remote machine and that's where you want the program to be displayed, see unix.stackexchange.com/questions/10121/… – Gilles 'SO- stop being evil' May 1 '15 at 21:59

The value you're using for DISPLAY is incorrect: if you don't want to use SSH X forwarding, DISPLAY must indicate the IP address of your X server (the desktop you want to display programs on). On the remote, run

export DISPLAY=desktop:0

replacing desktop with your local hostname or IP address. You may also need to change your X server's configuration to allow remote IP connections.

  • 3
    This ignores the XAUTHORITY problem, which is what causes the actual error message in the subject line. – kiko Dec 6 '18 at 8:29


xhost +local: 

before running it.

  • it did the trick. Thanks, I think it is the shortest answer! – loved.by.Jesus Jul 26 '19 at 16:19
  • $ xhost +local: xhost: unable to open display "desktop:0" – Mona Jalal Jan 23 at 3:10

This one worked for me. So I'm leaving this answer here.

 export DISPLAY=:1.0

For me the error was :

Invalid MIT-MAGIC-COOKIE-1 keyxcb_connection_has_error() returned true
Invalid MIT-MAGIC-COOKIE-1 keyERROR: Unable to create GUI. Exiting

I played with .Xauthority but it did nothing but hide the "MIT cookie" part, not the xcb_connection error. In the end it worked just by using @PSN answer (export DISPLAY=:1.0).

fwiw i'm on debian 9.


The Invalid MIT-MAGIC-COOKIE-1 key part must be a separate (non-)error. I get it in the normal working case of starting any graphical program (even gitk).

Somebody just forgot to end it with a newline, so pretend it's a separate line.


This could be one of the reasons you could get the following error:

Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :1

Make sure you are running any GUI process from the same user where vncserver process is owned by.

For example:

venkat@home-laptop:~/Downloads/$ ps -eaf | grep vnc
venkat    3504     1  0 Apr06 ?        00:09:52 /usr/bin/Xvnc :1 -auth /run/user/1000/gdm/Xauthority -desktop home-laptop:1 (venkat) -fp /usr/share/fonts/X11//misc,/usr/share/fonts/X11//Type1 -geometry 1024x768 -pn -rfbauth /home/venkat/.vnc/passwd -rfbport 5901 -rfbwait 30000
venkat   10595  8391  0 02:33 pts/5    00:00:00 grep --color=auto vnc
venkat@home-laptop:~/Downloads/$ sudo -i
root@home-laptop:~# xclock
Invalid MIT-MAGIC-COOKIE-1 keyError: Can't open display: :1
root@home-laptop:~# exit
venkat@home-laptop:~/Downloads/$ xclock

So run both the vnc server & gui process as same user as possible from local ssh terminal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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