Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

[Solved] Can't start second X session with startx

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
19 posts • Page 1 of 1
Author
Message
flyerone
n00b
n00b
Posts: 61
Joined: Tue Nov 19, 2019 10:49 pm
Location: 127 0 0 1

[Solved] Can't start second X session with startx

  • Quote

Post by flyerone » Mon Aug 03, 2020 12:53 am

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.
Top
oneone
Tux's lil' helper
Tux's lil' helper
Posts: 113
Joined: Wed Sep 20, 2017 12:45 pm

  • Quote

Post by oneone » Mon Aug 03, 2020 6:11 am

With which USE flags did you compile xorg-server? And what's the content of your /etc/X11/xinit/xserverrc?
Top
flyerone
n00b
n00b
Posts: 61
Joined: Tue Nov 19, 2019 10:49 pm
Location: 127 0 0 1

  • Quote

Post by flyerone » Mon Aug 03, 2020 1:57 pm

xorg-server

Code: Select all

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.
Top
flyerone
n00b
n00b
Posts: 61
Joined: Tue Nov 19, 2019 10:49 pm
Location: 127 0 0 1

  • Quote

Post by flyerone » Sat Aug 08, 2020 10:11 pm

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

Code: Select all

startx -- :1
working.

Regards.
Last edited by flyerone on Sun Aug 09, 2020 1:12 am, edited 1 time in total.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Sat Aug 08, 2020 10:40 pm

How are you starting the first Xorg session?
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
flyerone
n00b
n00b
Posts: 61
Joined: Tue Nov 19, 2019 10:49 pm
Location: 127 0 0 1

  • Quote

Post by flyerone » Sat Aug 08, 2020 11:06 pm

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.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Sat Aug 08, 2020 11:27 pm

I'd change .xinitrc from

exec wmaker

to

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

and see if it will start the 2nd session
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
flyerone
n00b
n00b
Posts: 61
Joined: Tue Nov 19, 2019 10:49 pm
Location: 127 0 0 1

  • Quote

Post by flyerone » Sun Aug 09, 2020 1:10 am

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.
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2116
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Sun Aug 09, 2020 1:30 am

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.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Sun Aug 09, 2020 10:21 am

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>
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2116
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Sun Aug 09, 2020 2:52 pm

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).
Top
flyerone
n00b
n00b
Posts: 61
Joined: Tue Nov 19, 2019 10:49 pm
Location: 127 0 0 1

  • Quote

Post by flyerone » Sun Aug 09, 2020 8:12 pm

flyerone wrote:xorg-server

Code: Select all

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: Select all

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.
Top
account
n00b
n00b
Posts: 10
Joined: Wed Sep 02, 2009 7:52 pm

  • Quote

Post by account » Mon Aug 10, 2020 10:45 am

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

This command

Code: Select all

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: Select all

Fatal server error:
(EE) parse_vt_settings: Cannot open /dev/tty0 (Permission denied)
I tried

Code: Select all

startx -- :1 vt8
which just gives me a very similar error

Code: Select all

Fatal server error:
(EE) xf86OpenConsole: Cannot open virtual console 8 (Permission denied)
How can i achieve starting a second X session from within KDE?
Top
flyerone
n00b
n00b
Posts: 61
Joined: Tue Nov 19, 2019 10:49 pm
Location: 127 0 0 1

  • Quote

Post by flyerone » Mon Aug 10, 2020 3:56 pm

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

This command

Code: Select all

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: Select all

#!/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.
Top
account
n00b
n00b
Posts: 10
Joined: Wed Sep 02, 2009 7:52 pm

  • Quote

Post by account » Mon Aug 10, 2020 5:59 pm

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?
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2116
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Mon Aug 10, 2020 9:13 pm

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).
Top
flyerone
n00b
n00b
Posts: 61
Joined: Tue Nov 19, 2019 10:49 pm
Location: 127 0 0 1

  • Quote

Post by flyerone » Mon Aug 10, 2020 10:31 pm

I hope I could help him.

GDH-gentoo, did I misstep? I've put it together to work-around this and it worked here.
Top
GDH-gentoo
Advocate
Advocate
User avatar
Posts: 2116
Joined: Sat Jul 20, 2019 7:02 pm
Location: South America

  • Quote

Post by GDH-gentoo » Mon Aug 10, 2020 10:49 pm

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.
Top
account
n00b
n00b
Posts: 10
Joined: Wed Sep 02, 2009 7:52 pm

  • Quote

Post by account » Tue Aug 11, 2020 9:32 am

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.
Top
Post Reply

19 posts • Page 1 of 1

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic