Page 1 of 1

How to reboot a full raspbian installation into headless mode

Posted: Sun Sep 30, 2018 12:11 pm
by xs2ahmed
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

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

Posted: Sun Sep 30, 2018 12:20 pm
by DirkS
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)

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

Posted: Sun Sep 30, 2018 1:01 pm
by xs2ahmed
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 ?

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

Posted: Sun Sep 30, 2018 1:10 pm
by DirkS
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

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

Posted: Sun Sep 30, 2018 9:42 pm
by FTrevorGowen
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.