Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

5 Answers 5

up vote 1 down vote accepted

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/

share|improve this answer
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 –  Kevin Kuphal Jun 4 '09 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!" –  Evan Anderson Jun 4 '09 at 17:04
add comment

You can disable GDM by:

update-rc.d -f gdm remove

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

share|improve this answer
add comment

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

share|improve this answer
    
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 '09 at 17:08
    
You should be seeing configuration options like this: cyberciti.biz/faq/prevent-xorg-from-starting-in-linux –  Kevin Kuphal Jun 4 '09 at 18:34
add comment

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

share|improve this answer
    
Unfortunately 11.04 has changed that. –  Douglas Leeder Aug 1 '11 at 9:31
add comment

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

id:3:initdefault:
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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