Saturday, April 30, 2011

Missing Top and Side Panels in Unity: Troubleshooting - all Ubuntus

It is easily possible to break Unity, either by playing with some plugins in CCSM or by breaking the video driver necessary to support it. Also, some who have upgraded from a pre-Unity version of Ubuntu may not get the Unity interface in the first place. All they get is just a desktop with the wallpaper and nothing else. No top panel or Launcher, so they don't see many options to repair it.

This can be caused by multiple reasons, so there is no one-fits-all fix. But we have put together fixes for some of the most common issues here. And we will update this post when additional issues/fixes are turning up.

Almost all steps in this guide are the same for fixing Unity in Natty 11.04 and in Oneiric 11.10 and later except those which are particularly labelled for a specific version.

Get to the CLI/tty or a Terminal (and CCSM)

On your messed up desktop, press 'Ctrl + Alt + F1' to switch to the CLI/tty. There you can carry on with running commands and then restart GDM or LightDM, respectively, or press 'Ctrl + Alt + F7', occasionally also '...F8', to get back to your desktop.

Get to a Terminal in Natty 11.04

Alternatively to the CLI/tty, right-click your desktop > choose 'Create Launcher' > set Name to 'Terminal' > and Command to 'gnome-terminal'. Close the window and now double-click the newly created launcher to get a Terminal. But notice that you shouldn't use that for restarting GDM.

(How to get to CCSM in Natty 11.04 is described under its respective section below.)

Get to a Terminal and CCSM in Oneiric 11.10 and later

In Oneiric and later, you cannot easily create launchers on your desktop anymore. So when following this guide, whenever you need to run a GUI application, run commands like these from the CLI/tty to get them up. You can get to the CLI/tty by pressing 'Ctrl + Alt + F1' while on your messed up desktop. To get back to your desktop, press 'Ctrl + Alt + F7', occasionally also '...F8'.

For running CCSM:

DISPLAY=:0.0 ccsm

For getting a Terminal:

DISPLAY=:0.0 gnome-terminal

But, as opposed to Natty 11.04, pressing 'Ctrl + Alt + T' - occasionally - works to bring up a Terminal. So just try this first.

Make sure the 'unity' package is installed

For those who were missing the 'ubuntu-desktop' metapackage in a pre-Unity version of Ubuntu for some reason, the 'unity' package didn't get installed during the upgrade. So we need to check if it's installed:

dpkg -l | grep unity

If 'unity' is listed in the output, proceed with the next step. If not, install it (and its dependencies):

sudo apt-get update
sudo apt-get install unity

Also, if you don't have any sound reason against that, make sure the 'ubuntu-desktop' metapackage is installed as well, to prevent this kind of situation in the future. Similar to the above step, check if it's installed:

dpkg -l | grep ubuntu-desktop

If 'ubuntu-desktop' is not listed, install it:

sudo apt-get update
sudo apt-get install ubuntu-desktop

Now restart your display manager as described below and see if that fixed your issue.

If Unity still doesn't work after that, proceed with the next steps.

Make sure the 'compiz' package is installed

Check if the required Compiz packages are installed:

dpkg -l | grep compiz

If 'compiz' is listed in the output, proceed with the next step. If not, install it (and its dependencies):

sudo apt-get update
sudo apt-get install compiz

Once installed, you might need to enable the 'Ubuntu Unity Plugin' as described below.

Install CCSM and enable 'Ubuntu Unity Plugin'

If CompizConfig Settings Manager (CCSM) is not installed already, install it either from a Terminal or the CLI/tty as outlined above:

sudo apt-get update
sudo apt-get install compizconfig-settings-manager

Once completed, right-click your desktop > choose 'Create Launcher' > set Name to 'Compiz' > and Command to 'ccsm'. Users of Oneiric and later please refer to the upper-most section of this guide.

Close the window and now double-click the newly created launcher to open CCSM. At the lower-left of CCSM, click 'Preferences' and make sure 'Unity' is selected under 'Profile'.

At this point, if you want to enable the Desktop Cube in Natty or Oneiric, which may have led to this mess in the first place, please proceed with this guide:

http://www.tuxgarage.com/2011/05/enable-desktop-cube-in-unity-ubuntu.html

If you want to use the default Desktop Wall, proceed here.

Now make sure that the 'Ubuntu Unity Plugin' is enabled. Users of Precise 12.04 and later first need to click on the plugin's button to get access to the enable/disable checkmark, as it is not accessible from the main page of CCSM anymore.

Additionally, make sure that these essential plugins are also enabled:
  • Desktop Wall
  • Window Decorations
  • Place Windows
  • Move Window
  • Resize Window
  • Scale
  • Expo
  • Gnome Compatibility
Then exit CCSM, and either restart your whole desktop or try restarting just Unity itself following the instructions below.

If the previous steps didn't fix the issue, you may have an issue with the video driver, which should have prevented you to run the Unity session in the first place. To try to fix a possible driver issue, proceed with the lower section of this guide.

Window titlebars missing

For those who are unable to see the window titlebars, open CCSM as explained in the above section, and first make sure the 'Window Decoration' plugin is enabled.

Now click on 'Window Decoration' and make sure that 'Command' is set to either '/usr/bin/compiz-decorator' or 'gtk-window-decorator --replace'. The first one is the default and should actually work, it is in fact a wrapper script for running the most appropriate window decorator. The other one is for running the GTK Window Decorator directly, supporting the Metacity themes.

You can test if 'gtk-window-decorator' is generally working by pressing 'Alt + F2' and entering:

gtk-window-decorator --replace

For those who were using Emerald before upgrading, or it is somehow set as the window decorator, the version currently included in the official repositories is not working with the current version of Compiz. So you can either switch to the default window decorator or upgrade Emerald through a PPA as per instructions here (written for Natty):

http://www.tuxgarage.com/2011/07/upgrade-install-emerald-through-ppa.html

Re-/install proprietary video drivers and create proper 'xorg.conf'

Nowadays, the default open source video drivers should be enough to support Unity. However, the proprietary drivers for Nvidia and ATI/AMD graphics devices usually still provide a considerably higher performance than the former ones. And of course, messing around with these, particularly when not using the 'Additional Drivers' utility for installing them, can easily make Unity unable to run, and the corresponding open source drivers, for that matter.

The first step to fix the graphics setup is to disable any faulty, old 'xorg.conf' - specifically, rename it so it is not pulled by the X server anymore. For that, run this command either in a Terminal or from the CLI/tty:

sudo mv /etc/X11/xorg.conf /etc/X11/xorg.conf.old

Notice the capital 'X' in 'X11'. That file is not necessarily present, so no problem if it gives an error like 'file not found'.

Now, the question is obviously, did you install any proprietary drivers manually from the vendor's website or via Ubuntu's built-in 'Hardware...' or 'Additional Drivers' utility, respectively. If the former, you can opt for reinstalling it using the same method used before, or remove it following its instructions and switch to using the drivers provided by the built-in utility - the latter is strongly recommended!

In both cases, you can either use a Terminal for that or the CLI/tty, whatever is applicable. To get up the 'Additional Drivers' utility, run this command in any of them:

jockey-gtk

At least if using the 'Additional Drivers' utility, remove any already enabled driver, reboot, (re-)install the 'recommended' driver, and reboot once more. To reboot, just run this command, preferably from the CLI/tty, or just press 'Ctrl + Alt + Del' there:

sudo shutdown -r now

Notes: For some older Nvidia cards, the 'nvidia-current' driver doesn't seem to be capable of running Unity, while 'nvidia-173' can run Unity on the same cards. Try both if you are having problems with the 'current' one, even if it is marked as 'recommended'. Under Natty 11.04, if you are having issues with any versions of the proprietary Nvidia driver, definitely also try the 'experimental 3D support' option also offered by the 'Additional Drivers' utility.

Quantal 12.10 and later

Since Quantal 12.10, 'Additional Drivers' is integrated as a tab into the 'Software Sources' utility, accessible from the command line by running:

software-properties-gtk

Reset Unity / Compiz

The following command will reset all settings for Unity, it would also try to restart Unity thereafter, with rather unreliable outcome, particularly depending on in what exact situation you are running it. You can run it in a Terminal if available, or from the CLI/tty:

unity --reset

To just reset the Launcher icons to the default, you can run this command instead:

unity --reset-icons

This command won't work if GDM is not running. So don't stop GDM before the completion of this command.

Sometimes the started process hangs and you get no feedback what is going on. Normally it takes less than a minute to complete. To be safe, you can give it 2-3 minutes and then press 'Ctrl + C' to terminate it.

If resetting Unity alone is not enough, try resetting the rest of Compiz' settings:

gconftool-2 --recursive-unset /apps/compiz-1
gconftool-2 --recursive-unset /apps/compizconfig-1
rm ~/.compiz-1/session/*
rm ~/.config/compiz-1/compizconfig/config

After doing any of the above resets, either restart your whole desktop or try restarting just Unity itself following the instructions below.

If Unity still doesn't work after that, proceed with the most-lower section.

Quantal 12.10 and later

Since Quantal 12.10, Compiz, incl. Unity, is now using GSettings for storing its settings, so the commands stated above won't work for it anymore - except that for resetting Unity's Launcher icons. To completely reset both Compiz and Unity, you first need to install the package 'dconf-tools':

sudo apt-get update
sudo apt-get install dconf-tools

Then, just run this command:

dconf reset -f /org/compiz/

As opposed to earlier versions of Unity, this reset command doesn't even try to restart it, whether successfully or not, so you gotta restart it manually in any case, either just itself, or the whole desktop, by running the respective commands stated above this sub-section.

Restart the desktop / Unity

To restart the whole desktop or get back to the login screen, Natty 11.04 users need to restart GDM. For that, switch to the CLI/tty by pressing 'Ctrl + Alt + F1' and run:

sudo service gdm restart

Users of Oneiric 11.10 and later need to restart LightDM instead (default):

sudo service lightdm restart

Alternatively, in most cases, you could try restarting just Unity itself, slightly less preferable as it has a couple of uncertainties, particularly depending on how exactly it is done (needs a separate session; cannot be done easily/reliably from the CLI/tty). So to restart Unity properly, with its own session, either run this command from a Terminal:

setsid unity

Or, if you only have the CLI/tty available, you can try this one from there:

DISPLAY=:0.0 setsid unity

Unity support check failing?

Upon logging in to the Unity session, the system checks if your current graphics setup is capable to run Unity or not. If it fails, you will be automatically logged in to its corresponding fallback session. You can see the results of that check by running this command, either in a Terminal or the CLI/tty:

/usr/lib/nux/unity_support_test -p

The reasons for a failing Unity support check include:
  • insufficient video card/chip
  • insufficient video driver
  • blacklisted video card/chip
  • it is delivering incorrect results
If one of the latter both is the case, you can try to force Unity to run. See this guide on how to do so (written initially for Natty):

http://www.tuxgarage.com/2011/05/force-unity-compiz-to-run-natty-narwhal.html

Unity still doesn't work?

If after all of this Unity still doesn't work, run these commands and post their complete outputs here or at the Ubuntu Forums - it would tell us some details about your current graphics setup and also if it is capable to run Unity or not:

/usr/lib/nux/unity_support_test -p
lshw -c video

Related Posts:

Compiz , Troubleshooting , Unity