Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: How to setup vitual consols and tty for graphical login ?

  1. #1

    Default How to setup vitual consols and tty for graphical login ?

    Hi,
    I need some tips configuring virtual consoles and on which of them graphical login will run.

    Currently after several upates I noticed that:
    - environment variable DISPLAY changed from ":0" to ":1"
    - the graphical login runs on 2(two) tty's: tty2 and tty7 ("ctrl-alt-F2" and cntrl-alt-F7" send me to plasma desktop)

    Typically, graphical login and plasma desktop run on tty7. I have no clue what caused the changes. I just noticed because some of my cron jobs failed (because of change in DISPLAY var).

    In old days there was file /etc/inittab where I could specify which virtual consoles to span, but now it is gone. Everything is managed by systemd and therefore is much less transparent ...

    How I can reconfigure to have only one "graphical" tty ?

    Any tips will be appreciated.

    Thank you!

  2. #2
    Join Date
    Sep 2012
    Posts
    7,101

    Default Re: How to setup vitual consols and tty for graphical login ?

    I can confirm it on current TW with gdm/GNOME. gdm runs on tty7, but user session is started on different tty (in my case it is tty3 currently). I suspect it is actually started on the first "free" tty - before logging in in GNOME I switched to tty2 and it caused auto-spawn of login so tty2 was not available.

    What display manager are you using?

  3. #3

    Default Re: How to setup vitual consols and tty for graphical login ?

    It looks like I'm running gdm:

    >ps ax | grep gdm
    2470 ? Sl 0:00 /usr/sbin/gdm
    2715 ? Sl 0:00 gdm-session-worker [pam/gdm-launch-environment]
    2725 tty7 Ssl+ 0:00 /usr/lib/gdm/gdm-x-session gnome-session --autostart /usr/share/gdm/greeter/autostart
    2727 tty7 Sl+ 0:08 /usr/bin/X vt7 -displayfd 3 -auth /run/user/292/gdm/Xauthority -background none -noreset -keeptty -verbose 3
    2883 tty7 Sl+ 0:00 /usr/lib/gnome-session-binary --autostart /usr/share/gdm/greeter/autostart
    3413 pts/4 S+ 0:00 grep --color=auto gdm
    3664 ? Sl 0:00 gdm-session-worker [pam/gdm-password]
    3683 tty2 Ssl+ 0:00 /usr/lib/gdm/gdm-x-session --run-script /usr/bin/startkde
    3685 tty2 Rl+ 24:39 /usr/bin/X vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority -background none -noreset -keeptty -verbose 3

    You can see that there are two lines:

    2727 tty7 Sl+ 0:08 /usr/bin/X vt7 -displayfd 3 -auth /run/user/292/gdm/Xauthority ....
    3685 tty2 Rl+ 24:39 /usr/bin/X vt2 -displayfd 3 -auth /run/user/1000/gdm/Xauthority ....

    Looks like gdm needs two tty's to run - tty2 for UID 1000 (that's me) and tty7 for UID 292 (gdm).

    I wonder if it is a "feature" or misconfiguration?

    The fact that gdm is running is confusing because for a long time it was sddm. Only after a recent update login screen has changed. At that time I attributed that fact to a change in of plasma theme (breeze) version.

    p.s.
    in /etc/sysconfig/displaymanager sddm is set as display manager:
    DISPLAYMANAGER="sddm"

  4. #4
    Join Date
    Mar 2011
    Location
    Sauerland
    Posts
    6,726

    Default AW: How to setup vitual consols and tty for graphical login ?

    Displaymanager is not set anymore by /etc/sysconfig in Tumbleweed, it is set by
    update-alternatives:

    Its an Screenshot, because Clipboard on this Maschine is not working.....

  5. #5

    Default Re: AW: How to setup vitual consols and tty for graphical login ?

    Quote Originally Posted by Sauerland View Post
    Displaymanager is not set anymore by /etc/sysconfig in Tumbleweed, it is set by
    update-alternatives:

    Its an Screenshot, because Clipboard on this Maschine is not working.....


    Thank you, that helped! It is a good starting point for me.

    I also found this comment in /usr/lib/X11/display-manager script:
    # DISPLAYMANAGER used to be set in /etc/sysconfig/displaymanager, but the default is now set by update-alternatives
    DISPLAYMANAGER=$(realpath --relative-base=/usr/lib/X11/displaymanagers /usr/lib/X11/displaymanagers/default-displaymanager)

    Also, found this discussion on Ubuntu forum:

    https://askubuntu.com/questions/910108/why-is-my-gdm-at-a-different-tty-than-my-desktop-environment

    There is also a link within it to a Gnome's bugzilla page where this "feature" discussed. On a surface, looks like it is a "feature" and cannot be re-configured to use a single tty.

    Now I need to find where the number of virtual consoles set and configured ...

  6. #6
    Join Date
    Sep 2012
    Posts
    7,101

    Default Re: AW: How to setup vitual consols and tty for graphical login ?

    Quote Originally Posted by bryga View Post
    Now I need to find where the number of virtual consoles set and configured ...
    I do not understand what you mean. Can you elaborate?

  7. #7

    Default Re: AW: How to setup vitual consols and tty for graphical login ?

    Quote Originally Posted by arvidjaar View Post
    I do not understand what you mean. Can you elaborate?
    Typically, you have virtual consoles running on tty1-tty6 and you graphical desktop or login on tty7. You can switch between them Ctrl-Alt-F1, Ctrl-Alt-F2, etc. The number of those tty's (6 in this example) could be set in /etc/inittab file. It is not used anymore, but this is how you the relevant lines look like:

    c1:2345:respawn:/etc/getty 9600 tty1
    c2:2345:respawn:/etc/getty 9600 tty2
    c3:2345:respawn:/etc/getty 9600 tty3
    c4:2345:respawn:/etc/getty 9600 tty4

    the exact description of format you can find, say, here:

    https://manpages.debian.org/stretch/...ttab.5.en.html

    You can span 2 or you can span 9 virtual consoles, as many as you want. The consoles use some fonts and back(fore)ground colors and those are configurable too.

    My problem is that I sort of understood how it was done in the past but with the advent of systemd and "alternatives" I am no more.

  8. #8
    Join Date
    Sep 2012
    Posts
    7,101

    Default Re: AW: How to setup vitual consols and tty for graphical login ?

    Quote Originally Posted by bryga View Post
    The number of those tty's (6 in this example) could be set in /etc/inittab file.
    Wrong. The number of ttys is set by kernel and is actually fixed (63). /etc/inittab defined how many ttys would get login process on system start. It does not mean you could not use other ttys.
    My problem is that I sort of understood how it was done in the past but with the advent of systemd and "alternatives" I am no more.
    It is still not clear what is "it" that "was done in the past". You want to start login on tty2 on system boot and not on demand? Run "systemctl enable getty@tty2.service". But how tty login is related to your original question of why second X server is started?

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    13,295
    Blog Entries
    2

    Default Re: How to setup vitual consols and tty for graphical login ?

    Interesting that there is no SUSE documentation on this, much less openSUSE.

    It's my understanding...
    - tty7 is <always> the default graphical console in all Linux distros, both in the past and currently.
    - A big difference with systemd is that tty are not running automatically and already to use on boot. Tty are "generated" and started up on demand.
    - Although there are numerous references to tty1-6 for serial consoles, in systemd those are only the tty that can be automatically invokable. You can configure numerous additional tty but they just can't be automatically started up.
    - There are differences between distros, so you have to be careful which documentation you may be reading. Example, I doubt that Arch with its use of agetty and related services and utilities applies to SUSE/openSUSE (but who knows? I may learn something).

    So,
    I guess bottom line is that for anyone who <really> wants to dig deeply into this should start with the standard documentation that's included, eg the getty MAN pages and be wary of applying anything learned on another distro.

    FWIW -
    The following Lennart Poettering blog article on tty should be good reading... It also includes some comment about multiple X tty in GNOME which may or may not also apply to other environments.

    http://0pointer.de/blog/projects/serial-console.html

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10
    Join Date
    Mar 2011
    Location
    Sauerland
    Posts
    6,726

    Default AW: How to setup vitual consols and tty for graphical login ?

    In /etc/sddm.conf you can set your graphical konsole with
    Code:
    MinimumVT=
    Here it is set to 7.......

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •