WINE, i915 or i965 & intel_do_flush_locked

Recently, while debugging a WINE based application for a friend, who is by far not a Linux neophyte — I started seeing:

"intel_do_flush_locked failed: Input/output error"

on the CLI, as well as:

[ 366.415824] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[ 366.415847] [drm:i915_wait_request] *ERROR* i915_wait_request returns -11 (awaiting 77445 at 77442, next 77446)
[ 366.564710] [drm:i915_hangcheck_elapsed] *ERROR* Hangcheck timer elapsed... GPU hung
[ 366.564711] [drm:i915_wait_request] *ERROR* i915_wait_request returns -11 (awaiting 77471 at 77467, next 77472)

In the /var/log/Xorg.0.log file.

The only new thing was an upgrade from Ubuntu 10.04LTS to 12.04LTS a few months earlier, which was completely stock, aside from the WINE PPA being used, which was more a leftover from one the original machine had been installed some years ago with 8.04LTS.

… and this was the first time this particular issue had occurred.

They were using the WINE PPA already, so the copy of WINE was already up-to-date, although the program had no issues running between WINE 1.0 and 1.4, so I wasn’t terribly concerned that upgrading to 1.5.x would have anything to do with it.

Having tried numerous i965 related tweaks on the web, then finding that I was not alone in the issue — I investigated the alternative ways of fixing the problem.

The xorg-edgers PPA made little difference, with an updated driver and MESA installation — there was a longer period before the application crashed, but it still crashed after a few minutes, better than the standard 12.04 repository (as of 2012-11-28) where the application would crash immediately though.

The x-swat/x-updates PPA (the “more stable” version of the PPA above) was slightly better, WINE at least created the virtual desktop window before the messages started appearing, we called that “progress” and went looking for things specific to the code available in that repository.

Using i965 Frame Buffer Compression in the GRUB configuration made no difference, but this time other things on the desktop (GNOME Shell) started restarting intermittently before we’d even got to the terminal window in order to start WINE.

According to the PowerSavingTweaks page, Frame Buffer Compression (FBC) does:

Framebuffer compression reduces the memory bandwidth on screen refereshes and depending on the image in the framebuffer can reduce power consumption. … Some users report this breaks when using Unity 3D.

I thought we may be having issues because it was an older motherboard, a 1.3Ghz Celeron CPU board with 4GiB of RAM — possibly a Power Management thing too, Indeed, reverting the i915_enable_rc6 fix by changing the /etc/default/grub file to:

i915.i915_enable_rc6=0

“fixed” the problem even further, with the bug taking 5-6x longer to manifest (a period of minutes) itself.

Next, purging the xorg-edgers PPA and adding the Backported X / Kernel code from the q-lts-quantal PPA seemed to start off well, but within minutes offered a slightly different error:

"intel_do_flush_locked failed: No space left on device" 

( Which also appeared when we simply tried booting the machine from a 12.10 installer image and testing the issue there. )

Still annoying and quite unusable for day-to-day operations, so we purged that with the ppa-purge utility and re-re-replaced the xorg-edgers PPA but we found Oibaf’s “Updated and Optimized Graphics Drivers” which had an even newer (and arguably, more well tested, if these forums are to be believed) MESA and llvmpipe code, which, was about the last-gasp of a solution, the application in question was, after all a 2D educational program from the late 1990′s, running in a Win95-based WINE instance with no prior tweaking or modifification, so I thought: “*why would it need an updated 3D library?” … but, having found the mailing list and with the PPA page suggesting:

To force the use of gallium llvmpipe software render:
$ LIBGL_ALWAYS_SOFTWARE=1 glxgears -info

I installed the libgl1-mesa-dri-experimental package, then ran the obligitory “sudo apt-get update && apt-get dist-upgrade which pulled in MESA and llvmpipe and a bunch of other updates, rebooted and ran:

$ LIBGL_ALWAYS_SOFTWARE=1 wine /path/to/executable

… and up came the application, which happily wombled along for three hours while we drank scotch and celebrated.

In the end, the best working combination, for those having issues with WINE applications in Ubuntu 12.04 or 12.10 with these hangcheck bugs, was to use the software renderer available from the Oibaf PPA repository and turning OFF the rc6 power-saving fix in Ubuntu, in combination with the code in the xorg-edgers PPA (as of 2012-11-28).

So, the rub (if your Google-fu takes you here directly) to get this to work (on Ubuntu 12.04 and 12.10):

# add-apt-repository ppa:ubuntu-x-swat/x-updates
# add-apt-repository ppa:oibaf/graphics-drivers
# apt-get update && apt-get dist-upgrade
# sed -i -e 's/"quiet splash"/"quiet splash i915.i915_enable_rc6=0"/g' /etc/default/grub
# update-grub

( of course, add a “cp /etc/default/grub /etc/default/grub.backup if you’d like to backup your GRUB configuration :) )

… reboot, and then try your application – Milage May Vary(tm) but it works really well on older i915 hardware here.

If of course, you’d like to revert this, ppa-purge the two repositories and restore your GRUB configuration and you’re back to scratch.

PSA: Sed Delimeters Can be Anything

This is another of my “remember this for later” type of post, but sed has tripped me up several times recently with delimeters, so i’m putting this here.

Recently, while debugging a script I use for putting Varnish configurations together, I ran into the “sawtooth” effect when trying to modify a simple command … or at least, what I thought was a simple command, until running into the first “**” character that I needed to edit.

So a line such as:

\\ configuration sample 0

Meant a sed expression of:

$ sed 's/\/\/configuration\/sample\/0\//\/\/configuration\/sample\/1\//'

Which, aside from looking weird, is also a pain for a non-sed users (or ninja) to use — so having looked at Stack Overflow, commandlinefu and even the bash scripting guide and seeing numerous recommendations to use perl, awk or something that wasn’t actually sed, I decided to refine my searching to “escaping single slash, sed” and found the answer I was looking for.

$ sed 's|\\configuration sample 0|\\ configuration sample 1|'

or:

$ sed 's_\\configuration sample 0_\\configuration sample 1_'

Do exactly the same job, look neater and mean the poor people reading your code don’t have to wonder about the voodoo you’ve added for your sed lines, because it’s clearer too.

Not Unifed In 12.10: The Quickening

Before I begin: if you would just like to remove “as much of Unity as possible” without reading my stance on Unity, or you’d like to see where this post began — please skip to the end :)

Personally, I like the basic idea of Ubuntu, I like the fact it mostly works as a Desktop, I like the PPAs and I like the fact there’s continuous improvement between releases.

It’s no secret though, some people, myself included — dislike the Ubuntu Unity interface.

Now, unlike my troubles with 12.04 LTS, Unity’s quirks in 12.10 were restricted to:

  1. Erratic Mouse Cursor Movement — basically, the touchpad was erratic and moving to what seemed like “the hot corner” whenever I removed a finger from the pad. Now, I always tune my touchpad to be slightly higher sensititivity than normal anyway, then using the synclient client to tune the areas of my touchpad — however, while that works in GNOME’s fallback desktop & GNOME 3.x, it now completely trips out Unity.

  2. Graphical Artifacts on-screen — usually behind windows, or when searching for something from the dash, they used to be largely inconsequental, but in Unity 6.x, they’re all over the place and solid colours, making a completely unusable desktop after 3-4 windows have been opened.

  3. Missing / Incomplete / Disappearing Shortcuts — I can click on a shortcut on the dock and it “crashes” into the icon that is above or below it, especially annoying when it crashes into the “Removable Drive” icon, which, combined with problem 1) tends to unmount things erratically, making me want to hurt something.

Problems One & Two turned out to be the easiest to fix, I have no Intel-Only (Embedded / Onboard) machines, so it was a simple case of using the ATi / nVidia binary blobs rather than relying on the discrete graphics that are fired up by default, then Unity’s interface at least played ball.

The Third issue seemed to occur regardless of things being on a binary driver or the F/OSS one.

So, what to do?

I thought, “Once again, I know GNOME Shell works on this setup — i’ll use that instead.”

# add-apt-repository ppa:gnome3-team/gnome3 && apt-get -f update
# apt-get -f install gdm gnome-shell gnome-tweak-tool gnome-session-fallback 

The former installs gnome-shell (and GDM, which is required by GNOME 3.6) & gnome-tweak-tool for customising your setup, the latter installs Ubuntu’s “classic GNOME desktop” — just in case.

Now, I almost always select the GNOME Fallback (No Effects) session the first time I want to strip Unity from an install, it’s a personal preference, so my desktop looked like:

The GNOME Fallback (GNOME 2.x-look) Default Desktop

The default desktop UI if you have selected “GNOME Fallback (No Effects)” from the Session List.

If you know your desktop can handle GNOME 3.x out-of-the-box, feel free to omit “gnome-session-fallback” from the apt-get line above.

note: GDM will ask you which “Default display manager” you wish to use, make sure you select gdm rather than lightdm– otherwise, X will fail to start once you’ve finished stripping out the Unity packages (but more on that later).

The Display Manager Selector

You should select the ‘GDM’ option here, if you wish to install the GNOME 3.x desktop in Ubuntu 12.xx

After you’ve done that, you should reboot your system for the changes to take effect, which will then display GDM at boot time like:

Looks rather old-school(tm) doesn’t it :)

So, having rebooted, selected GNOME as my default setup from the greeter and was ready to use my machine — I thought:

Some six months later, if i’m still never going to use Unity, because it doesn’t actually appear to work, why don’t I get rid of it?

Turns out, it’s a more invasive task than it was in 12.04LTS — there’s numerous examples of ways to do it on the interschnitzel, but other than my previous article on the subject, the majority of them ended up either:

  1. Breaking the Desktop (either by claiming X was broken and things were running in low-resolution mode, or by experiencing crashes in software that was linked to the Unity libraries themselves).

  2. Removing Applications you might actually need (including, for example, Nautilus and GNOME Shell itself, as well as Brasero, Rhythmbox, Totem & other GNOME-y related goodness) because they’ve been linked with Unity libraries at either the packaging level, buildtime, or runtime.

In addition, a number of the sites I found recommend getting rid of the indicator-applets packages — which, breaks the fallback session quite severely too and you might want / need to keep that, so we don’t want to do that either.

Unfortunately, there’s a bunch of new pieces in 12.10, relating the “webapps”, “web based services” and the infamous “Amazon Sales” issue — I mentioned on Twitter that i’m almost certain that Unity is becoming more like a tenticled beast that’ll get harder before it gets easier, but for now, we can still uncouple things to make a perfectly usable desktop for the masses.

Oh, that’s an important distinction — while i’m actually a fan of Ubuntu’s ideas for the future (TV’s, Phones, Tablets, Whatever) for now, i’d just like a DESKTOP that works — and chances are, if you’re reading this, you would too.

The Juice Is Loose (again)

So, without further delay (aside from saying “running these commands, as they are written here, in the order I have them listed, all work for me and have been well tested on my 12.10 installs, but if they hose your desktop, delete your information, or eat your dog — I take no responsibility for any of it” — operator beware and all that.):

Log Out of Unity, ALT-Fx to your favourite TTY, login, sudo to root and run:

# apt-get --yes purge unity 
# apt-get --yes purge unity-asset-pool unity-services 
# apt-get --yes purge unity-lens-* unity-scope-* ubuntu-webapps-*
# apt-get --yes purge unity-common
# apt-get --yes purge libunity-misc4 libunity-core-6* libunity-webapps*
# apt-get --yes purge gir1.2-unity-*
# apt-get --yes purge liboverlay-scrollbar* overlay-scrollbar*
# apt-get --yes purge appmenu-gtk appmenu-gtk3 appmenu-qt
# apt-get --yes purge libufe-xidgetter0
# apt-get --yes purge xul-ext-unity xul-ext-websites-integration
# apt-get --yes purge firefox-globalmenu thunderbird-globalmenu

To be fair, the commands above don’t remove all of Unity and friends, there’s parts you need for various things:

If you remove:

  • unity-greeter — If you have not rebooted after firstly installing your alternative desktop, X will fail to start — claiming you are running in Low Resolution mode and telling you to fix your configuration, troubleshoot or login to a console instead — this would appear to be an issue with the way the Classic (Fallback) GNOME Desktop is configured in Ubuntu, however investigation into this is still on-going.

    update 24-10-2012: if you reboot your system after installing gdm rather than simply logging out (as part of installing your alternative desktop — see above) then purge Unity from your system, your X session will start normally and GNOME will work normally too.

  • libunity9 — Various “core” GNOME applications will be uninstalled, such as Nautilus (File Manager), Brasero (CD Burning) & Rhythmbox (Music Player) & Totem (Movie Player) which you might actually need in order to retain a working desktop.

  • indicator-* — The Classic GNOME Desktop will break — the indicator applets on the top right-hand-side will be removed, but clicking on the locations they should have been will cause your session to crash.

(This list will be updated with any others I find, or people e-mail/tweet me about, but as of 24-10-2012 is correct.)

When you return, no Unity options should be present in your Session options — and once you’ve chosen your new environment of choice, you will be Unity-less and all of the GNOME based applications on your desktop should continue to operate correctly too.

In addition, you will also have cleaned out the Unity / Global Menu related components from Firefox / Thunderbird / LibreOffice, making it leaner, faster and less privacy-concerning than before too.

update 14-11-2012: added overlay-scrollbar packages to the list of packages to purge due to this bug which causes pieces of the default GTK+ theme to be either completely black or to disppear intermittently.

overlay-scrollbar should be fixed, but the bug is labelled as WONTFIX which is disappointing, given it seems to be an Ubuntu-specific issue and nothing at all to do with GTK+

Enjoy, until the hacksaws come out for the 13.04 release :)

VirtualBox, Windows & You (or, in this case – me)

While moving some VMs from VirtualBox between boxes earlier, I recieved a “STOP Error 0xc0000225” when trying to re-power them, this was occurring in both Windows 7 & 8 virtual machines & I started to put it down to moving from VirtualBox 4.0 to 4.2 in one go.

Turns out of course, it can be fixed by disabling, saving, then re-enabling (as you never turn IO APIC off after installing Windows) the “IO APIC” settings option in the System / Motherboard tab for each particular VM you’re having issues with.

… and this post is here to ensure I never forget about that again :)

Invalid XML, with Outlook 2007.

It’s not often we have to deal with proprietary code on systems — at least, not at the end-user level — but recently, while recovering a drive for a client, I ran into what I initially thought, was a server-side bug.

Turns out, the error:

Cannot start Microsoft Outlook. Cannot open the Outlook window.

Followed By:

Cannot open the Outlook window. Invalid XML, the view cannot be loaded.

Is a two-fold error.

Looking at the [profilename].xml file in the users Outlook folder, it had appended a whitespace and an extra closing tag at the end of the standard code.

You can fix this the Microsoft Way ™ by launching Outlook from the Start -> Run dialogue with the command-line switch “/resetnavpane

Or, if you don’t want to obliterate the users favourite shortcuts to mail folders, their last-viewed folder & message as well as the setup and display of their navigation pane, you can fix this the Old Fashioned Way ™ by running:

taskkill Outlook.exe

Then open the users [profilename].xml file ( on a standalone, non-exchange using installation, this is found in \Users[user]\AppData\Roaming\Outlook[profilename].xml ) and simply remove the whitespace after the closing > tag.

:)

Restarting GNOME Shell From the CLI

Earlier this evening, while attempting to use remote desktop to fix a system, I had the shell brick on me — no external mouse (USB), no touchpad and no window controls.

However, with a few booted VMs open, 200 or so browser tabs and several in-use terminals in use, not being able to switch between apps, or close them reliably might have caused me a problem, if, that is, the way we used to fix this kind of thing in the 1980′s didn’t still work in 2013.

So, Control-Alt-Fx’ing and logging into a terminal it is — and making sure my traditional ps axuw | grep gnome-shell returned nothing gnome-shell was running, I did:

export DISPLAY="0:0"

Which, obviously would be different if you have more than one X session running, or are working from a tunnel — but for end-users with a single desktop display, 0:0 will almost certainly work.

Then, it was a simple case of restarting the shell:

gnome-shell --replace

and switching back to my GUI with Control-Alt-F7 — to find a restarted shell complete with window controls — problem solved :)

Case For More Accurate Reporting In Open Source?

Recently, a popular pro-ubuntu website, posted a poll regarding the changes in the GNOME 3.x ‘Files’ Application (or as I like to call it “The Artist Formerly Known As Nautilus”)

The article referenced the amount of cleanups / modifications being made to the code to make it simpler for end-users to navigate — many of which, I will add, having been converting “end-users” to Linux for close to ten years — I agree with wholeheartedly, however, the article stated:

Amongst the features you will find missing in the version of Nautilus (now renamed ‘Files’) are ones you may have used on a daily basis, including:
  • Compact View *removed*
  • ‘Type Ahead Find’ *removed*
  • ‘New file’ templates *removed*
  • Application Menu *removed*
  • ‘Go’ menu *removed*
  • F3 split screen *removed*
  • ‘tree’ view *removed*
  • Bookmark menu items *removed*
  • Backspace shortcut to return to parent folder *removed*

Of those, the thought of the `New file’ templates removal scared me a bit, as I tend to manually add templates to end-user installations for Documents, Spreadsheets, Presentations, Images (PNG), E-Mails & Text Files — at least that way, users who are worried about the differences between Explorer and an Ubuntu or Red Hat installation can at least find their way to create the basic filetypes the same way.

So, I went to check the relevant changelog in git, which is here — and I find the feature is, by far not removed.

Infact, a better term for it would have been “adjusted” — the code has been altered in order to only show the menu if there are templates installed. Even Jon McCann, the developer of said “removal” had used the following description for the patch in question:

Hide the New Document menu if no templates are installed.

Given Ubuntu still don’t ship default Templates with their distribution (there’s an 8 year old bug about it here), I suppose yes, it will mean that menu will disappear from the default Ubuntu configuration — but that’s still not removed not by a long way.

Indeed, there’s even talk about it on various mailing lists, such as this one (on that, the template system is actually quite powerful if you take the few hours to configure it properly and it seems to make a world of difference for new users coming from Windows space, especially when they’re not immediately recognising the icon for a particular application.) — Though, I would hardly call it a “worrying development” that downstream ignored such an obvious request for 8 years, therefore a particular “feature” is effectively rendered “useless”.

Still, the issue i’m getting at here is not the feature itself, it’s the fact a widely read Ubuntu fansite can use the word “Removed” when the feature was “Modified” — especially when that particular article will be indexed by many search engines as a popular article, so it’s highly likely “mainstream media” may find it a lot easier than say this, or Jon McCann’s article on the most recent developments to Files.

I wonder (and it’s the reason I sit here at 3am local time writing this up, having had this thought for a few weeks now): Is this kind of reporting behaviour actually hurting GNOME’s image going forward, especially as we move into the newer development realm of 3.x — I mean, GNOME 3.x is a lot different to anything we’ve seen before from a shell point of view, but in terms of the underlying applications, the evolution is really no different to the changes between GNOME 0.x and 2.x — or Windows 3.1 and Windows 8 — a case of trying to make it easier for the people using the software, while embracing and supporting new technologies.

Now my thought turns to “how best to do that?

PSA: mod_security v2 v. the Flash Uploader in WordPress

Recently, i’ve seen a lot of:

<IfModule mod_security.c>
<Files async-upload.php>
 SecFilterEngine Off
 SecFilterScanPOST Off
</Files>
</IfModule>

As the solution to the “My Flash Upload option no longer works with WordPress” — of course, if you’re using version 2 of mod-security — the correct way to completely disable mod-security for the flash uploader, as per the Migration Matrix page, this should be:

<IfModule mod_security2.c>
<Files async-upload.php>
 SecRuleEngine Off
 SecRequestBodyAccess Off
 SecResponseBodyAccess Off
</Files>
</IfModule>

It would appear there’s not a lot of mod-security v2 information as it relates to WordPress — and given issues with the handling of the async-upload.php have recently started appearing on the interschnitzel, I thought i’d put this here in case it is of assistance to anyone else.

Ubuntu 12.04 LTS v. the Acer Aspire 57xx Optimus Technology

The first two candidates for upgrading to Ubuntu 12.04 were my Acer Aspire Laptops, both previously running a quite heavily customised version of 10.04.4, with numerous PPAs (ubuntu-audio-dev and ubuntu-x-swat being the main ones relating to hardware).

People often ask me at trade shows & conferences, “Why do you use 10.04.x, why not 11.10, or [insert-release-here-of-something-else]” — and usually got the response “because I need them to work”, which, is not a criticism of the quality of more recent releases, more a “that’s what LTS’s are for.” kind of response.

So, 12.04 being the +1 for LTS’s, I decided to upgrade — i’d been itching to try out GNOME 3.4 on more modern hardware — and the improvements to Unity (Ubuntu’s own Desktop Environment) sounded quite promising and upbeat.

Which wasn’t as difficult as it previous had been, i’m happy to point out — except, both my 5750G and 5742G have nVidia “Optimus” technology powering their graphics cards, which meant I was presented with the following screen following my install:

It's a blank screen, really.

Yes, it's a black screen -- in real life, it has a flashing cursor :)

So, an ALT-F’x’ — a login, a sudo and a couple of add-apt-repository commands later and:

The Standard Desktop after the Bumblebee code had been added to Precise

Um, that looks a lot better -- to change the resolution, optirun & nvidia-settings work a treat.

and, to make sure the nVidia GPU actually does something:

#  optirun nvidia-settings -c :8
Terminal Window running optirun on :8 Console

Using the nvidia-settings via Optirun allows you to alter Power Management and Display Size settings

So, the magic to make this work, is:

# add-apt-repository ppa:bumblebee/stable
# apt-get -f install bumblebee bumblebee-nvidia

Now, if you’re using the standard Ubuntu packages, you should be able to restart your machine and you’ll be back up and running — however, my 5750g and Precise’s nVidia packages didn’t play nicely — so i’d upgraded to the nvidia-current-updates package and rebooted, then everything ran according to plan.

For some reason, maybe because there was some 200 updates to do on the 5742, the post-installation of the package didn’t add my user to the bumblebee group, so I had to then do:

# usermod -a -G bumblebee *paul*

( where paul obviously is whatever your username is :) )

… then logged-out/logged-in, then the optirun based commands worked perfectly.

Not Unified: Removing Unity from Ubuntu 12.04 LTS

Before I begin: if you would just like to remove “as much of Unity as possible” without reading my personal upgrade woes — please skip to the end :)

So, i’ve almost succeeded in upgrading most of my personal boxes from Ubuntu 11.10 and 10.04.4 to the new Ubuntu release.

Oh, by almost and upgrading — I mean “back up to external drive, re-format, re-install, set up new configuration via a script, then copying everything back from the external drive” — but that’s just me, having used Linux in one way or another since 1993 and having seen ‘upgrades‘ fail in a wide variety of funny (or not so funny) ways.

I should point out, I tried upgrading this time around, one server and one desktop (from 9 machines and several VMs on those machines) — just to see what would happen & well, let’s just say Andrew covered things a lot better than I did.

Now, unlike Andrew — who seems to enjoy building things from bottom-up, I prefer to install whatever the distribution gives me then tweak it to do what I need to do in order to get things to work, which meant I was presented with a brand new Unity desktop.

Well, I wasn’t at first — that’s actually covered in another article — as the two machines I did first both have hybrid graphics systems by nVidia referred to as “Optimus”, which has one nVidia GPU and one discrete Intel one — so what I actually got, was, um, not much actually — but i’ll save you the read here and move on with the purpose of this post …

Skipping forward 9 or so hours:

I didn’t like what I saw.

To be fair, i’m not a one-desktop-to-rule-them-all purist either — as a firm believer of “just use the best thing for the job” — i’ve used, developed, packaged, advocated and supported desktops all over in my F/OSS life, CDE, KDE (1, 3), GNOME (0.x -> 3.0), Openbox, GNUStep, I used to tweak FVWM & TWM in the real early days — and before TWM, it was OS/2 and doing cool stuff with it.

But I digress…

I tried using it, for three whole days I tried to use it as my default desktop, which — comprises of approximately a VM, 12 or so Terminal windows, a web browser and a music player — plus or minus a jabber client.

I added “lenses“, had crashes.

I removed items, then added new ones to the dock, had crashes.

I fired up the first set of Terminals I usually used, then used the Window switcher to move to another virtual desktop, had crashes.

I tried Firefox and couldn’t see a global menu as suggested, instead, I saw the outside of the menu (aka. a 1px border) with speckled contents — then found errors in dmesg about DRM & hangcheck errors from the Intel based GPU in the machine.

Slept on it:

Tried using LibreOffice to write up a document and examine a spreadsheet and found everything too cramped — then used the interschnitzel to discover LibreOffice doesn’t actually support the global menu out of the box … did the requisite:

# apt-get install lo-menubar

and tried again, only to discover the global menu had wandered off like it had in Firefox and the messages in dmesg had returned.

Tried Ubuntu-2D, which didn’t start — it instead popped up a box that said my X configuration was broken.

"Broken X Configuration"

"This is what it sounds like, when Paul cries." -- but in all seriousness, what does an "everyday Ubuntu user" do when presented with this?

Needless to say, I clicked the Reconfigure Graphics option, which presented me with a black screen (ie. X crashed back to TTY1) — a reboot later, I tried the Run in low-graphics mode for just one session which, also presented me with a black, blank screen, so, being somewhat used to X crashes because of broken setups in days gone by, I went looking for my X configuration — then any reference to xorg.conf — then any help on the subject — then proceeded to swear, quite a bit.

… moving along …

I thought, “i’m over this, I wonder if GNOME Shell works on this setup?

# add-apt-repository ppa:gnome3-team/gnome3 && apt-get -f update
# apt-get -f install gnome-shell gnome-tweak-tool gnome-session-fallback 

The former installs gnome-shell & gnome-tweak-tool for customising your setup, the latter installs Ubuntu’s “classic GNOME desktop” — just in case.

Minutes later, I was in GNOME 3.4, in my browser, answering my mail.

Moments later, hangcheck bit me again, forcing a reboot, but as I said earlier, in my case, that’s a different issue.

So, having rebooted, selected GNOME as my default setup from the greeter and was ready to use my machine — I thought:

if i’m never going to use Unity, because it doesn’t actually appear to work, why don’t I get rid of it?

Turns out, that’s a little harder than it looks — there’s numerous examples of ways to do it on the interschnitzel, but all of them ended up either:

  1. Breaking the Desktop (either by claiming X was broken and things were running in low-resolution mode, or by experiencing crashes in software that was linked to the Unity libraries themselves).

  2. Removing Applications you might actually need (including, for example, Nautilus and GNOME Shell itself, as well as Brasero, Rhythmbox, Totem & other GNOME-y related goodness) because they’ve been linked with Unity libraries at either the packaging level, buildtime, or runtime.

(yes, 2 == 1, when you think about it).

In addition, a number of the sites I found recommend getting rid of the indicator-applets packages — which, breaks the fallback session quite severely too, so we don’t want to do that either.

The Juice Is Loose

So, without further delay (aside from saying “running these commands, as they are written here, in the order I have them listed, all work for me and have been well tested on my 12.04 LTS installs, but if they hose your desktop, delete your information, or eat your dog — I take no responsibility for any of it” — operator beware and all that.):

Log Out of Unity, ALT-Fx to your favourite TTY, login, sudo to root and run:

# apt-get --yes purge unity unity-2d unity-2d-places unity-2d-panel unity-2d-spread 
# apt-get --yes purge unity-asset-pool unity-services unity-lens-* unity-scope-*
# apt-get --yes purge liboverlay-scrollbar*
# apt-get --yes purge appmenu-gtk appmenu-gtk3 appmenu-qt
# apt-get --yes purge firefox-globalmenu thunderbird-globalmenu
# apt-get --yes purge unity-2d-common unity-common
# apt-get --yes purge libunity-misc4 libunity-core-5*

To be fair, the commands above don’t remove all of Unity and friends, there’s parts you need for various things:

If you remove:

  • unity-greeter — X will fail to start, claiming you are running in Low Resolution mode and telling you to fix your configuration, troubleshoot or login to a console instead — I thought this might be because of the Optimus setup on my primary machine, but it can be re-produced in VirtualBox and on another physical desktop where 3D actually works — investigation into this is on-going.

  • indicator-* — The Classic GNOME Desktop will break — the indicator applets on the top right-hand-side will be removed, but clicking on the locations they should have been will cause your session to crash.

(This list will be updated with any others I find, or people e-mail/tweet me about, but as of 21-05-2012 is correct.)

When you return, no Unity options should be present in your Session options — and once you’ve chosen your new environment of choice, you will be Unity-less and all of the GNOME based applications on your desktop should continue to operate correctly too.