103

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?

0

3 Answers 3

103

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
4
  • 7
    and what does that actually change? Aug 9, 2012 at 10:34
  • 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.
    – zenbike
    Aug 10, 2012 at 6:59
  • 4
    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.
    – Mauro
    Jan 20, 2016 at 15:11
  • 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. :(
    – NoBugs
    Feb 7, 2017 at 6:23
26

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
1
  • 7
    the exact command for the raspberry is: sudo update-rc.d lightdm disable
    – mirk
    Jan 17, 2013 at 17:41
15

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.