Sunday, November 29, 2009

Upstart Trickery

A friend asked about how to get Ubuntu Karmic to skip gdm (gnome display manager) startup on bootup. Removing gdm removes too much due to dependencies.

Scenario: Boot Ubuntu Karmic to a console login; login; type "startx" to start the GUI environment, not necessarily Gnome.

Thus far the only way I've found to do this is by editing /etc/init/gdm.conf. Change the line that reads "stop on runlevel [016]" to "stop on runlevel [0126]". Then reboot the system; just restarting gdm didn't work on my tests.

At this point my test system, which is a Virtual Box installation, boots to a console login as expected. When I issue the "startx" command Gnome starts up as expected _but_ the Ubuntu One client asks for access to the keyring and networking is not started. I'm not so concerned about Ubuntu One asking for keyring access as I am about not having networking up. That is rather trivial if one is comfortable booting to a console login.

If anyone knows of a better way I'd love to hear about it.

This forum post may offer another way but it doesn't take into account that Karmic is using grub2 which means there is no longer a /boot/grub/menu.lst file.

Seeking insight...


Anonymous said...

I've been wanting to shorten my boot time as well, and aside from buying an expensive solid-state drive, I could learn how to parallelize the boot-up processes.

Also, I have my Virtual Box networking set to bridged.

BugeyeD said...

these two methods have been verified to work on 9.10; neither of the mess with upstart, but both were found by looking at upstart's grub config:

first method:

echo >>/etc/default/grub 'GRUB_CMDLINE_LINUX_DEFAULT="quiet splash text" '

another method:

cd /etc/X11/
mv default-display-manager default-display-manager.gdm
touch default-display-manager

BugeyeD said... apparently wraps text so that the commands are a bit hard to read ...

for the first method, everything prior to "update-grub" goes on the first (echo) line.

for the second method, everything between 'mv' and 'touch' goes on the 'mv' line.

Anonymous said...

So this starts Ubuntu in a terminal? Speeds up boot time? Something else?

Mark said...

@handheld car: the purpose is to start a GUI when I want it to not automatically on bootup. A side affect is faster boot time. My Virtual Box is setup to used bridged networking.

@BugeyeD: I didn't try your first suggestion yet as my grub2 is set to hidemenu and I haven't rtfm'd enough to find out how to change that. The second method start X in "low graphics mode" So I still had X running on VC7, rather ugly X at that.

BugeyeD said...

@Mark: is your karmic install a fresh one? mine was, and i have no idea how an upgraded system might differ, though i'm sure they do. how did hidemenu get set?

Mark said...

@BugeyeD Actually I'm testing this from an upgraded Lucid. I believe the original Karmic installation was alpha5. Afaik hidemenu is default for a desktop installation.

Oh, and posting this from Lucid ;)