====== Proxmox - Guests (VMs and Containers) - Install a GUI ======
Most containers are server only, and do not come with a GUI.
To have a GUI installed, try the following.
* [[Proxmox:Guests (VMs and Containers):Install a GUI:Minimal GUI|Minimal GUI]]
* [[Proxmox:Guests (VMs and Containers):Install a GUI:Minimal GUI with display manager|Minimal GUI with display manager]]
* [[Proxmox:Guests (VMs and Containers):Install a GUI:A more functional minimal desktop environment|A more functional minimal desktop environment]]
* [[Proxmox:Guests (VMs and Containers):Install a GUI:A full lightweight desktop environment|A full lightweight desktop environment]]
* [[Proxmox:Guests (VMs and Containers):Install a GUI:A full lightweight desktop environment with additional recommended applications|A full lightweight desktop environment with additional recommended applications]]
* [[Proxmox:Guests (VMs and Containers):Install a GUI:A full desktop with all the extras|A full desktop with all the extras]]
----
===== Quick Options =====
* Ubuntu default desktop: **sudo apt install ubuntu-desktop**
* Gnome 3 installation: **sudo apt-get install gnome-shell**
* KDE see Kubuntu installation: **sudo apt-get install kubuntu-desktop**
* XFCE installation: **sudo apt-get install xfce4**.
* LXDE installation: **sudo apt-get install lxde**
* Openbox installation: **sudo apt-get install openbox**
* Gnome Classic (old) a Gnome 3 desktop that looks like Gnome 2 installation: **sudo apt-get install gnome-session-fallback**
* Ubuntu Gnome (Official flavor) installation: **sudo apt install ubuntu-gnome-desktop**
----
===== Against Ubuntu 20.04 Container =====
apt-get update
apt-get install ubuntu-desktop
**NOTE:** After a reboot, this should get a graphical login prompt.
----
==== For a minimal install ====
apt install --no-install-recommends ubuntu-desktop
**NOTE:** To have a very basic GUI.
* The **--no-install-recommends** will exclude major software and tools such as libreoffice, firefox , thunderbird etc.
----
===== Install a display manager =====
A Display Manager is responsible for starting the display server and loading the desktop while managing user sessions and authentication.
By default, GNOME Desktop uses GDM3 as its display manager, but it is a bit heavy on the resources side.
==== Install ====
A lighter and more resource-friendly display manager can be used.
sudo apt install lightdm
==== Start ====
Start the display manager and load the GUI with the following command:
sudo service lightdm start
==== To check what display manager is configured in your system ====
cat /etc/X11/default-display-manager
returns:
/usr/bin/lightdm
==== To shutdown the GUI ====
sudo service lightdm stop
----
===== Add a non-root user =====
Many systems do not recommend or allow root login.
They also require that the user has a **home directory**.
add user peter
add user peter sudo
**NOTE:** The sudo at the end adds the user, **peter**, to the sudo group.
----
===== Tips =====
* TIP1: The **--no-install-recommends** options applies to all dependencies packages recursively.
* So first install the xorg package to make sure all graphic drivers and other packages are installed.
* TIP2: If network-manager and network-manager-gnome are installed, then it is best to use it to configure your network and delete everything at /etc/network/interfaces file (except the lo interface) in order to avoid conflicts.
* TIP3: If you need remote desktop via x11vnc then choose option 2 to 6 (You may also need to add option **-auth guess** and **-loopso** that vnc works before you login and after you logout).
* TIP4: At options 2 to 6 if you wanna stop lightdm autostarting then run the command **sudo systemctl disable lightdm** and you can start it whenever you want with **sudo systemctl start lightdm**.
* To re-enable it run **sudo systemctl enable lightdm** and check it with **systemctl is-enabled lightdm**.
* If the re-enable does not work, and the is-enabled commands has output static run **sudo apt install --reinstall lightdm** to fix it.
* TIP5: You can install the specific desktop environment metapackage like lxde, xfce4, mate-desktop-environment, plasma-desktop, unity, gnome.
* However, you will need more packages than just xorg in most cases and these packages or metapackages might install packages that are not longer preferred by any Ubuntu flavor.
* For example lxde installs wicd as recommendation when all flavors (including lubuntu) use network-manager and network-manager-gnome nowadays.
* To see differences between packages you can search here: http://packages.ubuntu.com/
* TIP6: If upon boot you see the greeter and it throws you back to tty again, then simply restart the lightdm by firing **sudo service lightdm restart**.
----
===== How to remove the GUI from Ubuntu server =====
sudo apt remove ubuntu-desktop
sudo apt remove lightdm
sudo apt autoremove
sudo service lightdm stop
----
===== References =====
https://help.ubuntu.com/community/ServerGUI
https://askubuntu.com/questions/53822/how-do-you-run-ubuntu-server-with-a-gui