Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Elastic Cloud Server/ Best Practices/ Using VNC Viewer to Access a Linux ECS

Using VNC Viewer to Access a Linux ECS

Updated on 2024-11-04 GMT+08:00

Linux ECSs are generally accessed through SSH, allowing you to securely log in to your ECSs using key pairs. However, SSH connections use a character-based user interface, which does not support complex operations that are supported on the GUI. This section uses the Ubuntu 20.04 OS as an example to describe how to install VNC Server on a Linux ECS and how to use VNC Viewer to access the ECS.

Preparations

Installing VNC Server

Ubuntu 20.04 has no GUI or VNC Server installed by default. In this example, Xfce, a compact lightweight desktop is used. Xfce is more compact and user-friendly than Gnome and KDE. It applies to remote ECS access.

  1. Remotely log in to the ECS.

    The username is root, and the password is the one you set during ECS creation.

  2. Run the following command to update the software package list:

    sudo apt update

  3. Install Xfce.

    sudo apt install xfce4 xfce4-goodies

  4. Install the TightVNC server.

    sudo apt install tightvncserver

  5. Run the vncserver command to configure the TightVNC server.

    After the first running of the vncserver command, the system automatically creates a default startup script. Then, configure parameters as prompted.

    • Password: consists of 6 to 8 characters. When the number of characters reaches the upper limit (8), no more characters can be entered. Securely keep the password, which will be used by VNC Viewer to access an ECS.
    • Verify: Enter the password again.
    • Would you like to enter a view-only password: If you select y, you are not allowed to use the mouse or keyboard to control your ECS. Press n.

Configuring VNC Server

  1. Stop the first virtual desktop.

    vncserver -kill :1

  2. Modify the xstartup file.

    vim ~/.vnc/xstartup

    Press i to enter insert mode and add the following to the file:

    #!/bin/sh
    xrdb $HOME/.Xresources
    startxfce4 &

    In the preceding terminal display:

    • The first command xrdb $HOME/.Xresources is used to have the VNC GUI framework read the .Xresources file of VNC Server. You can modify GUI settings in the .Xresources file, such as the color display, cursor theme, and font rendering.
    • The second command startxfce4 & have VNC Server start Xfce.

  3. Assign executable permissions to the file to ensure proper VNC running.

    sudo chmod +x ~/.vnc/xstartup

  4. Restart VNC Server.

    vncserver

    After the second running of the vncserver command, the system automatically creates a log file.

    The information similar to "Log file is /root/.vnc/xxx:1.log" is displayed. 1 indicates that the current user is allocated with the first VNC desktop.

Configuring the ECS on the Management Console

  1. Log in to the management console.
  2. Click the name of your ECS to switch to the page providing details about the ECS.
  3. On the Security Groups tab page, click Modify Security Group Rule to permit port 5901.
    Figure 1 Modifying security group rules

Using VNC Viewer to Access an ECS

  1. Start the VNC Viewer client on the local computer, enter EIP:1, set the name, and click OK.
    NOTE:

    The port number is determined by the log file name displayed in the command output of step 4. If the log file name is xxx:1.log, enter 1.

  2. In the displayed dialog box, click Continue.

  3. Enter the password set in step 5 and click OK.

  4. Verify the GUI of the Ubuntu 20.04 OS.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback