You are not logged in.

#1 2020-06-07 09:58:22

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 195
Website

Running Xorg without touching the VT

Is it possible to run Xorg without changing the VT, so the text-mode Linux console remains active on its monitor while Xorg is in use on another screen?

I have used loginctl to configure a multi-seat set up.  The system boots to an onboard MGA video card which I left in seat0, and I added an nVidia card (which is blank during boot) as seat1, and set USB keyboards etc. to match.

If I run this normally then I get two independent Xorg sessions as you'd expect, and I can use two keyboards to log in and use each one separately - one on the onboard MGA card, and one on the nVidia card.  So multiseat Xorg works just fine.

I then tried to tell Xorg not to use seat0, so that it would only come up on the nVidia card.  This works, and the onboard card is left with the Linux console displaying, except for two things:

  1. The seat0 card, not used by Xorg, switches to display tty7

  2. The content displayed is not updated while Xorg is running.

If I am logged in on seat0 on tty2, then via SSH I start Xorg, seat0 switches to tty7.  If I then run this:

echo test-tty2 > /dev/tty2
echo test-tty7 > /dev/tty7

Nothing happens until Xorg terminates, then I finally see "test-tty7" appear on the seat0 screen.  If I run "chvt 2" (or press Alt+Ctrl+F2) then I get back to my session on seat0 where I see "test-tty2" has been printed.  But as soon as Xorg starts, it flips the unused seat0 back to tty7 and stops updating it.

Running "chvt 2" while Xorg is running gets the unused seat0 back to showing tty2 and it becomes usable, but it also blanks out the nVidia card, completely disabling that seat.

I tried starting the Xorg server on vt2 instead, and I found I could keep the tty active by also including the "-sharevts" parameter to the X server.  This appeared to be perfect as I could still use the console via seat0 without affecting X on seat1, except once I started typing things into the X seat1, the letters started appearing on seat0 as well.  In other words, any input devices Xorg uses are sent to the tty, and picked up by anything listening on the tty, in my case both an X session and a console session.  (My X display manager was prompting for my password so I typed "ls" and pressed enter, and it told me my password was incorrect while seat0 gave me a directory listing.)

My goal is to be able to log in and use seat0 just like a normal text console while Xorg is running, but it seems this is not possible.  It looks like there are kernel boot parameters for multi-head text consoles, and multi-head Xorg works just fine, but apparently you can't have one head on X11 and the other as a console?

Does anyone have any ideas about a way to get this working?

Offline

#2 2020-06-07 14:57:45

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,389

Re: Running Xorg without touching the VT

It's probably loginctl that keeps the tty & X linked to the same session .

What you describe sounds like gnu screen / tmux do for terminals , but you want it for X .
Maybe Xpra ?


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

Online

#3 2020-06-08 00:16:19

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 195
Website

Re: Running Xorg without touching the VT

Thanks for the suggestion.  I think Xpra, like GNU Screen, operates at too high a level.  The problem seems to be that both monitors are linked to the same TTY, even though I have configured them as separate seats.  So even if I introduce Xpra or GNU Screen into the mix, I still have the problem that I want a different TTY shown on each seat.

Offline

#4 2020-06-10 06:36:50

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 195
Website

Re: Running Xorg without touching the VT

I've done some more research on this and the problem can now be summarised like this:

If you run X on a VT (usually VT7) then that captures the keyboard input and all monitors change to show VT7, which means they all go blank except for the ones in use by X.

If you tell X not to use a VT at all (with the -sharevts option), then it can be run totally ignoring the VT system.  This allows the console to switch VTs as normal and it won't affect the X session.  However the one big limitation with this is that because the VTs are unchanged, the keyboard being used for X still types into the terminal!  (This is because connecting two keyboards to a Linux machine has them both type into the console, and it continues to function like this even after X has started listening to one of the keyboards too.)

So you can be typing away in a text editor within X and at the same time all your commands are going into a terminal on tty1 and being run as shell commands.

So the solution is to somehow tell Linux to ignore one of the connected keyboards, but still make it available as evdev/input devices so that X can still use it.

Does anyone have any idea how to tell the Linux console to ignore input from a particular keyboard, while allowing input from another?  I know with USB devices you can unbind drivers via sysfs but I can't see if this is possible with the console.

Offline

#5 2020-06-10 10:31:41

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 15,389

Re: Running Xorg without touching the VT

Did some searching and it seems linux VT system doesn't allow what you want.

KMSCON or "userful multiseat" could maybe do what you want, but kmscon hasn't seen new code since 2013 and the proprietary userful multiseat product was discontinued.

The systemd-consoled that was aiming to redesign the linux console system has vanished completely.

Maybe separating X and console by running X in VMs could achieve what you want ?


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

Online

#6 2020-06-11 07:51:07

Malvineous
Member
From: Brisbane, Australia
Registered: 2011-02-03
Posts: 195
Website

Re: Running Xorg without touching the VT

Yeah I stumbled across kmscon too but it looks like with systemd taking over some of the multiseat stuff and everyone running X or Wayland it wouldn't have seen a lot of use.  Thanks for confirming my suspicions that it is probably not doable.

Not so keen on running anything in a VM as it will add another layer of complexity on top of everything, and for my use case is probably going to be more trouble than it's worth.  But if you use KVM or something to split resources it may work around the issue.

Might be simpler to try to hack something into the kernel instead to get it to ignore my keyboard smile

Offline

Board footer

Powered by FluxBB