How can I get autologin at startup working on Ubuntu Server 16.04.1?

Try this:

sudo systemctl edit [email protected]

This will the create a drop-in file (if neccessary) and open it an editor. Add the following, replacing myusername with your user name:

[Service]
ExecStart=
ExecStart=-/sbin/agetty --noissue --autologin myusername %I $TERM
Type=idle

This will:


agetty opens a tty port, prompts for a login name and invokes the /bin/login command.

This file overrides the config by default of agetty on systemd for tty1. This provides a new instance of tty1 with autologin for the user specified.

By the way, the parameter --noissue is used to hide the contents of /etc/issue on login, so not needed in your case.

The option Type=idle found in the default [email protected] will delay the service startup until all jobs are completed in order to avoid polluting the login prompt with boot-up messages. When starting X automatically, it may be useful to start [email protected] immediately by adding Type=simple into the file.

More info: getty: Archlinux.org