Skip to content

Instantly share code, notes, and snippets.

@kasumiru
Forked from dryliketoast/ubuntu minimal gui
Last active April 6, 2021 22:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasumiru/6a2db90d2cfd3f24d11195b073b0f0cb to your computer and use it in GitHub Desktop.
Save kasumiru/6a2db90d2cfd3f24d11195b073b0f0cb to your computer and use it in GitHub Desktop.
Written by Thanos Apostolou
http://askubuntu.com/questions/53822/how-do-you-run-ubuntu-server-with-a-gui
Some more info can be found here https://help.ubuntu.com/community/ServerGUI. I assume you start with a clean install of Ubuntu Server 16.04 (some modifications may be needed for older versions of Ubuntu). Depending on your needs you can do these:
OPENBOX:
sudo apt install -y xorg
sudo apt install -y --no-install-recommends openbox
sudo apt install -y --no-install-recommends lightdm-gtk-greeter
sudo apt install -y --no-install-recommends lightdm
#sudo apt install -y --no-install-recommends openbox
After reboot you will see the lightdm login menu.
A more functional minimal desktop environment (the one I use):
############################################################################################################
https://askubuntu.com/questions/229989/how-to-setup-x11vnc-to-access-with-graphical-login-screen/
sudo apt-get -y install x11vnc
sudo x11vnc -storepasswd yourVXXXXXXXXXXXNCpasswordHERE /etc/x11vnc.pass
# for Ubuntu 16.10+
sudo vim /etc/systemd/system/x11vnc.service
[Unit]
Description="x11vnc"
Requires=display-manager.service
After=display-manager.service
[Service]
ExecStart=/usr/bin/x11vnc -xkb -noxrecord -noxfixes -noxdamage -display :0 -auth guess -rfbauth /etc/x11vnc.pass
ExecStop=/usr/bin/killall x11vnc
Restart=on-failure
Restart-sec=2
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl start x11vnc
sudo systemctl enable x11vnc
############################################################################################################
1. Install Tight VNC server:
sudo apt-get install tightvncserver
2. Start it manually (for example by running
vncserver :1
) and enter new VNC password.
vim /etc/systemd/system/vncserver@.service
[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target
[Service]
Type=forking
User=pi
PAMName=login
PIDFile=/home/pi/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%i
ExecStop=/usr/bin/vncserver -kill :%i
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable vncserver@1.service
sudo systemctl restart vncserver@1.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment