NonGraphicalBoot

Booting LiveCD Without X

LiveCD environments can usually be helpful for testing, but if you're troubleshooting a problem where X does not start up, that makes it difficult to retrieve the log files and other such things. But it can be done:

0. Obtain a Live CD for the release you're testing: http://cdimage.ubuntu.com/releases/

1. At the CD boot menu, add "text" to the boot options: https://help.ubuntu.com/community/BootParameters

2. The CD will now boot but not start X.

3. You can grab xrandr data without starting an X session like this:

 xinit -e 'sh -c "xrandr --verbose > xrandr.txt" '

This will try to start X and log some information about the active screen resolution to the file xrandr.log before it stops X again.

4. Start up an X session like this:

 startx

or

 /usr/X11R6/bin/X :0

Bypassing/Disabling gdm

Option 0 - Automatic Login Through gdm

You can set up gdm to automatically log in a user either via System > Administration > Login Window > Security > Enable Automatic Login, or by editing the /etc/gdm/gdm.conf configuration file, and set AutomaticLoginEnable=true and AutomaticLogin=<username>.

Option 1 - Turning off GDM after bootup

Switch to a tty (ctrl+alt+F1) or use ssh, log in, and shut off GDM for the current session like this:

   $ sudo /etc/init.d/gdm stop

Check to see if you have any remaining X sessions running, and if so, kill them:

   $ ps aux | grep /usr/bin/X
   bryce     5379  0.0  0.0   1784   552 pts/35   S+   03:10   0:00 grep /usr/bin/X
   root      7051  1.0  5.0 112224 105556 tty7    Ss+  Jul01 197:49 /usr/bin/X :0 -br -audit 0 -auth /var/lib/gdm/:0.Xauth -nolisten tcp vt7

   $ sudo kill 7051
   $ sudo kill -KILL 7051

or just

   $ sudo pkill Xorg
   $ sudo pkill -KILL Xorg

This option is appropriate if your system boots up okay other than X, such that you can either ssh into it or access a tty. If gdm is completely locking up your system during boot up, then see the next options.

Option 2 - Temporarily disabling GDM

To disable gdm from running during boot, you can either boot with the "text" boot parameter or disable the rc service like this:

   sudo update-rc.d gdm stop 2 3 4 5 .

(i) Please note that there is a dot at the end. This is essential.

Then to re-enable it later,

   sudo update-rc.d gdm start 30 2 3 4 5 . stop 01 0 1 6 .

This option is useful if gdm or X locks up the system during boot, or if you wish to run X in complete isolation from gdm.

Option 3 - Removing GDM entirely

In order to disable X from starting when booting the system, you can simply remove gdm from the init scripts:

  • sudo update-rc.d -f gdm remove

and, to enable X again when booting:

  • sudo update-rc.d gdm defaults

This option is probably only useful if you know you want to always boot X manually, and want to eliminate graphical booting entirely.

Starting up X manually

Option 1: startx script

From the text console, run

startx

Option 2: Starting X directly

From the text console with no other X running, you can invoke X directly, bypassing all the startup scripts and stuff:

/usr/X11R6/bin/X :0 

If you're running multiple X sessions, use :1, :2 for second, third sessions. (For debugging, it's usually easiest to stick with a single X session invoked from the console.)

X supports a wide variety of other startup flags that can be of value for debugging problems or working around issues. See man xorg for a comprehensive list. Here's a few particularly useful ones:

-allowMouseOpenFail

Allow the server to start up even if the mouse device can't be opened or initialised.

-ignoreABI

Bypasses server's ABI version check when loading e.g. binary drivers (-fglrx/-nvidia). This option should be used with care.

-keeptty

Prevent the server from detaching its initial controlling terminal. This option is only useful when debugging the server. Not all platforms support (or can use) this option.

-showopts

For each driver module installed, print out the list of options and their argument types.

X/NonGraphicalBoot (last edited 2009-03-15 22:50:39 by bryce)