Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Can't start second X session with startx
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
flyerone
n00b
n00b


Joined: 19 Nov 2019
Posts: 34
Location: 127 0 0 1

PostPosted: Mon Aug 03, 2020 12:53 am    Post subject: [Solved] Can't start second X session with startx Reply with quote

Hello, I'm having problem using 'startx -- :1' as to to start a second X session.

I have elogind for all things KDE-plasma and now I'm running xfce4, I can log in normally the first time.

When I was busy editing and didn't want to stop the session I would try to run Windowmaker quickly to check something out. I have the .xinitrc with 'exec wmaker'. When I'll try startx -- :1 it bombs with

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

Is the error due to the skew from elogind? What elso will I need in .xinitrc besides 'exec wmaker'?

I've been around Linux since RH 5.2 but I've not been keeping up lately.


Last edited by flyerone on Tue Aug 11, 2020 12:17 am; edited 5 times in total
Back to top
View user's profile Send private message
oneone
n00b
n00b


Joined: 20 Sep 2017
Posts: 65

PostPosted: Mon Aug 03, 2020 6:11 am    Post subject: Reply with quote

With which USE flags did you compile xorg-server? And what's the content of your /etc/X11/xinit/xserverrc?
Back to top
View user's profile Send private message
flyerone
n00b
n00b


Joined: 19 Nov 2019
Posts: 34
Location: 127 0 0 1

PostPosted: Mon Aug 03, 2020 1:57 pm    Post subject: Reply with quote

xorg-server
Code:
Installed versions:  1.20.8-r1(0/1.20.8)(kl. 13.06 +0200 25. juli 2020)(elogind ipv6 libglvnd udev xorg xvfb -debug -dmx -doc -kdrive -libressl -minimal -selinux -static-libs -suid -systemd -unwind -wayland -xcsecurity -xephyr -xnest)



xserverrc
    #!/bin/sh
    if [ -z "$XDG_VTNR" ]; then
    exec /usr/bin/X -nolisten tcp "$@"
    else
    exec /usr/bin/X -nolisten tcp -keeptty "$@" "vt$XDG_VTNR"
    fi


There's no wayland on my system. I see I have the same useflags as you, does the xserverrc check out?


Regards.
Back to top
View user's profile Send private message
flyerone
n00b
n00b


Joined: 19 Nov 2019
Posts: 34
Location: 127 0 0 1

PostPosted: Sat Aug 08, 2020 10:11 pm    Post subject: Reply with quote

I've had a hunch that the occurance of elogind I've set up (for Plasma) is supposed to stop

Code:
startx -- :1


working.

Regards.


Last edited by flyerone on Sun Aug 09, 2020 1:12 am; edited 1 time in total
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4872
Location: Dallas area

PostPosted: Sat Aug 08, 2020 10:40 pm    Post subject: Reply with quote

How are you starting the first Xorg session?
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
flyerone
n00b
n00b


Joined: 19 Nov 2019
Posts: 34
Location: 127 0 0 1

PostPosted: Sat Aug 08, 2020 11:06 pm    Post subject: Reply with quote

Hi, I'm using sddm to log in the first session.

I've tried to start up the machine without xdm too but I'm not allowed to start a second X session there either - same error.

Sorry I didn't save all the logs. The gist of it is just the error stated above.

Come to think of it it's not common sense to start the session this way, it's just that "I have an app for it" and I happen to like Windowmaker (who can blame me).


Last edited by flyerone on Sun Aug 09, 2020 12:57 am; edited 1 time in total
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4872
Location: Dallas area

PostPosted: Sat Aug 08, 2020 11:27 pm    Post subject: Reply with quote

I'd change .xinitrc from

exec wmaker

to

exec dbus-launch --exit-with-session wmaker

and see if it will start the 2nd session
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
flyerone
n00b
n00b


Joined: 19 Nov 2019
Posts: 34
Location: 127 0 0 1

PostPosted: Sun Aug 09, 2020 1:10 am    Post subject: Reply with quote

Thanks,

I've tried all tree, it still says virtual console 8 denied. I've even had

dbus-launch --exit-with-session exec wmaker
dbus-launch --exit-with-session wmaker

as well as your idea with exec in front. I thought that the dbus-launch replaced exec.. my bad.

The system log messages still runs at VT12 as usual, is there a thing in particular that could inhibit VT8 usage?

When I press Alt+F7,F8,F9 should I get blank screens? They didn't change when I tried to switch between them.
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 483
Location: South America

PostPosted: Sun Aug 09, 2020 1:30 am    Post subject: Reply with quote

I don't think that non-root Xorg can easily support that. What you can try is changing to a different virtual terminal with CTRL + Alt + F<number>, logging in (so that elogind creates a new session), and doing exec startx -- /etc/X11/xinit/xserverrc :1. If that works, you could make a script so that you don't have to type all that every time.
Back to top
View user's profile Send private message
Anon-E-moose
Advocate
Advocate


Joined: 23 May 2008
Posts: 4872
Location: Dallas area

PostPosted: Sun Aug 09, 2020 10:21 am    Post subject: Reply with quote

You are not going to be able to use vt8 with the startx command, what you can do is use vt? w/startx

instead of startx -- :1, which it will automatically figure out if it needs :0, :1, etc do startx -- vt<whatever term # you switched to>
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie & modified) amd64-no-multilib, eudev, openrc, openbox, palemoon
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 483
Location: South America

PostPosted: Sun Aug 09, 2020 2:52 pm    Post subject: Reply with quote

Anon-E-moose wrote:
[...] do startx -- vt<whatever term # you switched to>

-keeptty is also needed with elogind. That's equivalent to specifying xserverrc in the command line (well, the latter also adds -nolisten tcp).
Back to top
View user's profile Send private message
flyerone
n00b
n00b


Joined: 19 Nov 2019
Posts: 34
Location: 127 0 0 1

PostPosted: Sun Aug 09, 2020 8:12 pm    Post subject: Reply with quote

flyerone wrote:
xorg-server
Code:
Installed versions:  1.20.8-r1(0/1.20.8)(kl. 13.06 +0200 25. juli 2020)(elogind ipv6 libglvnd udev xorg xvfb -debug -dmx -doc -kdrive -libressl -minimal -selinux -static-libs -suid -systemd -unwind -wayland -xcsecurity -xephyr -xnest)




Yes, I think it's the "-suid" that's spoiled my fun. I didn't think much about it and once it had to change I hadn't caught on.

Thanks to GDH-gentoo I could do this in VT2:

Code:
exec startx -- /etc/X11/xinit


It's easier to throw it in a script. I actually have some luks scripts for a flash drive to make sure I had the right one (for memories).

I've actually looked up GDH-gentoo, is that a variant? I think it's your name.

Anon-E-moose wrote:
[...] do startx -- vt<whatever term # you switched to>


This also worked. I can't figure out why xterm grabs the key input if I try ctrl+alt+F7, I just have to put xterm out of focus and I could switch.

In the days of Slackware 7.1 it was just a fun thing to do. I had bought 512MB of ram (needed the 32MB for the SoundBlaster) and could run it five times before the swap became to busy. And had to try the KDE that had just turned version 1.1 (my favorite because QT started as Norwegian). And I had to check it just now. :o

Sorry about the bother. I'll consider it solved, it's just an irk I had to fix.

Regards.
Back to top
View user's profile Send private message
account
n00b
n00b


Joined: 02 Sep 2009
Posts: 10

PostPosted: Mon Aug 10, 2020 10:45 am    Post subject: Reply with quote

I have a similar problem. I want to start a second X session (twm) from KDE.

This command
Code:
startx -- :1

used to work, it gave me a new X on vt8 and i could use ctrl-alt-f7 and ctrl-alt-f8 to switch between KDE and twm.

When i run the command now, i get
Code:
Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)


I tried
Code:
startx -- :1 vt8
which just gives me a very similar error
Code:
Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 8 (Permission denied)


How can i achieve starting a second X session from within KDE?
Back to top
View user's profile Send private message
flyerone
n00b
n00b


Joined: 19 Nov 2019
Posts: 34
Location: 127 0 0 1

PostPosted: Mon Aug 10, 2020 3:56 pm    Post subject: Reply with quote

account wrote:
I have a similar problem. I want to start a second X session (twm) from KDE.

This command
Code:
startx -- :1

used to work, it gave me a new X on vt8


We had agreed you can't start a new session from "in" KDE. Sorry.

You can start twm normally from console without the xdm service started? .xinitrc needs to be set.

Build the startx script to save oneself from typing.

touch starttwm.sh
chmod +x starttwm.sh

edit:
Code:
#!/bin/sh

exec startx -- /etc/X11/xinit/xserverrc :1


It's probably due to the USE="-suid" being replaced by the login manager you'll have to change to VT1 first.

Now press Ctrl+Alt+F1 to drop to VT1.

Run the suggestion above in "./starttwm.sh"

Enjoy the two desktops between Ctrl+Alt+F1 and Ctrl+Alt+F7.
Back to top
View user's profile Send private message
account
n00b
n00b


Joined: 02 Sep 2009
Posts: 10

PostPosted: Mon Aug 10, 2020 5:59 pm    Post subject: Reply with quote

flyerone wrote:

We had agreed you can't start a new session from "in" KDE. Sorry.


That seems to be a step backward, it used to work and now it doesn't.

I can start a second X from the text console, but i would rather avoid having to do ctrl-alt-f2, type login & password, run a script, just to get another X session running. Unfortunately i don't have enough expertise to dig deeper and find out what is the problem. Maybe someone with more knowledge could give a hint?
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 483
Location: South America

PostPosted: Mon Aug 10, 2020 9:13 pm    Post subject: Reply with quote

account wrote:
Unfortunately i don't have enough expertise to dig deeper and find out what is the problem. Maybe someone with more knowledge could give a hint?

1) Non-root Xorg cannot get a new virtual terminal because that requires privileges; it has to use the one its standard input, output or error is redirected to.
2) Non-root Xorg is programmed to run in a logind session. And the commonly available programs that create sessions are display managers and /bin/login (via pam_elogind).
Back to top
View user's profile Send private message
flyerone
n00b
n00b


Joined: 19 Nov 2019
Posts: 34
Location: 127 0 0 1

PostPosted: Mon Aug 10, 2020 10:31 pm    Post subject: Reply with quote

I hope I could help him.

GDH-gentoo, did I misstep? I've put it together to work-around this and it worked here.
Back to top
View user's profile Send private message
GDH-gentoo
Guru
Guru


Joined: 20 Jul 2019
Posts: 483
Location: South America

PostPosted: Mon Aug 10, 2020 10:49 pm    Post subject: Reply with quote

flyerone wrote:
GDH-gentoo, did I misstep?
No, I don't think so.

flyerone wrote:
I've put it together to work-around this and it worked here.
The way you did it seems to me the easiest way that something like this can work with USE=-suid. I just wanted to answer why I believe it is.

It's a variation of what slashbeast suggested, anyway.
Back to top
View user's profile Send private message
account
n00b
n00b


Joined: 02 Sep 2009
Posts: 10

PostPosted: Tue Aug 11, 2020 9:32 am    Post subject: Reply with quote

So there's really no way to start non-root X from within X.

Well i guess i have to do the ctrl-alt-f1 and login before i could start my second X. It's not a great tragedy but i was hoping maybe there's a way around it. Thanks everyone for replies and info.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum