All Products
Search
Document Center

Simple Application Server:Set up a graphical interface for Ubuntu

Last Updated:Apr 22, 2026

By default, Simple Application Server instances running Ubuntu provide only a command-line interface. To manage your instance visually, you can install a graphical desktop environment.

Prerequisites

You have created a Simple Application Server instance that runs Ubuntu. For more information, see Create a Simple Application Server instance.

Procedure

Step 1: Set up the graphical interface

Ubuntu 24.04

  1. Connect to the Linux server as the root user. For more information, see Connect to a Linux server.

  2. Run the following commands to install the desktop environment.

    apt-get update
    apt install -y xfce4 xfce4-goodies dbus-x11
  3. Install and configure Virtual Network Computing (VNC).

    1. Run the following command to install VNC.

      apt install -y tightvncserver
    2. Run the following command to start the VNC service and set a password when prompted.

      vncserver
      Important

      If your password is longer than 8 characters, the system uses only the first 8 characters as the VNC password.

    3. Modify the VNC configuration file.

      echo 'startxfce4 &' >> ~/.vnc/xstartup
    4. Run the following commands to restart the desktop process.

      vncserver -kill :1
      vncserver

Ubuntu 22.04

  1. Connect to the Linux server as the root user. For more information, see Connect to a Linux server.

  2. Run the following commands to install the desktop environment.

    apt-get update
    apt install -y xfce4 xfce4-goodies
  3. Run the following command to install VNC.

    apt install -y tightvncserver
  4. Run the following command to start the VNC service and set a password when prompted.

    vncserver
    Important

    If your password is longer than 8 characters, the system uses only the first 8 characters as the VNC password.

Ubuntu 18.04/20.04

  1. Connect to the Linux server as the root user. For more information, see Connect to a Linux server.

  2. Run the following commands to install the desktop environment.

    apt-get update
    apt install -y gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal ubuntu-desktop
  3. Install and configure VNC.

    1. Run the following command to install VNC.

      Ubuntu 18.04

      apt-get install -y vnc4server

      Ubuntu 20.04

      apt-get install -y tightvncserver
    2. Run the following command to start VNC.

      vncserver

      When you first start VNC, you are prompted to set a password. Enter and confirm the password. When prompted for a view-only password, enter n and press Enter.2558

      Important

      If your password is longer than 8 characters, the system uses only the first 8 characters as the VNC password.

      If VNC starts successfully, you will see output similar to the following.启动VNC

      In the output izbp166dsac66tx****:1, izbp166dsac66tx**** is the hostname and :1 indicates the VNC process's port number.

    3. Run the following command to back up the VNC xstartup configuration file.

      cp ~/.vnc/xstartup ~/.vnc/xstartup.bak
    4. Run the following command to modify the VNC xstartup configuration file.

      vim ~/.vnc/xstartup
    5. Press the i key to enter edit mode and replace the file's content with the following.

      #!/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 &
    6. Press the Esc key, type :wq, and then press the Enter key to save and exit the file.

  4. Restart VNC.

    1. Run the following command to stop the VNC process.

      vncserver -kill :1
    2. Run the following command to start a new VNC process.

      The VNC port number remains 1.

      vncserver -geometry 1920x1080 :1

Ubuntu 16.04

  1. Connect to the Linux server as the root user. For more information, see Connect to a Linux server.

  2. Install the desktop environment.

    1. Run the following command to install the X-Windows applications.

      apt-get install -y x-window-system-core
    2. Run the following command to install the GNOME display manager gdm3.

      apt-get install -y gdm3
    3. Run the following command to install the Ubuntu desktop.

      apt-get install -y ubuntu-desktop
    4. Run the following command to install GNOME dependencies.

      apt-get install -y gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
    5. Run the following command to back up the VNC xstartup configuration file.

      cp ~/.vnc/xstartup ~/.vnc/xstartup.bak
    6. Run the following command to modify the VNC xstartup configuration file.

      vi ~/.vnc/xstartup
    7. Press the i key to enter edit mode.

      Make the following changes to the configuration file:

      • Comment out the following lines by adding a number sign (#) at the beginning of each line:

        xsetroot -solid grey
        vncconfig -iconic &
        x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
        x-window-manager &
      • Add the following lines to the end of the configuration file:

        gnome-panel &
        gnome-settings-daemon &
        metacity &
        nautilus &
        gnome-terminal &

      After you modify the configuration file, it looks similar to the following:VNC配置文件

    8. Press the Esc key, type :wq, and then press the Enter key to save and exit the file.

  3. Install and configure VNC.

    1. Run the following command to update software sources.

      apt-get update
    2. Run the following command to install VNC.

      apt-get install -y vnc4server
    3. Run the following command to start VNC.

      vncserver

      When you first start VNC, you are prompted to set a password. Enter and confirm the password.

      Important

      If your password is longer than 8 characters, the system uses only the first 8 characters as the VNC password.

      If VNC starts successfully, you will see output similar to the following.启动VNC

      In the output izbp166dsac66tx****:1, izbp166dsac66tx**** is the hostname and :1 indicates the VNC process's port number.

  4. Restart VNC.

    1. Run the following command to stop the VNC process.

      vncserver -kill :1
    2. Run the following command to start a new VNC process.

      The VNC port number remains 1.

      vncserver :1

Step 2: Connect to the graphical desktop

This section uses VNC Viewer as an example.

  1. Configure the security group.

    Allow inbound traffic for the VNC service on ports 5900 and 5901 in the server's firewall. For more information, see Firewall settings.

    image

  2. On your local computer, download and install VNC Viewer from the official VNC Viewer website.

  3. Open VNC Viewer. From the top menu bar, select .

    VNC Viewer

  4. In the Properties dialog box, configure the connection information for the Ubuntu desktop, and then click OK.

    Required fields:

  5. Double-click the new connection to the Ubuntu desktop.

    In this example, double-click the card for the Ubuntu desktop named test001.

  6. In the Authentication dialog box, enter the VNC password in the Password text box, and then click OK.

    password

    After you log on, the Ubuntu graphical interface appears. To open a terminal, right-click the Ubuntu desktop and select Open Terminal.2588

FAQ

Troubleshoot VNC Viewer connection

dasad

  • Verify that the server's firewall allows VNC traffic on ports 5900 and 5901. For more information, see Firewall settings.

  • Check whether a firewall is enabled on your local computer.

  • Check whether you can ping the public IP address of the Ubuntu server from your local computer.

For more information, see Remote connection FAQ.

Reset the VNC password

  1. Run the following command to change the VNC password. Follow the prompts to enter and confirm the new password.

    vncpasswd
    Important

    If your password is longer than 8 characters, the system uses only the first 8 characters as the VNC password.

  2. (Optional) Restart the VNC service.

    vncserver -kill :1
    vncserver