You are not logged in.
Hi all!
I'm searching for how to run two different X session independently on my machine (I need to automate an X application using xdotool, and I want to continue using my PC in the meantime). So I'm learning how to use virtual consoles. The point is, I'm on GNOME with Mutter and Wayland + XWayland. Currently XWayland takes precedence, and all my system is running Xorg for what I can tell (using xeyes and the like).
The wiki says combinations Alt+Fn change TTY, and Alt+arrows move between them. This is not the case for me, where I need to use Ctrl+Alt+Fn to change TTY and Ctrl+Alt+arrows switches virtual desktop. IIUC, this is a feature of GNOME?
I see that tty2 is mapped to my current GNOME session; tty 3 to 6 are mapped to unused virtual consoles, tty over 7 are not enabled (due to this setting, I think). But tty1 directs me to a GNOME GDM login screen, where if I log in, I see my current tty2 session. Why this?/What's its purpose? Is it a feature of GNOME? Is tty1 inaccessible? Shouldn't the graphical session, historically, be mapped to tty7?
Thanks!
Last edited by bertulli (2022-12-28 18:02:10)
We are still learning
- wise people
Offline
The wiki says
What wiki? Alt+Fn should work on the console, but not on X11 (you need ctrl+alt+Fn) - wayland will probably vary.
Why this?/What's its purpose? Is it a feature of GNOME?
"GDM" - it'll open a new display server on a different TTY.
Is tty1 inaccessible?
No, it'S just where GDM is running.
Shouldn't the graphical session, historically, be mapped to tty7?
Very historically, the X11 session was typically launched on tty7.
Could it still? Sure.
Should it? Because?
It's all just numbers and it really doesn't technically matter which TTY runs what kind of session.
XWayland takes precedence, and all my system is running Xorg for what I can tell (using xeyes and the like)
xwayland is a nested X11 server on top of wayland that X11 clients (like xeyes) will use inside a wayland session.
If you're running xwayland, you're NOT running on X11.
loginctl session-statusOffline
The point is, I'm on GNOME with Mutter and Wayland + XWayland. Currently XWayland takes precedence, and all my system is running Xorg for what I can tell (using xeyes and the like).
I'm not sure what this means. You are running gnome on either Xorg or Wayland, it can't be both. Xwayland is a tool to run X11 clients in a Wayland session (somewhat analogous to Wine running windows programs in linux; you don't say you are running Windows OS just because you have some wine apps). That said, none of this is relevant to your actual questions.
I need to use Ctrl+Alt+Fn to change TTY and Ctrl+Alt+arrows switches virtual desktop. IIUC, this is a feature of GNOME?
Alt+FN is sufficient to change from one tty to another. But if Xorg is running, you need to use Ctrl as well. So to switch from an Xorg session on tty2 to a console on tty3, you'd need to press Ctrl+Alt+F3, but to switch back, you'd only need Alt+F2. I believe the major Wayland compositors mimic the Xorg behavior (so gnome on Wayland would likely behave the same in this regard as Xorg).
... tty1 directs me to a GNOME GDM login screen, where if I log in, I see my current tty2 session. Why this?/What's its purpose? Is it a feature of GNOME? Is tty1 inaccessible?
That is a "feature" of GDM, your display manager. It continues running on tty1 and launches sessions on the next available tty upon login. I've long since given up on asking the purpose of display manager functions, as I don't even know the purpose of a display manager! But in these circumstances, yes, tty1 is inaccessible until GDM is stopped.
Shouldn't the graphical session, historically, be mapped to tty7?
In "ancient" history, sure. This was an arbitrary choice made by popular init systems years ago. Systemd broke with tradition and made a different arbitrary choice of allowing a graphical session to run on whatever tty launched it (one of few systemd design choices I fully appreciate). Of course display managers like GDM still decided to screw this up as the display manager will run on one tty and the actual graphical sessions will run on others. Note that I think you can also configure GDM to run on any arbitrary tty, so in theory, GDM could be on tty3, and your gnome session could then run on tty1.
EDIT: cross posted seth pretty much saying the same things.
Last edited by Trilby (2022-12-28 14:15:40)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Shouldn't the graphical session, historically, be mapped to tty7?
That was before systemd tried to implement multi-seat sessions and found separating virtual console and graphical console (like login on tty1, then starting X on tty7 ) created so much holes it was impossible to secure.
Their solution was to have the graphical session take over the tty, effectively disabling console access on that tty.
The wiki says combinations Alt+Fn change TTY, and Alt+arrows move between them
If you are in TTY mode / multi-user target , that is still true.
Your system however boots to graphical target and starts a graphical display manager that takes over tty1 .
For every new session it starts it will use the next free tty.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline
Ah, now I see, GDM uses a separate TTY! Thanks, now I get it. I thought GDM switched to the DE once you log in (thus the two using the same TTY). Also, thanks for the clarification on the Ctrl thing.
At this point I wonder (hoping not to go off topic): since logging in again in GDM lands me on the already running TTY2, is it possible to make it spawn a new session?
I'm not sure what this means. You are running gnome on either Xorg or Wayland, it can't be both. Xwayland is a tool to run X11 clients in a Wayland session (somewhat analogous to Wine running windows programs in linux; you don't say you are running Windows OS just because you have some wine apps). That said, none of this is relevant to your actual questions.
xwayland is a nested X11 server on top of wayland that X11 clients (like xeyes) will use inside a wayland session.
If you're running xwayland, you're NOT running on X11.loginctl session-status
I get this:
[alessandro@commodoroII ~]$ loginctl session-status
3 - alessandro (1000)
Since: Wed 2022-12-28 13:59:01 CET; 1h 23min ago
Leader: 1415 (gdm-session-wor)
Seat: seat0; vc2
TTY: tty2
Service: gdm-password; type x11; class user
State: active
Unit: session-3.scope
├─1415 "gdm-session-worker [pam/gdm-password]"
├─1456 /usr/lib/gdm-x-session --run-script /usr/bin/gnome-session
├─1458 /usr/lib/Xorg vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -nolisten tcp -background none -noreset -keeptty -novtswitch -verbose 3
└─1471 /usr/lib/gnome-session-binary
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event21 - Asus WMI hotkeys: is tagged by udev as: Keyboard
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event21 - Asus WMI hotkeys: device is a keyboard
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event3 - AT Translated Set 2 keyboard: is tagged by udev as: Keyboard
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event3 - AT Translated Set 2 keyboard: device is a keyboard
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event18 - FocalTechPS/2 FocalTech Touchpad: is tagged by udev as: Touchpad
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event18 - FocalTechPS/2 FocalTech Touchpad: no resolution or size hints, assuming a size of 69x50mm
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event18 - FocalTechPS/2 FocalTech Touchpad: device is a touchpad
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) systemd-logind: got resume for 13:66
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event2 - Power Button: is tagged by udev as: Keyboard
dic 28 15:15:01 commodoroII /usr/lib/gdm-x-session[1458]: (II) event2 - Power Button: device is a keyboardTo clarify, my system runs on X (not sure if pure Xorg or XWayland) because of this issue with old NVIDIA drivers (I have a GeForce 920M and I'm using the 470 drivers). For instance, xeyes follow my cursor on the desktop.
Very historically, the X11 session was typically launched on tty7.
Could it still? Sure.
Should it? Because?
It's all just numbers and it really doesn't technically matter which TTY runs what kind of session.
Yeah yeah, that bit was more of a curiosity.
Moreover, following this suggestion:
[alessandro@commodoroII ~]$ loginctl
SESSION UID USER SEAT TTY
3 1000 alessandro seat0 tty2
7 1000 alessandro seat0 tty4
2 sessions listed.
[alessandro@commodoroII ~]$ loginctl show-session 3 -p Type
Type=x11
[alessandro@commodoroII ~]$ loginctl show-session 7 -p Type
Type=ttyLast edited by bertulli (2022-12-28 14:38:08)
We are still learning
- wise people
Offline
is it possible to make it spawn a new session?
Did you try to login as a different user?
A 2nd session on the same user will somewhat require to spawn, isolate and manage a separate session but - while possible, I'm not sure whether GDM supports such ootb or at all.
Edit: the hand is faster than the brain…
Last edited by seth (2022-12-28 16:54:39)
Offline
To elaborate on the above and circle back to what seems to be your main question: a display manager is likely the wrong tool for the job. Just use startx/xinit and this becomes trivially easy.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Did you try to login as a different user?
No, exactly, since my idea was to have two graphical session of the same user. Now I realize this is unusual and thus probably not supported. I can create a second user to do the job: I'll investigate this possibility. Right now I'm trying to see if Xephyr can suit my case.
Just use startx/xinit and this becomes trivially easy.
You mean, launching startx in the new TTY? If that's the case yep, I've seen it works. In fact, that was what I did when I added this edit:
[alessandro@commodoroII ~]$ loginctl
SESSION UID USER SEAT TTY
3 1000 alessandro seat0 tty2
7 1000 alessandro seat0 tty4
2 sessions listed.
[alessandro@commodoroII ~]$ loginctl show-session 3 -p Type
Type=x11
[alessandro@commodoroII ~]$ loginctl show-session 7 -p Type
Type=ttyHere, I launched GNOME in TTY4.
If you have clarifications on this I'd love to hear. Meanwhile, I'll flag this as solved since my main question has been answered. Thanks!
Last edited by bertulli (2022-12-28 18:01:24)
We are still learning
- wise people
Offline