ServerSync

ServerSync

48.5k Downloads

Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.

EvilBob01 opened this issue ยท 3 comments

commented

Serversync Version:

2.6.15

Minecraft Version:

1.7.10

Issue:

I'm running a headless (no display or window manager. no GUI installed) Debian Linux server. When I launch I get an error saying it can't connect to the X windows server. I expected the server option to disable the GUI and not require a display. Am I doing something wrong?

Thanks!

Launching with this command: java -jar serversync-2.6.15.jar server Logs (serverysync & minecraft)
finished loading config
Loading language file: en_us
Exception in thread "main" java.awt.AWTError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
        at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
        at sun.awt.X11GraphicsEnvironment.access$200(X11GraphicsEnvironment.java:65)
        at sun.awt.X11GraphicsEnvironment$1.run(X11GraphicsEnvironment.java:115)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.awt.X11GraphicsEnvironment.(X11GraphicsEnvironment.java:74)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at java.awt.GraphicsEnvironment.createGE(GraphicsEnvironment.java:103)
        at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:82)
        at sun.awt.X11.XToolkit.(XToolkit.java:126)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:264)
        at java.awt.Toolkit$2.run(Toolkit.java:860)
        at java.awt.Toolkit$2.run(Toolkit.java:855)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:854)
        at java.awt.Toolkit.getEventQueue(Toolkit.java:1734)
        at java.awt.EventQueue.invokeLater(EventQueue.java:1266)
        at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1290)
        at runme.Main.main(Main.java:46)
commented

Using the server flag when starting serversync should indeed not be running anything from AWT.

commented

I think I'm starting to understand this. Xauth dosn't keep the display permissions when you "su" to another user eg: minecraft. The easy fix is to just login as whatever your minecraft user is and start Serversync from that user directly. It does work in screen too ;)

Basically this is what's going on:
http://blog.mobatek.net/post/how-to-keep-X11-display-after-su-or-sudo/
Pasted from above link.

We receive a lot of emails asking how to keep X11-forwarding working after changing user to root inside a SSH session. This is by default not allowed on Unix/Linux systems, because the X11 display connection belongs to the user you used to log with when connecting to your remote SSH server. X11-forwarding mechanism does not allow anyone to use the open display.

Thanks for the reply I'm all good now and I understand what's going on with my config. You can close this one if you want. Or if you want I'll be happy to test more.

commented

Interesting, shall keep this open to look further into later ๐Ÿ˜€