3

I have an Linux (Ubuntu) virtual machine that's been setup as a desktop; it starts X and the full UI. I only need it as a server (will be accessing it via ssh) and am looking to reduce the memory footprint.

What's a good way to prevent X from starting when the machine boots?

Update: ended up going with:

sudo mv /etc/rc2.d/S30gdm /etc/disabled-S30gdm

via the link in Evan Anderson's answer.

5 Answers 5

1

I don't use Ubuntu (I'm a CentOS / Fedora guy), but typically this is done with runlevels. I'm reading that, at least on Ubuntu "Gutsy", there isn't a runlevel that doesn't start X by default. What a pain!

Have a look at this guy's site-- it should at least give you an idea of where to look. http://caulfield.info/emmet/2008/03/add-a-textonly-runlevel-to-ubu.html

On RedHat-style distributions this would be easy... >smile<

I dunno about these techniques above to remove GDM, but I'd rather be able to select a different runlevel to get X back than go removing software.

Edit: Here's some potentially better thoughts: http://cviorel.easyblog.ro/2008/07/02/enabledisable-gdm-in-ubuntu/

2
  • 1
    Ubuntu's runlevels 2-5 all start with a GUI (IIRC) and they lack the inittab that Redhat/Fedora/CentOS has in favor of upstart Jun 4, 2009 at 17:02
  • That's what I meant when I said "I'm reading that ... there isnt' a runlevel that doesn't start X by default!" Jun 4, 2009 at 17:04
5

You can disable GDM by:

update-rc.d -f gdm remove

Then re-boot and you should have your console window.

2

Go to System -> Administration -> Services and disable GDM

2
  • Looks like there's no Services option under Administration. There's a "Login Window" option that lets me set the "Default Session" to "Secure remote connection" or "Failsafe Terminal", are either of those what I'm looking for?
    – Parand
    Jun 4, 2009 at 17:08
  • You should be seeing configuration options like this: cyberciti.biz/faq/prevent-xorg-from-starting-in-linux Jun 4, 2009 at 18:34
1

in ubuntu there is a config file for gdm at

/etc/init/gdm.conf

The lines you will want to alter are:

start on runlevel [2345]
stop on runlevel [016]

to be more like:

start on runlevel []
stop on runlevel [0123456] # you can leave some runlevels in the start on line if you know what runlevel you are currently running on.

you can always get the gdm to run once you login using the command startx.

http://ubuntuforums.org/showthread.php?t=1305659

1
  • Unfortunately 11.04 has changed that. Aug 1, 2011 at 9:31
-1

Not sure about Ubuntu, but in RedHat/Fedora/CentOS, you just change the default runlevel in /etc/inittab to 3

id:3:initdefault:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .