auto login startx

Asked by tomdean

This system is a single user system in a secure location.

On power on, I want to auto login <user> and startx.

I do not want the graphical login. I want to use startx from my .bash_profile. I use twm. I want to start several applications with specific command arguments after boot. And, I do not want to do this from the keyboard.

I have this working on Ubuntu 14.04, and, think I have duplicated the changes to do this.

Sun May 7 12:46:56 PDT 2017
    Edit lightdm/lightdm.conf.d/12-autologin
    [SeatDefaults]
    autologin-user=tomdean
    autologin-user-timeout=10
    Edit /<email address hidden>
    ############################
    ## autologin tomdean
    #ExecStart=-/sbin/agetty --noclear %I $TERM
    ExecStart=-/usr/bin/agetty --autologin tomdean --noclear %I 38400 linux

    Edit /etc/default/grub
    #GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    GRUB_CMDLINE_LINUX_DEFAULT=
    sudo update-grub

    Edit /etc/init/tty1.conf
    ####################
    ## tomdean
    #exec /sbin/getty -8 38400 tty1
    exec /sbin/getty -a tomdean -8 38400 tty1

    sudo update-rc.d -f lightdm remove

Sun May 7 13:48:42 PDT 2017
    sudo systemctl enable multi-user.target --force
    sudo systemctl set-default multi-user.target
    Created symlink from /etc/systemd/system/default.target to /lib/systemd/system/multi-user.target.

Sun May 7 14:19:35 PDT 2017
    sudo systemctl set-default grapical.target

Sun May 7 14:27:31 PDT 2017
    Accountservices will ignore the lightdm settings
    sudo apt-get remove accountsservice

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
tomdean (tomdean) said :
#1

This is Ubuntu 16.04

Revision history for this message
tomdean (tomdean) said :
#2

I used systemd to disable lightdm. That eliminated the login prompt.

After boot, I get a black screen with a 'cursor' at the upper left corner. After a few minutes, I used ctl-alt-f2 to get a virtual terminal. From there, startx worked.

How do I get startx to be executed from the login process?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

If you add to /etc/rc.local then you can start the GUI as a different user at boot. Something like

su -c=startx username

Or maybe use this:
https://wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login

Revision history for this message
tomdean (tomdean) said :
#4

On 05/08/2017 02:32 AM, actionparsnip wrote:
> Your question #631638 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/631638
>
> Status: Open => Answered
>
> actionparsnip proposed the following answer:
> If you add to /etc/rc.local then you can start the GUI as a different
> user at boot. Something like
>
> su -c=startx username
>
> Or maybe use this:
> https://wiki.archlinux.org/index.php/Xinit#Autostart_X_at_login
>

I am close to getting this working. I get a pam error on the auto
login, I think. The auth.log entries 22:13:03 thru 22:13:03 have no
corresponding processes. No process is related to tty1. The entry at
22:13:46 is the login on tty2.

Virtual terminal 1 is still hung with a black screen, with a 'cursor' at
the top left corner.

====================== auth.log ============
  May 7 22:12:47 P9X79 systemd-logind[1071]: Watching system buttons on
/dev/input/event6 (Eee PC WMI hotkeys)

May 7 22:13:03 P9X79 login[1441]: pam_unix(login:account): could not
identify user (from getpwnam(myusername))

May 7 22:13:03 P9X79 login[1441]: Authentication failure

May 7 22:13:03 P9X79 login[1486]: pam_unix(login:account): could not
identify user (from getpwnam(myusername))

May 7 22:13:03 P9X79 login[1486]: Authentication failure

May 7 22:13:03 P9X79 login[1490]: pam_unix(login:account): could not
identify user (from getpwnam(myusername))

May 7 22:13:03 P9X79 login[1490]: Authentication failure

May 7 22:13:03 P9X79 login[1496]: pam_unix(login:account): could not
identify user (from getpwnam(myusername))

May 7 22:13:03 P9X79 login[1496]: Authentication failure

May 7 22:13:03 P9X79 login[1501]: pam_unix(login:account): could not
identify user (from getpwnam(myusername))

May 7 22:13:03 P9X79 login[1501]: Authentication failure

May 7 22:13:46 P9X79 login[1513]: pam_unix(login:session): session
opened for user tomdean by LOGIN(uid=0)

May 7 22:13:46 P9X79 systemd-logind[1071]: New session 1 of user tomdean.

May 7 22:13:46 P9X79 systemd: pam_unix(systemd-user:session): session
opened for user tomdean by (uid=0)

Revision history for this message
tomdean (tomdean) said :
#5

On 05/08/2017 03:48 AM, tomdean wrote:

Fixed. Blame old eyes... A stray '.' after the username in

/<email address hidden>/autologin.conf

Thanks, actionparsnip.

Tom Dean

Revision history for this message
Launchpad Janitor (janitor) said :
#6

This question was expired because it remained in the 'Open' state without activity for the last 15 days.