BulletProof-X - An X Failsafe Mode for Ubuntu

A while ago I posted some photos of an early version of Bulletproof-X. This is an update, showing how things stand now.

First, break the xorg.conf. Here I switch from the "nv" driver to "nvfoo", then restart gdm (or reboot the machine).


Now, normally you'd expect at this point to see an ugly error dialog like this:


However, instead for us the screen blanks a few times, trying to start up...


...but it can't, and we enter Failsafe Mode.


The text says,

Ubuntu failed to start the windowing system because it was unable to properly configure your hardware.

You are now in the Failsafe X Mode. You can use this mode to configure your monitor and graphics card yourself. Or, you can cancel configuration and just run with this failsafe configuration.

After clearing the popup dialog, we see displayconfig-gtk:


displayconfig-gtk is a GTK/Python frontend being developed for KDE's guidance configuration system by glatzor, mvo, and others. In addition to using this in the failsafe mode, this is plugged into Ubuntu's System / Administration menu so users can also use it for configuring their system once successfully booted into X (shown below).

My monitor isn't listed in displayconfig-gtk's database yet, but I've found the generic LCD Panel 1440x900 matches up.

Unfortunately, it doesn't work to select just any of the generic monitors, so users may find they need to trial-and-error a solution. Fortunately, there is a cool new feature - Add Model which allows users to add a new monitor by using the Windows driver CD that comes with their monitor. This uses a script to parse the Windows *.inf file to get the hsync, vsync, edid, dpms, and other info to update the database locally.


But I'm too lazy to dig out my monitor's CD. Maybe next time.

Anyway, next, we select a resolution. It doesn't seem to be very important to pick the ideal resolution here. I just pick one I know will work. (Sometimes if I get too greedy, I end up in 320x240 or worse, which is a pain to get out of...) So I make a safe choice of 1280x1024:


Notice that the graphics device is already detected:


The generic GeForce fx option should be sufficient to indicate we just need the "nv" driver:


With those selections made, we click 'OK'. displayconfig-gtk writes out a new /etc/X11/xorg.conf after moving the old one to /etc/X11/xorg.conf.broken, and restarts gdm. But that's all behind the scenes. What we see is the screen blanks, turns blue...


...and Presto!


Then, logging in, everything looks beautiful:


displayconfig-gtk is also available from the System:Administration menu as 'Screens and Graphics':



We're all set. If we had a second monitor attached, we could configure that too, however since we don't, it's grayed out. We could also save these settings for a particular Location; this might be useful if we were swapping monitors or plugging in beamers regularly.

Note that while this feature is working, not all of the code is deployed yet. This requires a patch to the BZR HEAD of displayconfig-gtk, and also requires adding the following to your /etc/gdm/gdm.conf to flip it on:

 FailsafeXServer=/etc/gdm/failsafeXServer

Also, unfortunately, there is still one bug I'm struggling with before I'm comfortable turning this loose on everyone. For some reason, gdm doesn't recognize when it's doing failsafe mode, and it attempts to restart X about once a minute, resulting in this ugly and annoying error message:


You can get back to displayconfig-gtk by hitting 'No', but obviously this is far too irritating to turn on, until there's a fix for this.

Anyway, so there's still some rough edges, but this feature is nearly ready to go and I'm expecting it to be in Gutsy relatively soon. Testing, feedback, and patches are of course most welcome!.