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.
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.
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
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
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.
-
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