Skip to content

Instantly share code, notes, and snippets.

@CarlOlson
Created January 12, 2020 20:00
Show Gist options
  • Save CarlOlson/2188dfc2d88795caa63a21603565c4f8 to your computer and use it in GitHub Desktop.
Save CarlOlson/2188dfc2d88795caa63a21603565c4f8 to your computer and use it in GitHub Desktop.
X11 Sharing Troubleshooting

Can't open display?

Ensure DISPLAY is exported and equal to host's DISPLAY.

$ export DISPLAY=:0

No protocol specified?

  • Ensure XAUTHORITY is exported
  • Ensure XAUTHORITY file exists
  • Ensure XAUTHORITY file is read/writeable by your user/group
  • Ensure XAUTHORITY file equals host's (or otherwise valid)
$ stat .Xauthority
  File: .Xauthority
  Size: 50              Blocks: 8          IO Block: 4096   regular file
Device: 10301h/66305d   Inode: 1194630     Links: 1
Access: (0600/-rw-------)  Uid: ( 1000/  ubuntu)   Gid: ( 1000/  ubuntu)
Access: 2020-01-12 05:51:31.886546399 +0000
Modify: 2020-01-12 05:51:31.874546400 +0000
Change: 2020-01-12 05:51:31.874546400 +0000
  • Ensure hostname matches cookie
$ hostname
bad_hostname
$ xauth list
good_hostname/unix:0  MIT-MAGIC-COOKIE-1  00000000000000000000000000000000
$ sudo hostnamectl set-hostname good_hostname
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment