You are not logged in.

#1 2012-05-28 17:42:14

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

two different X sessions; one on tty7/one on tty8

Is it possible to have user foo have an X session on tty7 and to have user bar have an X session on tty8?  One can run gdm or lightdm and then 'switch users' but I'd rather not have a greeter at all and just rely on Clt+Alt+F7 or Clt+Alt+F8.

Thanks.

Offline

#2 2012-05-28 18:04:37

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: two different X sessions; one on tty7/one on tty8

Yes.

You just have a line in each users' .profile depending on which TTY they log in from: foo can startx on :0 and bar on :1


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2012-05-28 18:09:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,546
Website

Re: two different X sessions; one on tty7/one on tty8

Or even with the same user.  While running X on tty7, launched from tty1, I went to tty2 and ran

xinit -- :1

and I had a new x session on tty8.  I could switch between the two just as expected.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#4 2012-05-28 18:50:29

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

Nice.  Thanks.  I will try it.

Last edited by graysky (2012-05-28 18:50:43)

Offline

#5 2012-05-28 18:54:30

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

I do what you describe by using XDM...

From my notes:
Effective 1/25/2012 gdm is replaced with xdm. gdm was not willing to cooperate with user list not being shown and user switching started too many X sessions. With xdm configure two servers in /etc/X11/xdm/Xservers:
:0 local /usr/bin/X :0
:1 local /usr/bin/X :1

This will give X servers on tty7 and tty8
xdm-archlinux package is added. This provides a nicer look. Then tty8 and tty7 can be configured to show different messages.
/etc/X11/xdm/archlinux/xdm-config is configured currently like such:
these lines are added:
DisplayManager._1.setup:    /etc/X11/xdm/archlinux/Xsetup
DisplayManager._1.startup:    /etc/X11/xdm/archlinux/Xstartup
DisplayManager._1.reset:    /etc/X11/xdm/TakeConsole
DisplayManager._1.resources:    /etc/X11/xdm/archlinux/Xresources1
and copy the Xresources file and make changes accordingly.
For Xresources I have Xlogin*greeting:User1
For Xresources1 I have Xlogin*greeting:User2

Offline

#6 2012-05-28 22:37:18

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

@bnb - you lose me here:

/etc/X11/xdm/archlinux/xdm-config is configured currently like such:
these lines are added:
DisplayManager._1.setup:    /etc/X11/xdm/archlinux/Xsetup
DisplayManager._1.startup:    /etc/X11/xdm/archlinux/Xstartup
DisplayManager._1.reset:    /etc/X11/xdm/TakeConsole
DisplayManager._1.resources:    /etc/X11/xdm/archlinux/Xresources1
and copy the Xresources file and make changes accordingly.
For Xresources I have Xlogin*greeting:User1
For Xresources1 I have Xlogin*greeting:User2

I added the lines you mentioned to the files you mentioned but found that xdm only ran on tty3 and wouldn't differentiate between users.

EDIT: I started a new thread here since I'd like to have lxdm place user foo in tty7 and user bar in tty8.

https://bbs.archlinux.org/viewtopic.php?pid=1107708

Last edited by graysky (2012-05-28 22:42:46)

Offline

#7 2012-05-28 22:52:24

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: two different X sessions; one on tty7/one on tty8

I think, given what you are trying to achieve, you are overengineering this.

On my home desktop, my .profile allows me to log into TTY1-3 and my wife logs into TTY4: my display is :0 and her's is :1

My .profile:

# startx if on tty1 and tmux on tty2
if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty1 ]]; then
    exec xinit -- :0 -novtswitch &>/dev/null &
    logout
    
  elif [[ $(tty) = /dev/tty2 ]]; then
    tmux -f $HOME/.tmux/conf new -s secured
fi

The missus:

if [[ -z "$DISPLAY" ]] && [[ $(tty) = /dev/tty4 ]]; then                                                                   
     exec xinit -- :1 -novtswitch &>/dev/null &
     sleep 10
     logout
fi

No need for bloated login manager...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#8 2012-05-28 23:01:42

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

Okie doke... Let me try again.

I have xdm-archlinux installed.

in /etc/inittab, I am starting xdm

id:5:initdefault:
x:5:respawn:/usr/bin/xdm -nodaemon -config /etc/X11/xdm/archlinux/xdm-config

Normally in /etc/X11/xdm/archlinux you have a file called Xresources. I copy that and call the copied file Xresources1
Inside  /etc/X11/xdm/archlinux/xdm-config I have added the lines shown

DisplayManager._1.setup:    /etc/X11/xdm/archlinux/Xsetup
DisplayManager._1.startup:    /etc/X11/xdm/archlinux/Xstartup
DisplayManager._1.reset:    /etc/X11/xdm/TakeConsole
DisplayManager._1.resources:    /etc/X11/xdm/archlinux/Xresources1

Inside the Xresource file there is a line in which I change the greeting
Xlogin*greeting:User1 Normally the greeting shows the computer name, but I want it to show the username of the user (not really the actual username, but an identifier. I substitute my last name where I stated previoulsy "User1" Inside the file Xresources1, I change the greeting to the last name of User2

Did that make sense? What you describe in your new thread is exactly what I am doing with xdm on tty7 and tty8 So for me xdm is starting twice. Once in tty7 and again in tty8. So User1 can login to tty7 and tty8 is still showing a login screen on tty8. Of course it doesn't mater who logs in first, but because User1 is used to tty7 and User2 is used to tty8 I put the names at each login greeting.

Make sure you have the extra server in /etc/X11/xdm/Xservers
:0 local /usr/bin/X :0
:1 local /usr/bin/X :1

Last edited by bnb2235 (2012-05-28 23:43:32)

Offline

#9 2012-05-28 23:42:18

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

@jasonwryan - do you have shutdown/restart available when starting in this fashion?  I do not.

@bnb2235 - OK, that makes more sense.  I modified the files as you recommended, and now have two xdms running, one on tty7 and one on tty8!  Same question for you about shutdown/restart.

Last edited by graysky (2012-05-28 23:47:35)

Offline

#10 2012-05-28 23:48:07

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

We are writing (and editing) at the same time...

Make sure you have the extra server in /etc/X11/xdm/Xservers
:0 local /usr/bin/X :0
:1 local /usr/bin/X :1

I don't understand the question about shutdown and restart. I am running gnome (note xdm handles console kit) so I have shutdown and resart in gnome. Also, because the xdm-archlinux adds halt and reboot at the xdm screen, I have those functions their too. Becasue xdm is running as root, anyone can halt and reboot (even passers by).

Offline

#11 2012-05-28 23:54:21

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

@bnb - Ah, I'm in xfce4.  I do see the restart and halt buttons on the xdm screen, but they are grayed-out in my 'actions' buttons in xfce4.  Users can only logout hmm

Offline

#12 2012-05-28 23:58:33

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

Perhaps you are initiating console kit twice. In your .xsession file you can not exec console kit.
You want:
exec xfce4 (or whatever command starts xfce)
not
exec ck-launch-session xfce4

Offline

#13 2012-05-29 00:01:04

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

To supplement...
exec ck-launch-session gnome-session
will remove ability to shutdown from gnome

exec gnome-session
is what I need becasue xdm handles console kit. (so many threads about this recently with Slim, but xdm was way ahead of Slim in this regard :-)

Offline

#14 2012-05-29 00:03:37

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

@bnb-

I have tried both of these, each with the same result:

~/.xinit

#!/bin/sh
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
exec startxfce4

or

#!/bin/sh
[[ -f ~/.Xresources ]] && xrdb -merge ~/.Xresources
exec ck-launch-session startxfce4

EDIT: wait, you said ~/.xsession

I have no such file.  Should that be the sole line?

Last edited by graysky (2012-05-29 00:04:51)

Offline

#15 2012-05-29 00:16:08

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: two different X sessions; one on tty7/one on tty8

graysky wrote:

@jasonwryan - do you have shutdown/restart available when starting in this fashion?  I do not.

Yes. But I don't use consolekit: I am happy with an entry in sudoers...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#16 2012-05-29 00:58:41

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

.xsession is run from xdm, not .xinit
I have no .xinit...
My .xsession is:
#!/bin/sh
exec gnome-session

I have no ~/.Xresources I am also not sure how a ~/.Xresources can be of any benefit

Offline

#17 2012-05-29 21:08:08

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

@graysky,
Were you able to get this working with xdm?

Offline

#18 2012-05-30 00:32:30

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

Yes, thanks for posting the detailed instructions.  I have only to solve this and I think the xdm solution will work out.  I do still love lxdm though and would love to do this type of setup with it...

Offline

#19 2012-05-30 09:45:00

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

Great and you're welcome. Feel free to wiki that if you want. (I'm a reader not so much a writer.)

From what I have read, it is (or was)  possible to do this same thing with gdm. Look up multiseat. That is a good reference for this type of thing. Maybe the login manager that K12 linux uses could work for you. (I really like the LTSP idea...)

PS, how are you starting xdm now if you uses systemd and not inittab? Are you just foregoing systemd for test purposes?

Offline

#20 2012-05-30 12:01:21

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

Does the following work for you with gdm? For sure it is old and it is not lxdm, but you already have many gnome deps and I think gdm is systemd ready...

http://www.justlinux.com/nhf/X_Window/C … ation.html

Also googling for:
"1=/usr/bin/X11/X" will get you other pages with the like.

Offline

#21 2012-05-30 20:05:55

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

@bnb - OK!  It's working now with systemd.  One question for you: what dictates on which tty gdm will spawn?  Configured as you suggested, :0 is on tty2 and :1 is on tty3.  The other ttys, 1, 4, 5, and 6 are free for text based logins.

Offline

#22 2012-05-30 21:00:17

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

You mean gdm is working with systemd, not that xdm is working with systemd... correct?

Honestly I would have expected that
0=/usr/bin/X11/X  vt7
1=/usr/bin/X11/X vt8
would have put gdm on tty 7 and tty8

What is on tty7 and tty8?

Edit, upon further review (I don't use gdm), I should be asking the questions :-)
How did you do it? I don't see any of the options on gdm that are listed on the page I linked to.
I guess you are running the old gdm from aur?

Last edited by bnb2235 (2012-05-30 21:23:02)

Offline

#23 2012-05-30 21:40:39

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

Nope, xdm smile. I actually do not like gdm; too many deps.

Offline

#24 2012-05-31 00:46:00

bnb2235
Member
Registered: 2011-02-13
Posts: 119

Re: two different X sessions; one on tty7/one on tty8

OK then... Post #21 shows gdm instead of xdm, hence the confusion. To answer your question, I don't know. Maybe it is the difference between inittab and systemd starting xdm. For me xdm is on both tty7 and tty8

The greeting I suggested to change in the Xresources files... Just curious, did you do that?
I change:
xlogin*greeting: Welcome to CLIENTHOST
to
Xlogin*greeting:MyLastName

I guess this thread is nearly solved. Not the login manager you wanted, but a decent solution in my opinion. In fact I am surprised no one else wants such a method.

Offline

#25 2012-05-31 00:47:42

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: two different X sessions; one on tty7/one on tty8

Agreed.  Might just have to update the xdm wiki with your instructions.

Offline

Board footer

Powered by FluxBB