xs2ahmed
Posts: 7
Joined: Mon May 02, 2016 9:29 am

How to reboot a full raspbian installation into headless mode

Sun Sep 30, 2018 12:11 pm

Hi,
I have a raspbian version below

Code: Select all

Linux raspberrypi 4.14.69-v7+ #1141 SMP Mon Sep 10 15:26:29 BST 2018 armv7l GNU/Linux
This is a full verison boots in to the user interface. Sometimes I need to do some tasks from SSH only which require more resources and therefore I want to be able to reboot my pi into headless mode so that it can perform the tasks better.

I am aware there is a lite version but I do not need that version as sometimes I need it to boot to UI as well.

Which command should be used to restart it in headless mode and then if required reboot again to UI mode.
Please advise
thanks,
Ahmed

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to reboot a full raspbian installation into headless mode

Sun Sep 30, 2018 12:20 pm

You can call raspi-config non-interactively (just like the GUI preferences program does)

Code: Select all

sudo raspi-config nonint do_boot_behaviour B2
sudo raspi-config nonint do_boot_behaviour B4
Then reboot.

First commands sets boot to CLI with autologin. Second one sets boot to GUI with autologin.
(B1 ... B4 are the same as the options in raspi-config)

xs2ahmed
Posts: 7
Joined: Mon May 02, 2016 9:29 am

Re: How to reboot a full raspbian installation into headless mode

Sun Sep 30, 2018 1:01 pm

DirkS wrote:
Sun Sep 30, 2018 12:20 pm
You can call raspi-config non-interactively (just like the GUI preferences program does)

Code: Select all

sudo raspi-config nonint do_boot_behaviour B2
sudo raspi-config nonint do_boot_behaviour B4
Then reboot.

First commands sets boot to CLI with autologin. Second one sets boot to GUI with autologin.
(B1 ... B4 are the same as the options in raspi-config)
Thank you so much, is there a document that relates these keywords such as do_boot_behaviour with UI ? so that I can use other options also ? if there is, please share the link or does it come straight from source code ?

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: How to reboot a full raspbian installation into headless mode

Sun Sep 30, 2018 1:10 pm

xs2ahmed wrote:
Sun Sep 30, 2018 1:01 pm
Thank you so much, is there a document that relates these keywords such as do_boot_behaviour with UI ? so that I can use other options also ? if there is, please share the link or does it come straight from source code ?
You can get it from the rc_gui source (that's the preferences program): https://github.com/raspberrypi-ui/rc_gu ... _gui.c#L51

User avatar
FTrevorGowen
Forum Moderator
Forum Moderator
Posts: 5644
Joined: Mon Mar 04, 2013 6:12 pm
Location: Bristol, U.K.
Contact: Website

Re: How to reboot a full raspbian installation into headless mode

Sun Sep 30, 2018 9:42 pm

FWIW, I prefer to only boot a full install to the command line (for headless use via PuTTY/SSH from another m/c) and when I'm logged in directly run startx to invoke the Desktop/GUI when I need it. No reboot necessary.
Trev.
Still running Raspbian Jessie or Stretch on some older Pi's (an A, B1, 2xB2, B+, P2B, 3xP0, P0W, 2xP3A+, P3B+, P3B, B+, and a A+) but Buster on the P4B's. See: https://www.cpmspectrepi.uk/raspberry_pi/raspiidx.htm

Return to “Beginners”