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
-
Connect to the Linux server as the
rootuser. For more information, see Connect to a Linux server. -
Run the following commands to install the desktop environment.
apt-get update apt install -y xfce4 xfce4-goodies dbus-x11 -
Install and configure Virtual Network Computing (VNC).
-
Run the following command to install VNC.
apt install -y tightvncserver -
Run the following command to start the VNC service and set a password when prompted.
vncserverImportantIf your password is longer than 8 characters, the system uses only the first 8 characters as the VNC password.
-
Modify the VNC configuration file.
echo 'startxfce4 &' >> ~/.vnc/xstartup -
Run the following commands to restart the desktop process.
vncserver -kill :1 vncserver
-
Ubuntu 22.04
-
Connect to the Linux server as the
rootuser. For more information, see Connect to a Linux server. -
Run the following commands to install the desktop environment.
apt-get update apt install -y xfce4 xfce4-goodies -
Run the following command to install VNC.
apt install -y tightvncserver -
Run the following command to start the VNC service and set a password when prompted.
vncserverImportantIf your password is longer than 8 characters, the system uses only the first 8 characters as the VNC password.
Ubuntu 18.04/20.04
-
Connect to the Linux server as the
rootuser. For more information, see Connect to a Linux server. -
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 -
Install and configure VNC.
-
Run the following command to install VNC.
Ubuntu 18.04
apt-get install -y vnc4serverUbuntu 20.04
apt-get install -y tightvncserver -
Run the following command to start VNC.
vncserverWhen 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.
ImportantIf 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.

In the output
izbp166dsac66tx****:1,izbp166dsac66tx****is the hostname and:1indicates the VNC process's port number. -
Run the following command to back up the VNC xstartup configuration file.
cp ~/.vnc/xstartup ~/.vnc/xstartup.bak -
Run the following command to modify the VNC xstartup configuration file.
vim ~/.vnc/xstartup -
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 & -
Press the Esc key, type
:wq, and then press the Enter key to save and exit the file.
-
-
Restart VNC.
-
Run the following command to stop the VNC process.
vncserver -kill :1 -
Run the following command to start a new VNC process.
The VNC port number remains 1.
vncserver -geometry 1920x1080 :1
-
Ubuntu 16.04
-
Connect to the Linux server as the
rootuser. For more information, see Connect to a Linux server. -
Install the desktop environment.
-
Run the following command to install the X-Windows applications.
apt-get install -y x-window-system-core -
Run the following command to install the GNOME display manager gdm3.
apt-get install -y gdm3 -
Run the following command to install the Ubuntu desktop.
apt-get install -y ubuntu-desktop -
Run the following command to install GNOME dependencies.
apt-get install -y gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal -
Run the following command to back up the VNC xstartup configuration file.
cp ~/.vnc/xstartup ~/.vnc/xstartup.bak -
Run the following command to modify the VNC xstartup configuration file.
vi ~/.vnc/xstartup -
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:

-
-
Press the Esc key, type
:wq, and then press the Enter key to save and exit the file.
-
-
Install and configure VNC.
-
Run the following command to update software sources.
apt-get update -
Run the following command to install VNC.
apt-get install -y vnc4server -
Run the following command to start VNC.
vncserverWhen you first start VNC, you are prompted to set a password. Enter and confirm the password.
ImportantIf 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.

In the output
izbp166dsac66tx****:1,izbp166dsac66tx****is the hostname and:1indicates the VNC process's port number.
-
-
Restart VNC.
-
Run the following command to stop the VNC process.
vncserver -kill :1 -
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.
-
Configure the security group.
Allow inbound traffic for the VNC service on ports
5900and5901in the server's firewall. For more information, see Firewall settings.
-
On your local computer, download and install VNC Viewer from the official VNC Viewer website.
-
Open VNC Viewer. From the top menu bar, select .

-
In the Properties dialog box, configure the connection information for the Ubuntu desktop, and then click OK.
Required fields:
-
VNC Server: Enter <public IP address of the Ubuntu server>:<VNC port number>. Example:
114.55.XX.XX:5901.For information about how to obtain the public IP address of a Simple Application Server instance, see How do I obtain the public IP address of a Simple Application Server instance?.
-
Name: Enter a name for this connection. Example:
test001.
-
-
Double-click the new connection to the Ubuntu desktop.
In this example, double-click the card for the Ubuntu desktop named
test001. -
In the Authentication dialog box, enter the VNC password in the Password text box, and then click OK.

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

FAQ
Troubleshoot VNC Viewer connection

-
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
-
Run the following command to change the VNC password. Follow the prompts to enter and confirm the new password.
vncpasswdImportantIf your password is longer than 8 characters, the system uses only the first 8 characters as the VNC password.
-
(Optional) Restart the VNC service.
vncserver -kill :1 vncserver