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?

Stein
  • 1,768
  • 3
  • 14
  • 13

3 Answers3

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
Steve Robillard
  • 34,687
  • 17
  • 103
  • 109
zenbike
  • 2,490
  • 6
  • 19
  • 26
  • 7
    and what does that actually change? – Thorbjørn Ravn Andersen Aug 09 '12 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 '12 at 06: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 '16 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 07 '17 at 06: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
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

crobicha
  • 263
  • 2
  • 6