Sunday, September 7, 2014

Ubuntu 14.04 (Trusty) and VMWare Unity Mode

Unity mode is a nice feature of VMWare's virtualization software. However, you will find that you cannot switch to VMWare Unity mode once you install the most recent release of Ubuntu including Ubuntu 14.04 (Trusty) and its predecessor (Ubuntu 13.10 or Saucy).

It turns out that VMWare does not like Ubuntu's default desktop environment called Ubuntu Unity. It could be confusing that the Ubuntu Unity desktop environment and the VMWare Unity mode share the same word "Unity", and it has created a difficulty  for us who try to find an answer  on the web since depending on what search terms you enter, web searches can give you answers related to both and it becomes a diffcult task to find a solution that may help you.

Since VMWare cannot switch to Unity mode is a result that VMWare does not like Ubuntu's default desktop environment called Ubuntu Unity, the solution becomes to find a Desktop Environment that VMWare can work with.

On Ubuntu 13.10 (Saucy), I found that Gnome 3 works with the VMWare Unity mode. Therefore, the solution is to install Gnome 3 and to use Gnome 3. To install Gnome 3, you may issue command below,
sudo apt-get update; sudo apt-get install gnome-session-fallback

I have been happily running Ubuntu 13.10 (Sauncy) as a guest operating system and using it in VMWare Unity mode for a quite while, well, until I upgrade it to Ubuntu 14.04 (Trusty). What is the problem? I checked the versions of Gnome 3 before and after the upgrade from Ubuntu 13.10 (Sauncy) to Ubuntu 14.04 (Trusty), they are the same,

$ gnome-session --version
gnome-session 3.9.90

I believe that it is still the issue with the Desktop environment that Ubuntu is running -- not VMWare tries not to support such a feature. Then, the task is to find out which desktop environment works with the VMWare Unity mode on Ubuntu 14.04 (Trusty). I found the list of Desktop environments that I may try from this post, 
I did not try all of them. However, I am happily to report that the following Desktop environments that work with VMWare Unity mode on Ubuntu 14.04 (Trusty),

  • Xfce
    To install it. Run
          sudo apt-get install xfce4
    or if you want more bells & whitsles, 
          apt-get install xubuntu-desktop
  • LXDE
    To install it. Run
          sudo apt-get install lxde
    or if you want the full desktop environment,
          apt-get install lubuntu-desktop
  • Mate
    To install it. Run
    sudo apt-add-repository ppa:ubuntu-mate-dev/ppa
    sudo apt-add-repository ppa:ubuntu-mate-dev/trusty-mate
    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get install --no-install-recommends \
    ubuntu-mate-core ubuntu-mate-desktop
    At this point, you can switch to VMware Unity mode. However, the application menu of the VMWare Unity mode is empty. This is the result that the VMware tools at present only recognoizes three desktop environments, Gnome, KDE, and Xfce -- if you run vmware-xdg-detect-de in your Ubuntu guest, you will see that the output of the script is empty. I made one minor change to the script,  and the VMWare Unity mode menu appeared. Below is the diff result on the script before and after the revision.
    diff \
    /usr/bin/vmware-xdg-detect-de \
    $HOME/vmware-tools-distrib/lib/bin32/vmware-xdg-detect-de
    63,67d62
    < elif `dbus-send --print-reply --dest=org.freedesktop.DBus \
    < /org/freedesktop/DBus \
    < org.freedesktop.DBus.GetNameOwner \
    < string:org.mate.SessionManager > /dev/null 2>&1` ; \
    < then DE=gnome; # pretent to be gnome

    The complete script is at GitHub.
  • GNOME Flashback/Fallback

    As described before, to install it, run,
    sudo apt-get update; sudo apt-get install gnome-session-fallback
    Initially, I thought GNOME Flashback/Fallback stopped working with VMware Unity mode on Ubuntu 14.04. However, once I investigated further, I discovered that Ubuntu 14.04 reports the value of environmental variable XDG_CURRENT_DESKTOP as Unity. The solution is still to let vmware-xdg-detect-de return gnome. What I did is shown in this diff result,
    diff /usr/bin/vmware-xdg-detect-de \
    $HOME/vmware-tools-distrib/lib/bin32/vmware-xdg-detect-de
    58,60d57
    < DE=gnome
    < xdgDE=gnome

    The complete script using the approach described above (although not identical) is at GitHub. It is worth noting that when I manually set the environmental variable to GNOME in the user profile, e.g., adding the following line to $HOME/.profile, VMware Unity mode remains NOT working. 
    export XDG_CURRENT_DESKTOP=GNOME
    It begins to work only after I made the revision to vmware-xdg-detect-de as described above.

    A new problem I have encountered is that once VMware enters the Unity mode, in some of my Ubuntu virtual machines, the application menu is empty -- if you always launch programs from command line, it may not be too much of a problem. A further investigation indicates that this problem only occurs on the Ubuntu virtual machines that are upgraded from previous revision. I reinstalled the gnome-session-flashback and the problem went away. To reinstall the package, do,

    sudo apt-get install --reinstall gnome-session-flashback

    Just be aware that when you have GNOME Flashback/Fallback installed, you will have two options on the login screen, "GNOME Flashback (compwiz)" and "GNOME Flashback (metacity)". VMware Unity mode only works with the latter. In fact, VMware lists "a modern version of Metacity or KDE" as a prerequist to use the Unity mode on its website.

To conclude, below is what I have tried.


Testing Result of Desktop Environment for VMWare Unity Mode on Ubuntu 14.04 (Trusty)
Desktop EnvironmentDisplay Name in Login ScreenVMWare Unity Mode Works?
Ubuntu UnityUbuntu DefaultNo
GNOME 3GNOMENo
GNOME 3GNOME Flashback (Compwiz)No
GNOME 3GNOME Flashback (Metacity)Yes (See the note on Gnome above and
download vmware-xdg-detect-de)
XfceXfceYes
XfceXUbuntuYes
LXDELXDEYes
LXDELUbuntuYes
MateMateYes (See the note on Mate above and
download vmware-xdg-detect-de)
AwesomeAwesomeNo

However, if you try a different desktop envionment on Ubuntu 14.04 (Trusty) and it works or does not work with the VMWare Unity mode, please share it with me. I will update this post to include your result.


No comments:

Post a Comment