BulletProof-X - An X Failsafe Mode for Ubuntu

Below are some photos of a first cut at a new Xorg failsafe mode for Ubuntu. X failing to start up is an extremely irritating thing for users. Let's check it out!

First let's take an ordinary, unsuspecting xorg.conf:


And invalidate it: (Blur effect is an extra)


Now restart gdm...


Boom, our own special blue screen. Notice the funky characters in place of drawing symbols. Mmm.





Yuck. Okay, so now let's plug in the new handy dandy BulletProof-X failsafe script into /etc/gdm/gdm.conf:



Now, we restart gdm like before, /etc/init.d/gdm restart, but instead of a blue screen, it flashes the screen a couple times and pops us up into our new Failsafe mode.

The failsafeXServer script works just like the 'startx' script, except it's been extremely stripped down. It basically just calls xinit, specifying to use our own xorg.conf (using the "vesa" driver in 16 bit mode) and launch two programs, displayconfig-gtk and a little zenity help dialog:

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, we're planning on hooking it into Ubuntu's System / Administration menu so users can also use it for configuring their system once successfully booted into X.


Notice there's no window decorations, which makes things look kind of weird. I guess that's something to polish up later.


Displayconfig-gtk automatically probes the hardware and attempts to determine the correct driver, rather than list "vesa" or "iwantapony". In this case, it guessed correctly:


If it hadn't detected correctly, you can see we have a whole host of other options to choose from via a nice simple dialog chooser:


It also gives us ample choice in resolutions. (Other xorg config tools filter out the lower resolutions below 640x480 to simplify the list. Personally I like having the extra choices, but we'll see if this confuses users.)


Optionally, the user can click the 'Test' button to preview the new resolution before it takes effect:


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. Also, we could set the refresh rate to something other than 60Hz, but since this is a laptop, that's the only choice. It's also possible to select a different monitor by clicking on the Model button, however for this laptop the default Plug 'n' Play works fine. Also note the Location bar which will let you save different configs for different situations.

In theory, at this point we click OK and it writes our changes to /etc/X11/xorg.conf. Usually that works; unfortunately in this case it didn't, but stay tuned.


Now, this has a way to go before it works perfectly. I used this old T30 Thinkpad because my other test machines wouldn't go into VESA mode at all. Also, the failsafe xorg.conf I'm using is not dynamically generated, so has hardcoded keyboard and mouse settings. And there's weird flickers and graphics corruption when switching between modes; once I got this:


Anyway, so lots of things to polish, but the basic functionality works. Here's the config files and shell scripts if you'd like to try them out:

bulletproofx-0.1.tgz