Silent boot on Raspbian Stretch in Console Mode


Update (May 22, 2019):
Step 5 has been updated to adopt the latest version of Raspbian (2019-04-08).


The purpose of the steps here is to remove Rainbow image, Raspberry Pi Logo, login messages, etc. from Raspberry Pi boot up process when it’s in console autologin mode. For silent boot in desktop mode, please see this post. After following the steps, the first thing you see will be a shell prompt like below.

pi@raspberrypi:~ $

I tested it with Raspberry Pi 3 running Raspbian Stretch with Desktop (2019-04-08).

 

Assumptions

– Console Autologin
If it’s not yet in Console Autologin mode, launch raspi-config.

sudo raspi-config

Then, navigate to “Boot Options” > “Desktop / CLI” and select “Console Autologin“.

– Password change if SSH enabled
If SSH is enabled, change the login password to avoid the warning message below.

SSH is enabled and the default password for the 'pi' user has not been changed. 
This is a security risk - please login as the 'pi' user and type 'passwd' to set a new password.

 

Steps

1. Disable “Welcome to PIXEL” splash
Disable plymouth-start service.

sudo systemctl mask plymouth-start.service

 

2. Remove Rainbow Screen
2-1. Open “/boot/config.txt”.

sudo nano /boot/config.txt

2-2. Add below at the end of the file.

# Disable rainbow image at boot
disable_splash=1

 

3. Remove Raspberry Pi logo and blinking cursor
3-1. Open “/boot/cmdline.txt”.

sudo nano /boot/cmdline.txt

3-2. Add below at the end of the line.

logo.nologo vt.global_cursor_default=0

‘logo.nologo’ and ‘vt.global_cursor_default=0’ remove Raspberry Pi logo (image of four raspberries in the top left corner) and blinking cursor, respectively.

 

4. Remove login message
Create ‘.hushlogin’ file in home directory.

touch ~/.hushlogin

It removes login message below [1]:

Last login: Tue Nov 21 14:51:56 2017
Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l
 
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
 
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

 

5. Remove autologin message by modify autologin service
5-1. Open “getty@tty1.service.d/autologin.conf”.

sudo nano /etc/systemd/system/getty@tty1.service.d/autologin.conf

5-2. Replace the line below:

ExecStart=-/sbin/agetty --autologin pi --noclear %I xterm-256color

with:

ExecStart=-/sbin/agetty --skip-login --noclear --noissue --login-options "-f pi" %I $TERM

It removes autologin message below:

Raspbian GNU/Linux 9 raspberrypi tty1
raspberrypi login: pi (automatic login)

 

6. Verify
Reboot the board and see if it works properly.

sudo reboot

 

Bonus 1: Removing Lightning Bolt Icon
In case a lightning bolt icon is shown in the right-top corner of the screen, see this post.

 

Bonus 2: Removing Bash Prompt
If you want to remove even the bash prompt (e.g. “pi@raspberrypi:~ $”), open .bashrc file.

nano ~/.bashrc

Then add the line below at the bottom of the file.

PS1=""

 

 

References
[1] Remove GNU licence and ‘no warranty’ thing when logging into ssh
[2] Silence and Appliance-ify your RetroPie Installation

 

Sponsor Link

22 Comments

    1. Hi cmdshft, thank you for your feedback!

      I tried and got the same result, so I’ve been digging it… I don’t know the detail yet but finally I was able to get it work. Instead of “/etc/systemd/system/autologin\@.service”, edit “/etc/systemd/system/getty@tty1.service.d/autologin.conf”.

      sudo nano /etc/systemd/system/getty@tty1.service.d/autologin.conf

      Then, replace this line:
      ExecStart=-/sbin/agetty --autologin pi --noclear %I xterm-256color

      with:
      ExecStart=-/sbin/agetty --skip-login --noclear --noissue --login-options "-f pi" %I $TERM
      (same line as in step 5-2 above)

      Hope it will work for you too.

  1. Hi,

    in step 1:
    1. Disable “Welcome to PIXEL” splash

    It completely disable text and image.
    How can I keep the image (I will replace spash.png”) but remove all text under this image ?

  2. Hi, thanx for tutorial! Its great and worked on Buster !

    One thingy: this updates totally removed TTY change with ALT+F2/F4
    how to get it back while still leave raspberry in silent mode?

  3. Wow, this was exactly what I needed, and it works exactly as advertised!
    Thank you so much, wish I could buy you a beer or something to say thanks!

Comments are closed.