tencent cloud


Building a Visual Ubuntu Desktop

Last updated: 2022-07-27 16:05:18


    Virtual Network Console (VNC) is a remote control tool software developed by AT&T European Research Laboratory. An open-source software based on UNIX and Linux operating systems, VNC features robust remote control capability, high efficiency, and strong practicability. Its performance is comparable to any remote control software in Windows or Mac. This document will guide you through on how to build a visual Ubuntu desktop by using VNC.


    You have purchased a Linux instance with the Ubuntu OS; if not, please see Customizing Linux CVM Configurations.


    Configuring instance security group

    The VNC service uses the TCP protocol and port 5901 by default. Therefore, you need to open port 5901 in the security group bound to the instance by adding a rule for opening protocol port TCP:5901 in Inbound Rules. For more information, please see Adding Security Group Rules.

    Installing software packages

    1. Log in to a Linux instance.

    2. Run the following command to switch to the "root" account.

      sudo -i
    3. Run the following command to clear the cache.

      apt-get clean all
    4. Run the following command to obtain and update to the latest version.

      apt-get update
    5. Run the following command to install the software packages required by the desktop environment, including desktop applications such as system panel, window manager, file browser, and terminal.

      apt install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal ubuntu-desktop

    Configuring VNC

    1. Run the following system-specific command to install VNC.

      apt-get install vnc4server

    2. Run the following command to launch VNC and set a password.

    If the result similar to the following is returned, it indicates that VNC has been launched successfully.

    3. Run the following command to access the VNC configuration file.

    vi ~/.vnc/xstartup
    1. Press i to enter edit mode, and modify the configuration file as follows.

      export XKL_XMODMAP_DISABLE=1
      export XDG_CURRENT_DESKTOP="GNOME-Flashback:GNOME"
      export XDG_MENU_PREFIX="gnome-flashback-"
      gnome-session --session=gnome-flashback-metacity --disable-acceleration-check &
    2. Press Esc and enter :wq. Save and close the file.

    3. Run the following commands to restart the desktop process.

      vncserver -kill :1 # Enter the command to terminate the original desktop process (wherein :1 is the number of the desktop)
    vncserver -geometry 1920x1080 :1 # Generate a new session
    1. Click here to download and install VNC Viewer. Select the version that matches your operating system.
    2. Type CVM IP address: 1 into VNC Viewer, and press Enter.
    3. In the pop-up window, click Continue.
    4. Enter the VNC password set in step 2 and click OK.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support