This topic describes how to install a GUI desktop on an Elastic Compute Service (ECS) instance that runs Ubuntu 18. After the GUI desktop is installed, you can use it to manage the Ubuntu 18 operating system.
Prerequisites
A Ubuntu 18 instance is created. For more information, see Create an instance by using the wizard.Install a GUI desktop
Important The performance of an instance is degraded after a GUI desktop is installed on it. If the GUI desktop is not properly installed, the instance operating system may be unable to boot. Before you install a GUI desktop on the Ubuntu 18 instance, we recommend that you create snapshots for the instance to back up your data. For more information, see Create a snapshot of a disk.
- Connect to the Ubuntu 18 instance. For more information, see Connect to a Linux instance by using a password or key.
- Run the following command to update the software repository:
apt-get update
- Run the following command to install a GUI desktop:
apt-get install ubuntu-desktop
If an error is reported as shown in the following figure during the installation process, use the solution described in the FAQ section of this topic to resolve the issue. Then, start the GUI desktop. - Run the following command to configure the GUI desktop to auto-start on system startup:
systemctl set-default graphical.target
- Connect to the Ubuntu 18 instance by using a Virtual Network Computing (VNC) management terminal. For more information, see Connect to a Linux instance by using a password.
- Run the following command to restart the instance:
reboot
The welcome page shown in the following figure indicates that the GUI desktop is installed. - Click Next repeatedly to accept default settings. The interface shown in the following figure indicates that the GUI desktop is installed and available for use. You can disable the GUI desktop if you do not want to use it. For more information, see the Disable the GUI desktop section.
Disable the GUI desktop
- In the GUI desktop, right-click a blank area and select Open Terminal.
- Run the following command to disable the GUI desktop:
systemctl set-default multi-user.target
- Enter your password twice as prompted. The password must be the one that you set when you configure the GUI desktop.
- Run the following command to restart the instance:
reboot
The following command output indicates that the GUI desktop is disabled for Ubuntu 18.
FAQ
Problem description
An error is reported when a GUI desktop is being installed on a Ubuntu 18 instance, as shown in the following figure.
Cause
Recent versions of the pdate-manager-core, libparted2, and python3-update-manager packages exist on the instance. However, previous versions of the packages are required to install the GUI desktop for Ubuntu 18. You must delete the recent versions of the packages so that the system re-installs software packages based on the software package dependency tree.
Solution
- Run the following command to uninstall recent versions of the pdate-manager-core, libparted2, and python3-update-manager packages:
apt-get remove update-manager-core libparted2 python3-update-manager
- Run the following commands to re-install the GUI desktop:
apt-get update apt-get install ubuntu-desktop