Help Center > > 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?

Updated at: May 06, 2020 GMT+08:00

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 a 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 ubuntu-desktop

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

  2. Enable GUI.

    After the ECS is restarted, the GUI remote desktop can be used. Only the guest account can be used for remote logins, and it does not require a login password.

    To allow other users to log in to the ECS, go to step 3, in which user root is used as an example.

  3. Set remote logins as user root. (The following operations also apply to other users.)

    The following operations can only be performed by user root. Use a remote login tool, such as PuTTY.

    1. Run the following command to modify the 50-ubuntu.conf configuration file:

      # vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf

      The modified data is as follows:

      [Seat:*]    
      user-session=ubuntu    
      greeter-show-manual-login=true     
      allow-guest=false   
    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.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel