You are not logged in.

#1 2016-09-16 13:35:54

hubcap
Member
Registered: 2016-09-16
Posts: 3

[SOLVED] Could not connect to X server

When I try to launch graphical application from other's system user, it prompts these:
Unable to init server: Could not connect: Connection refused
I tried "xhost +local:", it gave no effect.

Last edited by hubcap (2016-09-16 14:12:45)

Offline

#2 2016-09-16 13:42:56

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: [SOLVED] Could not connect to X server

We need more information. Is xserver already started? Are you launching from within X or another tty or what? How are you launching it (e.g., what command did you type in)?


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#3 2016-09-16 13:47:31

hubcap
Member
Registered: 2016-09-16
Posts: 3

Re: [SOLVED] Could not connect to X server

Yes, X server is already started, and I launching from within X.
Well, for example
firefox: Error: GDK_BACKEND does not match available displays
gedit: Unable to init server: Could not connect: Connection refused

(gedit:1974): Gtk-WARNING **: cannot open display:
file-roller:Unable to init server: Could not connect: Connection refused

** (file-roller:1982): CRITICAL **: Failed to parse arguments: Cannot open display:

Offline

#4 2016-09-16 14:01:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,530
Website

Re: [SOLVED] Could not connect to X server

hubcap wrote:

When I try to launch graphical application from other's system user

This is the problem.  You can't run X clients from a different user - at least not without passing a load of environment variables and handling permission issues.  At the very least you'd need to define DISPLAY, but in many cases that'd not be sufficient.

Use gksu or kdesu.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#5 2016-09-16 14:10:27

hubcap
Member
Registered: 2016-09-16
Posts: 3

Re: [SOLVED] Could not connect to X server

Trilby wrote:
hubcap wrote:

When I try to launch graphical application from other's system user

This is the problem.  You can't run X clients from a different user - at least not without passing a load of environment variables and handling permission issues.  At the very least you'd need to define DISPLAY, but in many cases that'd not be sufficient.

Use gksu or kdesu.

Defining DISPLAY worked, thank you for help.

Offline

Board footer

Powered by FluxBB