All Products
Search
Document Center

Elastic Compute Service:Install a GUI on a Linux system

Last Updated:Jun 21, 2026

By default, public Linux images provided by Alibaba Cloud do not include a desktop environment to ensure optimal server performance and stability. Installing a graphical user interface (GUI) can significantly improve user experience and operational efficiency.

Applicability and risks

Before you begin, read and acknowledge the following key limitations and risks.

  • Operating system compatibility: Alibaba Cloud Linux does not support GUI installation.

  • Remote connection tool limitations: After a GUI is installed, VNC connections default to the graphical interface. Connections using Workbench and Session Manager are not affected.

  • Performance impact: A GUI continuously consumes significant CPU and memory resources, typically requiring at least an additional 1 to 2 GiB of memory. This can lead to slower responses on low-specification instances. We recommend installing a GUI only for specific, necessary use cases, such as automated testing or graphics rendering. For routine server management, use command-line tools.

Quick selection

Choosing a lightweight desktop environment reduces resource consumption.

Desktop environment (DE)

Resource usage (Memory)

Minimum specifications

XFCE

Low (approx. 500–800 MB)

2 vCPU, 2 GiB

MATE

Medium (approx. 800 MB–1.2 GiB)

2 vCPU, 4 GiB

GNOME

High (approx. 1.5 GiB+)

4 vCPU, 8 GiB

Procedure

Important

Before installation, we recommend creating a manual snapshot of your ECS instance. This allows for quick data recovery if an issue occurs.

Install XFCE on Ubuntu 18/20/22/24

  1. Connect to the instance by using VNC.

  2. Update the package list and upgrade installed packages.

    sudo apt update && sudo apt upgrade -y
  3. Install the XFCE desktop environment.

    sudo apt install -y xfce4 xfce4-goodies lightdm lightdm-gtk-greeter
    LightDM is a lightweight display manager that loads the login window, authenticates the user, and starts the desktop session at boot.
  4. Restart the ECS instance.

    sudo reboot
  5. Connect and verify.

    Wait for the system to restart. The graphical interface appears, confirming a successful installation.

    By default, Ubuntu does not allow the root user to log in to a graphical session. Create a standard user for desktop sessions and grant sudo privileges as needed to avoid operating the desktop directly as root.

Uninstall the graphical interface

To remove the graphical interface, run the following commands:

# 1. Stop and uninstall XFCE-related packages
sudo apt-get purge -y xfce4* lightdm*
# 2. Automatically remove unnecessary dependency packages
sudo apt-get autoremove -y --purge
# 3. Restart the system
sudo reboot

Install GNOME on Anolis 8/CentOS Stream

  1. Connect to the instance by using VNC.

  2. Update packages.

    sudo dnf update -y
  3. Install the GNOME desktop environment.

    sudo dnf groupinstall "Server with GUI" -y
    "Server with GUI" is a package group that includes GNOME and common utilities.
  4. Set the system to boot into the graphical target by default.

    sudo systemctl set-default graphical.target
  5. Restart the instance to apply the changes.

    sudo reboot

    After the instance restarts, log in over VNC from the ECS console to see the GNOME login screen. Enter the instance's username and password to access the desktop.

Uninstall the graphical interface

To remove the graphical interface, run the following commands:

# 1. Switch back to the command-line boot target
sudo systemctl set-default multi-user.target
# 2. Uninstall the graphical interface package group
sudo dnf groupremove "Server with GUI" -y
# 3. Automatically remove unnecessary dependency packages
sudo dnf autoremove -y
# 4. Restart the instance
sudo reboot

Install MATE on CentOS 7/8

Important

CentOS 7 and 8 have reached their End of Life (EOL). Official software repositories are no longer available. Continuing to use these versions poses security risks and may cause installation failures.

  1. Connect to the instance by using VNC.

  2. Upgrade all packages.

    sudo yum -y upgrade
  3. Install the MATE desktop environment.

    sudo yum groups install "X Window System"
    sudo yum groups install "MATE Desktop"
  4. Set the instance to boot into the graphical desktop environment by default.

    sudo systemctl set-default graphical.target
  5. Restart the ECS instance.

    sudo reboot

Uninstall the graphical interface

# View installed groups
sudo yum group list installed
# Uninstall the MATE Desktop environment
sudo yum groupremove "MATE Desktop"
sudo yum groupremove "X Window System"
# Automatically remove unnecessary dependency packages
sudo yum autoremove
# Set the system to boot into multi-user (text) mode
sudo systemctl set-default multi-user.target
# Restart the system
sudo reboot

Production best practices

When using a GUI in a production environment, follow these best practices.

  • Resource planning: Reserve sufficient CPU and memory for your selected desktop environment to ensure a successful installation and smooth operation. Continuously monitor resource usage by viewing instance monitoring data and upgrade the instance specifications if necessary.

  • Security hardening:

    • Principle of least privilege: Create a non-root standard user dedicated to GUI login. Avoid using the root account for desktop sessions.

    • System updates: Regularly run sudo dnf update or sudo apt upgrade to promptly patch security vulnerabilities in the desktop environment and underlying system.

FAQ

CentOS keyboard and mouse issues

Symptoms

After installing a desktop environment and connecting to the ECS instance by using VNC from the ECS console, the mouse and keyboard are unresponsive.

Cause

This is caused by issues with the keyboard and mouse drivers.

Solution

Follow these steps to change the driver type to evdev.

  1. Install the evdev driver.

    yum install xorg-x11-drv-evdev
  2. Create the /etc/X11/xorg.conf configuration file.

    Xorg -configure
  3. Back up the new configuration file.

    cp xorg.conf.new /etc/X11/xorg.conf
  4. Edit the /etc/X11/xorg.conf file and change the mouse and keyboard driver to evdev.

    Identifier "Keyboard0"
    Driver "evdev"       #Change to evdev
    Option "Device" "/dev/input/event3"
    EndSection
    Section "InputDevice"
    Identifier "Mouse0"
    Driver "evdev"       #Change to evdev
    Option "Device" "/dev/input/event5"
    Option "Mode" "Absolute"
    EndSection
    • The configuration file before modification looks similar to the following:

      Section "InputDevice"
              Identifier  "keyboard0"
              Driver      "kbd"
      EndSection
      Section "InputDevice"
              Identifier  "Mouse0"
              Driver      "mouse"
              Option      "Protocol" "auto"
              Option      "Device" "/dev/input/mice"
              Option      "ZAxisMapping" "4 5 6 7"
      EndSection
    • The configuration file after modification looks similar to the following:

      Section "InputDevice"
              Identifier  "Keyboard0"
              Driver  "evdev"
              Option  "Device" "/dev/input/event3"
      EndSection
      Section "InputDevice"
              Identifier  "Mouse0"
              Driver  "evdev"
              Option  "Device" "/dev/input/event5"
              Option  "Mode" "Absolute"
      EndSection
  5. Restart the ECS instance and confirm that the mouse and keyboard function correctly.

GNOME startup failure on CentOS

Symptoms

After you install the GNOME desktop environment and restart the ECS instance, you cannot log in. The following error is displayed:

"You are currently trying to run as the root super user. The super user is a specialized account that is not designed to run a normal user session. Various programs will not function properly, and actions performed under this account can cause unrecoverable damage to the operating system."
Cause

The messagebus and haldaemon services are not started automatically. To improve system performance and stability, Alibaba Cloud public Linux images do not start these services by default.

Solution
  1. Roll back the operating system from a snapshot. For more information, see Roll back a disk by using a snapshot.

  2. Follow the procedure to reinstall the GUI.

  3. Configure the messagebus and haldaemon services to start automatically on boot.

    chkconfig --level 35 messagebus on
    chkconfig --level 35 haldaemon on
    We recommend that you change the runlevel to Level 3 and then use the startx command to start the desktop environment to test its availability. This allows you to switch to terminal mode for troubleshooting if a problem occurs. After you confirm that the desktop environment starts correctly, change the runlevel back to Level 5.

Unmet dependencies on Ubuntu

Symptoms

When installing a graphical desktop on Ubuntu 18, you may encounter the following error.

root@iZxxx:~# apt install ubuntu-desktop
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
ubuntu-desktop : Depends: nautilus but it is not going to be installed
                 Depends: ubuntu-release-upgrader-gtk but it is not going to be installed
                 Depends: update-manager but it is not going to be installed
                 Recommends: gnome-disk-utility but it is not going to be installed
                 Recommends: gvfs-fuse but it is not going to be installed
                 Recommends: nautilus-share but it is not going to be installed
                 Recommends: usb-creator-gtk but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
root@iZxxx:~#
Cause

This error occurs because installing ubuntu-desktop requires earlier versions of the update-manager-core, libparted2, and python3-update-manager packages. You must remove the higher-version packages to allow the system to reinstall the correct versions and resolve the dependencies.

Solution
  1. Uninstall the higher-version packages.

    apt-get remove update-manager-core libparted2 python3-update-manager
  2. Reinstall the graphical desktop.

    apt-get update
    apt-get install ubuntu-desktop

How do I fix the Invalid configuration value: failovermethod=priority error from yum groupinstall?

Symptoms
Invalid configuration value: failovermethod=priority in /etc/yum.repos.d/CentOS-epel.repo; Configuration: OptionBinding with id "failovermethod" does not exist
CentOS Linux 8 - AppStream
Cause

This issue occurs because the Extra Packages for Enterprise Linux (EPEL) repository configuration file /etc/yum.repos.d/CentOS-epel.repo contains the invalid configuration option failovermethod=priority. In CentOS 8, yum is actually based on dnf, and dnf no longer supports the failovermethod option. Therefore, when dnf parses this repository configuration file, it reports an error.

Solution

Modify the EPEL repository configuration file to remove or comment out the failovermethod=priority line. Follow these steps:

  1. Edit the EPEL repository configuration file.

    Open the /etc/yum.repos.d/CentOS-epel.repo file. For example:

    sudo vi /etc/yum.repos.d/CentOS-epel.repo
  2. Find and comment out the failovermethod=priority line.

    In the open file, locate the line that contains failovermethod=priority.

    Add a # symbol at the beginning of the line to comment it out.

    # failovermethod=priority
  3. Clear the package manager cache to ensure the new configuration takes effect.

    sudo yum clean all
    sudo yum makecache
  4. Try installing the GUI again.

    sudo yum groupinstall "Server with GUI" -y

System lag after GUI installation

System lag after installing a GUI is often caused by high resource consumption from the desktop environment or an under-provisioned instance.

Xrdp can improve performance by using the native Windows Remote Desktop Client (mstsc.exe), which offers greater stability. With a strong network connection, Xrdp can provide a smoother remote experience. To install Xrdp, run the following commands:

sudo apt install xrdp -y
sudo adduser xrdp ssl-cert
sudo ufw allow 3389/tcp
sudo systemctl status xrdp
sudo systemctl enable xrdp

If the system still lags, consider switching to a more lightweight desktop environment to improve performance.