tencent cloud

Feedback

Building a Visual Ubuntu Desktop

Last updated: 2024-01-06 17:43:10

    Scenarios

    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.

    Prerequisite

    Purchase a Linux CVM using Ubuntu OS.

    Directions

    Configuring instance security group

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

    Installing software packages

    Ubuntu 18.04
    Ubuntu 20.04
    Ubuntu 22.04
    2. Run the following command to clear the cache and update the software package list.
    sudo apt clean all && sudo apt update
    3. 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.
    sudo apt install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal ubuntu-desktop
    4. Run the following command to install VNC.
    apt-get install vnc4server
    2. Run the following command to clear the cache and update the software package list.
    sudo apt clean all && sudo apt update
    3. 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.
    sudo apt install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal ubuntu-desktop
    4. Run the following command to install VNC.
    apt-get install tightvncserver
    2. Clear the cache and update the software package list.
    sudo apt clean all && sudo apt update
    3. Install the desktop environment.
    sudo apt install xfce4 xfce4-goodies
    4. Run the following command to install VNC.
    sudo apt install tightvncserver

    Configuring VNC

    Ubuntu 18.04
    Ubuntu 20.04
    Ubuntu 22.04
    1. 
    Run the following command to launch VNC and set a password.
    
    vncserver
    If the result similar to the following is returned, it indicates that VNC has been launched successfully.
    
    
    2. Run the following command to access the VNC configuration file.
    vi ~/.vnc/xstartup
    3. Press i to enter edit mode, and modify the configuration file as follows.
    #!/bin/sh
    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 &
    4. Click Esc and enter :wq to save and close the file.
    5. 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
    6. Click here to download and install VNC Viewer. Select the version that matches your operating system.
    7. Type CVM IP address: 1 into VNC Viewer, and press Enter.
    
    
    8. In the pop-up window, click Continue.
    9. Enter the VNC password set in step 1 and click OK.
    1. 
    Run the following command to launch VNC and set a password.
    
    vncserver
    If the result similar to the following is returned, it indicates that VNC has been launched successfully.
    
    
    2. Run the following command to access the VNC configuration file.
    vi ~/.vnc/xstartup
    3. Press i to enter edit mode, and modify the configuration file as follows.
    #!/bin/sh
    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 &
    4. Click Esc and enter :wq to save and close the file.
    5. 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
    6. Click here to download and install VNC Viewer. Select the version that matches your operating system.
    7. Type CVM IP address: 1 into VNC Viewer, and press Enter.
    
    
    8. In the pop-up window, click Continue.
    9. Enter the VNC password set in step 1 and click OK.
    1. Run the following command to launch VNC and set a password.
    vncserver
    If the result similar to the following is returned, it indicates that VNC has been launched successfully.
    
    
    2. Go to the VNC Viewer official website, download and install VNC Viewer of the version that matches your operating system.
    3. Type CVM IP address: 1 into VNC Viewer, and press Enter.
    
    
    4. In the pop-up window, click Continue.
    5. Enter the password created in the previous step and click OK.
    Note:
    If you forgot the password, log in to the instance and execute vncpasswd to resetthe VNC login password.
    Appendix: Install Chrome:
    Log in to the instance and execute the following command to download .deb:
    wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
    Install .deb file
    sudo apt install ./google-chrome-stable_current_amd64.deb
    
    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