Switching from graphical desktop to headless and back

When most of the time no desktop is required, Power and energy can be reduced and lifetime at least for the fan can be increased by switching the device to command line.

sudo systemctl set-default multi-user.target will make that the device boots in command line mode.

Important

However on Trixie the auto-login gets lost when select boot to CLI via desktop and therefore rpi-connect with share screen will not work. Auto-login can be re-enable by re-adding to /etc/lightdm/lightdm.conf

autologin-user=<user name>

sudo reboot now

systemctl get-default to confirm it

sudo systemctl set-default graphical.target then brings desktop back.


Linurs startpage