Boot without starting X-server

  • During the installation of Raspian I chose "Start X-Server after boot", but now I want to boot it once without starting the X-Server, so I've got more memory to run a program.

    How do I boot without starting the X-Server?

  • zenbike

    zenbike Correct answer

    8 years ago

    With the Raspbian image, you can re-run the initial start up script using:

    $ sudo raspi-config
    

    and entering your sudo password.

    This will bring up the same menu options that you got after first boot.

    You do not need to remake all your first boot choices, just use the arrow keys to move to the menu options you want to change.

    In your case, selecting:

    Start X-server after boot?

    and choosing:

    no or disable

    will sort you out.

    Editing to add non gui based options:

    As noted in the comments below by @mirk, the exact command for the raspberry is:

    sudo update-rc.d lightdm disable
    

    and what does that actually change?

    The raspi-config script creates a GUI menu which allows you to make several system config changes. This portion of the script enables or disables lightdm, the desktop manager used for Raspbian. It uses the same update-rc.d command as is described by Bryan Dunmore. Except Raspbian does not use GDM by default, and the RasPi will barely run it if installed.

    That's not the answer to the question imho. With raspi-config you setup to boot to CLI permanently while the question asks how to do it once.

    Yes, if it freezes once the desktop is up, and won't ctrl+alt+f2... how do you open a terminal to run that command? The only thing that seems to work is alt+sysrq+reisub. :(

  • How X.Org works is that you have a desktop manager that boots the X Server for you. That means that in order to prevent X Server from starting, you need to remove your destkop manager from the daemons list.

    If you are using GNOME then you're desktop manager is GDM. If you're using KDE you're desktop manager will be KDM. For this, I'm going to assume that you're using GNOME; ergo you are using GDM as your desktop manager.

    In Raspian, the desktop manager is called LightDM.

    To disable a daemon in Debian (which Raspbian is a fork of) you have to run the following command.

    $ sudo update-rc.d <daemon> disable
    

    So in order to disable LightDM we have to run the following command.

    $ sudo update-rc.d lightdm disable
    

    And now on your next reboot LightDM shouldn't start and will, in turn, not start X Server.

    References

    1. Disabling daemons - Daemon - Debian Wiki

    the exact command for the raspberry is: `sudo update-rc.d lightdm disable`

  • Accepted answer didn't work for me in "Jessie" version, I ended up using:

    sudo systemctl set-default multi-user.target
    

    Reference: Trying to turn off X11 in Jessie

License under CC-BY-SA with attribution


Content dated before 6/26/2020 9:53 AM