unofficial mirror of 
 help / color / mirror / code / Atom feed
From: Joshua Branson via Bug reports for GNU Guix <>
Subject: bug#56958: auto login to tty only works for tty1
Date: Wed, 03 Aug 2022 14:40:50 -0400	[thread overview]
Message-ID: <> (raw)

Hey guix family!

The cookbook decribes a method of auto login to tty. I have noticed that since
the latest shepherd upgrade (that's my best guess as to when the error occured),
I have been unable to auto login to any tty as the cookbook describes. I have
created a minimal guix system vm, to test the auto-login to tty. I have set up
ttys 2 - 4 to auto login my user joshua, but when I boot the vm only tty1 is
auto logged in. The other tty's are not logged in.  Is auto login supposed to be
restricted to one partiular tty?



P.S.  Here is the test vm.

#+BEGIN_SRC shell :dir ~/prog/gnu/guix/guix-config  :results verbatim :exports both
cat bare-bones-with-autologin.scm

;; Copyright © 2021, 2022 Joshua Branson <>

(use-modules (gnu))

(use-service-modules networking

(use-package-modules ssh)

(define (auto-login-to-tty config tty user)
  (if (string=? tty (mingetty-configuration-tty config))
       (inherit config)
       (auto-login user))

;; add an autologin to tty for a tty 2 - 4.
;; When you run this vm, only one will be auto-logged in.
(define %my-base-services
   (modify-services %base-services
    (mingetty-service-type config =>
                           (auto-login-to-tty config "tty1" "joshua"))
    (mingetty-service-type config =>
                           (auto-login-to-tty config "tty2" "joshua"))
    (mingetty-service-type config =>
                           (auto-login-to-tty config "tty3" "joshua"))
    (mingetty-service-type config =>
                           (auto-login-to-tty config "tty4" "joshua"))))

  (host-name "autologin")
  (timezone "America/Indianapolis")
  (locale "en_US.utf8")
  (bootloader (bootloader-configuration
               (bootloader grub-bootloader)
               (targets (list "/dev/sda"))))
     (mount-point "/")
     (device "/dev/sda")
     (type "ext4"))

  (users (cons* (user-account
                 (name "joshua")
                 (comment "Joshua Branson")
                 (group "users")
                 (home-directory "/home/joshua")
                  '("kvm" "netdev" "wheel")))

  (packages %base-packages)
  ;; Add services to the baseline: a DHCP client and
  ;; an SSH server.
    (service dhcp-client-service-type)
    (service openssh-service-type
              (openssh openssh-sans-x)
              (port-number 2222)))

To try it for yourself:

#+BEGIN_SRC shell
$(guix system vm bare-bones-with-autologin.scm)

Ctrl-Alt-G (make sure Ctrl and Alt are the left most keys) to grab focus
inside the vm. Alt-right to switch to a different console. Ctrl-Alt-G to
ungrab focus from the vm.

             reply	other threads:[~2022-08-04 14:10 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-03 18:40 Joshua Branson via Bug reports for GNU Guix [this message]
2022-08-03 18:50 ` Joshua Branson via Bug reports for GNU Guix
2022-08-04 20:33 ` Joshua Allen Branson via Bug reports for GNU Guix

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).