You are not logged in.

#1 2017-09-17 22:59:38

misanthropist
Member
Registered: 2017-09-17
Posts: 8

Controlling the number of ttys and which tty X runs on

I just migrated from BSD to Arch, and I've got most of it working just the way I want it. However, I want to control which tty X runs on. Basically I'm used to having it on the last tty, so if I e.g. use 6 ttys, I'd access the X server by Alt+F6, but now it mostly ends up on F2, and on one occasion it ended up on F3. How can I control this?

Also, how do I set the number of ttys to start at boot?

Offline

#2 2017-09-17 23:15:35

circleface
Member
Registered: 2012-05-26
Posts: 639

Re: Controlling the number of ttys and which tty X runs on

X should start on whatever TTY you are currently logged in to.  Are you using systemd or did you install something else?  Also with systemd, getty will spawn a new shell whenever you switch to one of the TTY's.

Offline

#3 2017-09-17 23:16:51

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: Controlling the number of ttys and which tty X runs on

How are you starting X?  See man man logind.conf particularly NAutoVTs,  also when the systemd package is installed it also executes https://git.archlinux.org/svntogit/pack … ystemd#n64

Offline

#4 2017-09-17 23:31:05

misanthropist
Member
Registered: 2017-09-17
Posts: 8

Re: Controlling the number of ttys and which tty X runs on

I'm starting X from systemd. I use xdm, and I've enabled it with systemctl enable xdm.service.

And by controlling the number of ttys, I mean how many ttys are enabled. By default it seems to be 6, as Alt+F1 through Alt+F6 changes the active tty, but if I press Alt+F7 and up, nothing happens. I'd like to control how many of these are enabled. It's not insanely important, I just like knowing these things. smile

And let's say I decide to stick with 6, I want xdm to always appear on tty6.

Offline

#5 2017-09-17 23:56:49

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

Re: Controlling the number of ttys and which tty X runs on

misanthropist wrote:

By default it seems to be 6, as Alt+F1 through Alt+F6 changes the active tty, but if I press Alt+F7 and up, nothing happens. I'd like to control how many of these are enabled.

`man logind.conf`

As for the display manager, do you need one?  What you want is trivial without a DM.  I've never found a purpose for a DM other than to make things needlessly complex and cause regular breakage.  Without a DM, just set tty6 to autologin and autostart X (each of these have a wiki page).

Last edited by Trilby (2017-09-17 23:57:54)


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

Offline

#6 2017-09-18 00:02:52

loqs
Member
Registered: 2014-03-06
Posts: 19,113

Re: Controlling the number of ttys and which tty X runs on

Using xdm.service for this task is not the simplest way I can think of after enabling getty@*.service for tty2-tty5 change the ReserveVT in logind.conf then change xdm.service to add something like

After=systemd-user-sessions.service getty@tty1.service getty@tty2.service getty@tty3.service getty@tty4.service getty@tty5.service

That may work never tried it
@Trilby already recommended that man page
Edit:
fix copy paste error in config snippet

Last edited by loqs (2017-09-18 00:04:10)

Offline

#7 2017-09-18 00:27:14

misanthropist
Member
Registered: 2017-09-17
Posts: 8

Re: Controlling the number of ttys and which tty X runs on

Thank you. I will look into these options. As for using a DM, it's not strictly necessary, it's just the way I'm used to. However, autologin is not what I had in mind, which leaves manually logging in on the specific tty where I want X or loqs' option.

Offline

#8 2017-09-18 00:54:58

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

Re: Controlling the number of ttys and which tty X runs on

Well without autologin then it's even simpler: with just the autostarting of X set up on tty6 but no DM, when you switch to tty6 (via Alt-F6) you are greeted with a login prompt asking for a username and password.  When entered, your chosen WM starts up.  With a DM, you'd first have to figure out how to get it to start on tty6, then when you similarly switch to tty6 (via Alt-F6) you are greeted with a flashy graphical login prompt asking for a username and password.  When entered, your chosen WM starts up.

So it looks like there are two differences: one is easy and will work, the other is flashy.


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

Offline

#9 2017-09-18 10:25:10

misanthropist
Member
Registered: 2017-09-17
Posts: 8

Re: Controlling the number of ttys and which tty X runs on

I'm letting this rest for now. I'll get used to having X on F2, eventually. However, on several occasions I've found myself pressing the wrong F-key, and I thought I might just have overlooked something simple. Anyway, thanks for the suggestions.

Offline

Board footer

Powered by FluxBB