You are not logged in.

#1 2016-04-18 19:18:29

marmistrz
Member
Registered: 2016-01-05
Posts: 110

Unable to run an app in a separate X server

I tried to run hedgewars in a separate X server. As the wiki states, I issued the following command in terminator

xinit /usr/bin/hedgewars -- :1 vt$XDG_VTNR

This yielded

/usr/lib/xorg-server/Xorg.wrap: Only console users are allowed to run the X server

So I added this to /etc/X11/Xwrapper.config

allowed_users = anybody
needs_root_rights = no

Now the error is

(EE) xf86OpenConsole: Cannot open virtual console 7 (Permission denied)

When I do this from tty, everything succeeds, but it takes about ~10 secons to launch the app. What am I doing wrong?

Last edited by marmistrz (2016-04-18 19:19:33)

Offline

#2 2016-04-19 01:54:56

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to run an app in a separate X server

I don't think you're doing anything wrong, it works the same for me: start another X from the tty, wait for X and the app to launch, play the game.

Offline

#3 2016-04-19 05:37:14

marmistrz
Member
Registered: 2016-01-05
Posts: 110

Re: Unable to run an app in a separate X server

Yes, but I'd like to launch new X session from an existing one, from my DE.

Offline

#4 2016-04-19 10:45:54

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,910

Re: Unable to run an app in a separate X server

vt$XDG_VTNR

That paramater is the reason you get an error when using that command from within an X-session.

You can try a fixed number of a TTY that's not in use (like vt6) , but that will break logind session management for that tty..
it is possible the app won't work as intended without a proper logind session.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2016-04-19 14:15:13

marmistrz
Member
Registered: 2016-01-05
Posts: 110

Re: Unable to run an app in a separate X server

Well, the real problem is that it takes sooo long for the app to launch.
I tried doing it this way, but what I get is:

(EE) xf86OpenConsole: Cannot open virtual console 8 (Permission denied)

/edit: it seems launching gedit takes a breeze, so maybe it's hedgewars that takes a long time.

I notice chvt can change the virtual terminal, but what would do the trick would be a script which would:
1. enter ttyX
2. automatically login the existing user
3. open a bash prompt/run a command

is such a thing possible?

Last edited by marmistrz (2016-04-19 17:35:02)

Offline

#6 2016-04-20 03:19:21

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to run an app in a separate X server

You can automatically log in as user XYZ and run a script that starts X with certain parameters, launches apps etc. when switching to a tty with Alt-Ctrl-F<number>, but you have to remember which user and which app corresponds to which tty or it won't be automatic ;P

Offline

#7 2016-04-23 12:44:26

marmistrz
Member
Registered: 2016-01-05
Posts: 110

Re: Unable to run an app in a separate X server

It's not really what I mean. Let's assume I'm in my Cinnamon session. I'd like to launch a script, which will run an app in a free virtual terminal, say in the following way

run-separate-x hedgewars 8

Would run hedgewars in tty8 and switch me to that vt, without asking me for password.

The script should run only on-demand. Is it possible to achieve such a thing?

Offline

#8 2016-04-24 03:31:48

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Unable to run an app in a separate X server

I think you should try 'chvt' because you AFAICT can't start X server from another X server. If you allow automatic login (w/o a password) it might work.

Offline

#9 2017-02-12 17:56:29

ender4
Member
Registered: 2011-01-11
Posts: 16

Re: Unable to run an app in a separate X server

I am also having this problem. Any resolution?

It seems that chvt must be run as root.

Offline

Board footer

Powered by FluxBB