I was trying to log in to Ubuntu as usual. I entered my password and it did not log me in even with the correct password. Instead, it showed me failed to start session in red colors. I could not even log in to guest session.
In this quick post, we shall see how to fix failed to start session issue in Ubuntu 16.04 and earlier versions.
Note: If you see only the wallpaper, no Unity, launcher and dash after login, try this Ubuntu login failed fix.
Fix failed to start session in Ubuntu
The reason here is that somehow your Unity desktop has been messed up. You can try several way to recover it. Let’s see how to do it.
When you are at login, press Ctrl+Alt+F1. It will take you to command line interface from the GUI. In here, type your username and password. Now, you can try the following command to install Unity Desktop:
sudo apt-get install ubuntu-desktop
If it is already installed, try reinstalling:
sudo apt-get install --reinstall ubuntu-desktop
Once it is installed or reinstalled. Use the following command to reboot the system:
It will reboot and bring you back to login screen. Try login now. You should be able to log in. If you are still unlucky, try to use the alternative below:
Alternative method 1:
As an alternative you can use the command below to reconfigure the packaging:
sudo dpkg-reconfigure -a
At times, this should fix the failed to start session issue in Ubuntu. But it was not that easy for me. I used another approach which is slightly dirty. When I saw that reinstalling Unity and reconfiguring the packages dis not make any difference, I installed Gnome instead using a command like this:
sudo apt-get install gnome-shell ubuntu-gnome-desktop
This time at reboot, I was able to boot in to Gnome desktop or even choose to boot in to Ubuntu default i.e. Unity. A word of warning, Unity may seem broken after installing Gnome. Change the theme and icons to that of Ambiance, instead of default (Adawita).
That helped me fix “failed to load session” error in Ubuntu 16.04. Did it work for you? Do let me know if you have questions or suggestions.