2

I have a multiseat setup using 3 GPUs, loginctl and lightdm and it mostly just works. Two small areas where it doesn't is with bluetooth audio devices and ssh X forwarding misbehaving when I'm not on :0 or at least not the same display number as last time I logged in.

❯ ps axo pid,user,args | grep xorg
   6279 root     /usr/lib/Xorg :1 -seat seat0 -auth /run/lightdm/root/:1 -nolisten tcp vt7 -novtswitch
   6284 root     /usr/lib/Xorg :0 -seat seat2 -auth /run/lightdm/root/:0 -nolisten tcp
   6285 root     /usr/lib/Xorg :2 -seat seat1 -auth /run/lightdm/root/:2 -nolisten tcp

...instead of...

❯ ps axo pid,user,args | grep xorg
   6279 root     /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
   6284 root     /usr/lib/Xorg :1 -seat seat2 -auth /run/lightdm/root/:1 -nolisten tcp
   6285 root     /usr/lib/Xorg :2 -seat seat1 -auth /run/lightdm/root/:2 -nolisten tcp

Putting...

# Force seatN to run on display :N
[Seat:seat0]
xserver-command=/usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch #

[Seat:seat1]
xserver-command=/usr/lib/Xorg :1 -seat seat1 -auth /run/lightdm/root/:1 -nolisten tcp #

[Seat:seat2]
xserver-command=/usr/lib/Xorg :2 -seat seat2 -auth /run/lightdm/root/:2 -nolisten tcp #

...into /etc/lightdm.conf.d/71-seatdisplays.conf makes thing very confusing when I log in at what should be seat0. I end up on display :0 but either seat0, seat1 or seat2, despite the GPU and the mouse and keyboard USB ports feeding that monitor being bound to seat0:

❯ echo $DISPLAY
:0
❯ ps axo pid,user,args | grep xorg
   6711 root     /usr/lib/Xorg :1 -seat seat1 -auth /run/lightdm/root/:1 -nolisten tcp
   6713 root     /usr/lib/Xorg :2 -seat seat2 -auth /run/lightdm/root/:2 -nolisten tcp
   6731 root     /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
❯ loginctl list-sessions
SESSION  UID USER    SEAT  TTY
      3 1000 myuser  seat1
     c1  958 lightdm seat2
     c2  958 lightdm seat0

3 sessions listed.

If I remove the comment # from the end of the xserver-command line, I end up on my correct seat0 but not necessarily display :0. It auto appends what's actually happening to the manually set command and while I end up on the correct seat number, the display is again random:

❯ echo $DISPLAY
:2
❯ ps axo pid,user,args | grep xorg
   6423 root     /usr/lib/Xorg :1 -seat seat1 -auth /run/lightdm/root/:1 -nolisten tcp :0 -seat seat1 -auth /run/lightdm/root/:0 -nolisten tcp
   6428 root     /usr/lib/Xorg :2 -seat seat2 -auth /run/lightdm/root/:2 -nolisten tcp :1 -seat seat2 -auth /run/lightdm/root/:1 -nolisten tcp
   6437 root     /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch :2 -seat seat0 -auth /run/lightdm/root/:2 -nolisten tcp vt7 -novtswitch
❯ loginctl list-sessions
SESSION  UID USER    SEAT  TTY
      3 1000 myuser  seat0
     c1  958 lightdm seat1
     c2  958 lightdm seat2

3 sessions listed.

Since it looks like it's just appending the command with whatever it wants, I've tried setting xserver-command to something inane like sleep 1; /usr/lib/Xorg for seat1 and 2 but that just breaks seat1 and 2:

❯ echo $DISPLAY
:0
❯ ps axo pid,user,args | grep xorg
   6064 root     /usr/lib/Xorg :0 -seat seat0 -auth /run/lightdm/root/:0 -nolisten tcp vt7 -novtswitch
❯ loginctl list-sessions
SESSION  UID USER   SEAT  TTY
      3 1000 myuser seat0

1 sessions listed.

I can only assume it's just whatever command executes or completes first gets :0 and so on.

Is there a way to force seat0 to display :0, seat1 to :1 and seat2 to :2?

Alternatively, is there a way to delay the launch of seat1 and 2 so seat0 always gets first crack at :0?

2
  • Congratulations on getting this far, I think. I know nothing about this complex setup, but I see the archlinux example sets an extra parameter: xserver-layout=seat0
    – meuh
    Oct 21, 2022 at 13:19
  • Unfortunately I don't have a preconfigured xorg.conf. I have tried making one but it mangles my login screens or just plain doesn't work. Probably user error. There's also no nvidia cards in this box either so one shouldn't even be needed. Setting xserver-command=/usr/bin/X :N and xserver-layout=seatN, has similar results to what's above: /usr/lib/Xorg :0 :1 -layout seat0 -seat seat0 -auth /run/lightdm/root/:1 -nolisten tcp vt7 -novtswitch
    – SHawarden
    Oct 23, 2022 at 1:24

1 Answer 1

0

I had the same desire.... It was bothering me to have the mixup! I created: https://github.com/canonical/lightdm/pull/350

Hopefully we can merge it soon and all will has!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .