Add Desktop Environment to HASSbian


I haven’t met with similar topic at forum, so why not make a short tutorial?

Since All-in-One Installer declared to be deprecated, HASSbian seems the only quick source for users tracing pure Raspbian experience . Furthermore, many people may want to use pi as MagicMirror or other projects needing GUI. Actually adding GUI to Hassbian is quite easy and finally you will get your own Raspbian with Desktop, even with hassbian-config tool!

Sound not bad, right? Here’s the guide:

Open terminal directly at a Hassbian-ready pi or ssh, plz make you use the latest Hassbian image (Stretch version).

First, of course, make sure everything is new.

sudo apt-get update
sudo apt-get upgrade
sudo reboot

Then we start the real installation:

sudo apt-get install --no-install-recommends xserver-xorg
sudo apt-get install --no-install-recommends xinit
sudo apt-get install --no-install-recommends raspberrypi-ui-mods lxterminal gvfs
sudo apt-get install lightdm
sudo reboot

Note: When pi is rebooted make sure that it outputs to Screen itself. Don’t use VNC here. Or Xserver will fail to launch because it cannot recognize the screen is attached.

After reboot, input you account name and password using keyboard attached to pi. Then you will be taken into desktop directly. There you go~ Everything is just like what you been through at Raspbian with PIXEL. Now you can set-up VNC or ssh to it.

If you want to enable auto-login, then open terminal again (this time you can click it at GUI): sudo nano /etc/lightdm/lightdm.conf. Find #autologin-user=username, uncomment it. Save and exit.

Finally you have your Hassbian with PIXEL, enjoy.

Of course you can choose other desktop environment like LXDE, just replace raspberrypi-ui-mods with whatever you want.



thanks for your great hint! I tried that and got to the login screen. But everytime I type in my credentials and click on the login button, the screen goes black for a second and I come back to the login screen. Do you know what that can mean?

Thank you und sry for the noob question!


No, no, no. Actually other people reported the same question to me as well. I’m digging to it.


I’ve got the same… Raspberry Pi 2 running with a fresh install of Hassbian.


Hey @cxlwill - are you looking into this - would love to help debug! I’m really only looking to launch a web browser in kiosk mode to show the HASS web front end on a monitor attached to the pi!


Any solution to the issue? I would love to have graphical enviroment (like Hassbian Pixel Desktop) into Hassbian.


Sorry for late response. It seems forum keeps maintaining so that I cannot reply. Well, I am still digging to it. Others have reported to me the same issue. I cannot reproduce this issue at my machine. But based on my research, it might caused by failed init of Xserver. Meanwhile, many of them tried LXDE and everything is OK. If you are in hurry, I recommend use LXDE. It’s not bad at all. Actually maybe better than raspberry-ui-mods. Of course, it all depends on you~~


Thank you for your help~ I try to reproduce this issue. Meanwhile, have you tried LXDE? Another desktop environment without function loss.


So this commands are not working any more?

Then we start the real installation:

sudo apt-get install --no-install-recommends xserver-xorg
sudo apt-get install --no-install-recommends xinit
sudo apt-get install --no-install-recommends raspberrypi-ui-mods lxterminal gvfs
sudo apt-get install lightdm
sudo reboot




No, actually they work very well. The problem that mentioned above is that desktop Environment didn’t launch correctly. But they are installed successfully.


What I have to change in this commands to install LXDE??

sudo apt-get install --no-install-recommends xserver-xorg
sudo apt-get install --no-install-recommends xinit
sudo apt-get install --no-install-recommends raspberrypi-ui-mods lxterminal gvfs
sudo apt-get install lightdm
sudo reboot


Finally I could install LXDE GUI and it start ok after login (user and password), but in the main desktop I can’t find the wifi icon. So

There is any way to get the WIFI ICON in the desktop or anywhere?


You can install LXAppearance to adjust appearance settings including icons. sudo apt-get install lxappearance


I’ve encountered this same problem with the Pixel desktop login prompt reappearing after an apparently successful login. I took your advice and installed LXDE…
sudo apt-get install lxde

But after rebooting, it still launches the Pixel desktop login which I cannot get to work.
BTW, the option to select OpenBox mode and use right-click to open a terminal session does work, but that’s all.

Thanks for any advice to remove Pixel and switch to LXDE after it has been installed.


I got stuck in the login/return to login screen after the initial install. To resolve, when prompted with the login go to the page with wrench icon in the top right and switch from Default Session to Openbox.

If you have installed LXDE you can select that as the desktop as well.


i tried it on Raspberry Pi 3 B+ with Hassbian but it failed to install Pixel, is their a reason that it’s unable to connect to Xserver?


Hi, I’m still confused with this problem. I got my Pi 3B+ last month and this solution worked. Meanwhile, I keep searching for differences of yours against mine. Can you install lxde or other GUI?


I’ve been trying to make it work with hassbian but couldn’t make it. I have 7 inch foundation Touchscreen and the one thing that worked for me was installing hassbian scripts on top of fullpageos 0.8.1, since latest version of raspbian is based on kernel 4.14y where the support of the mentioned display is broken due to device tree changes. So far I will wait till raspbian upgrades the kernel to 4.15+ where the support for the display is implemented into the kernel and then renew my experiments.


I’ve resolved the login issue installing the following packages:
pi-greeter : The Raspberry Pi LightDM login theme
rpd-icons : The Raspberry Pi Desktop icon theme
gtk2-engines-clearlookspix : GTK Theme Engine (used to render Raspberry Pi LightDM login/desktop theme properly)

sudo apt-get install pi-greeter
sudo apt-get install rpd-icons
sudo apt-get install gtk2-engines-clearlookspix


Thanks a lot. So I remember to add lightdm into code but forgot the theme.