Help Center> Elastic Cloud Server> FAQs> OS Management> GUI Installation FAQs> How Can I Install a GUI on an ECS Running Ubuntu?

How Can I Install a GUI on an ECS Running Ubuntu?

Scenarios

The ECSs running Ubuntu series do not have GUI installed by default. If GUI is required, perform the operations described in this section to install it.

Constraints

  • The operations described in this section apply to ECSs running Ubuntu 14 or 16 only.
  • The target ECS must have an EIP bound or have an intranet image source configured.
  • Before installing a GUI on an ECS, ensure that the idle memory is greater than or equal to 2 GB. Otherwise, the GUI installation may fail or the ECS cannot be started after the installation.
  • If the ECS is Kunpeng-powered, use the image source provided by HUAWEI CLOUD. For details, see How Can I Use an Ubuntu Image Source (x86_64 or Arm) Provided by HUAWEI CLOUD?

Procedure

  1. Log in to the ECS and install the GUI desktop component.
    1. Run the following command to update the software library:

      # apt-get update

    2. Run the following command to install the Ubuntu GUI desktop component:

      # apt-get install xubuntu-desktop

    During the installation process, you are required to manually confirm the operation twice. Press y.

  2. Run the following command to edit the root/.profile file:

    # vi /root/.profile

    Change mesg n || true at the end of the file to tty -s && mesg n || true. The modified file data is as follows:

    # ~/.profile: executed by Bourne-compatible login shells.
     
    if [ "$BASH" ]; then
      if [ -f ~/.bashrc ]; then
        . ~/.bashrc
      fi
    fi
    tty -s && mesg n || true
  3. Restart the ECS. Then, you can log in to the GUI as user root.