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
- Log in to the ECS and install the GUI desktop component.
- Run the following command to update the software library:
- Run the following command to install the Ubuntu GUI desktop component:
During the installation process, you are required to manually confirm the operation twice. Press y.
- 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 - Restart the ECS. Then, you can log in to the GUI as user root.
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.