Installing and Configuring TightVNC Server with Xfce on Ubuntu
This guide will walk you through the installation and configuration of TightVNC Server with Xfce on an Ubuntu server, and how to connect to…
Installing and Configuring TightVNC Server with Xfce on Ubuntu

This guide will walk you through the installation and configuration of TightVNC Server with Xfce on an Ubuntu server, and how to connect to the desktop remotely using a VNC client.
Prerequisites
- Ubuntu server (latest version recommended)
- Root or sudo access to the server
- A VNC client on your local machine (such as RealVNC or TigerVNC)
- Port 5901 open on the firewall
Update Your System
First, ensure that your system is up to date by running the following commands:
sudo apt update && sudo apt upgrade
This will update the package lists and upgrade any outdated packages.
Install the Required Packages
Next, install the Xfce desktop environment and TightVNC Server. You can do this by running the following command:
sudo apt install xfce4 xfce4-goodies tightvncserver
xfce4: Installs the core Xfce desktop environment.xfce4-goodies: Installs additional utilities for Xfce.tightvncserver: Installs the VNC server software.
Configure VNC Server Password
After the installation, set up the VNC password by running:
vncserver
This will prompt you to enter a password that you’ll use to connect to the VNC server. You can also set a view-only password, but it’s optional.
Check the VNC Server Logs
Once the VNC server starts, it will create a log file that you can use to verify its status. To check the log:
cat ~/.vnc/$(hostname):1.log
If you see an error like:
xrdb: can't open file '/root/.Xresources'
Terminated
This indicates that the .Xresources file is missing, and you need to fix it.
Kill the VNC Server to Modify Configuration
Before you can make the necessary changes, stop the VNC server:
vncserver -kill :1
The :1 refers to the display number, which corresponds to port 5901 for VNC. Adjust if your VNC session uses a different display number.
Modify the xstartup Script
Edit the xstartup file located in the ~/.vnc/ directory:
nano ~/.vnc/xstartup
Add the following content to the xstartup script to start Xfce:
#!/bin/sh
# Set up the resources for X applications
xrdb "$HOME/.Xresources"
# Set the root window background color (optional)
xsetroot -solid grey
# Fix for GNOME if needed
export XKL_XMODMAP_DISABLE=1
# Start Xfce desktop environment
startxfce4 &
Ensure the script is executable:
chmod +x ~/.vnc/xstartup
Create or Modify .Xresources (Optional)
You may need to create or modify the .Xresources file, which handles the default font and other display settings for X applications.
Create a file called .Xresources in your home directory:
nano ~/.Xresources
Add the following configuration to the file:
! Set the default font
Xft.dpi: 96
Xft.antialias: 1
Xft.hinting: 1
Xft.hintstyle: hintslight
Xft.rgba: rgb
! Set font for X applications (optional)
XTerm*faceName: Monospace
XTerm*faceSize: 12
! Colors and Appearance for XTerm (optional)
XTerm*background: black
XTerm*foreground: white
XTerm*cursorColor: white
XTerm*highlightColor: yellow
XTerm*highlightText: black
! For VNC desktop background color (optional)
*background: #2e3436
*foreground: #ffffff
*borderWidth: 1
*iconBackground: #555555
*iconForeground: #ffffff
*loginShell: true
! Set default window size and appearance (optional)
xterm*VT100.geometry: 80x24
This file configures fonts, colors, and the general appearance of the Xfce environment.
Restart the VNC Server
Once you’ve made the changes, start the VNC server again:
vncserver :1
This will restart the VNC server on display :1 (port 5901). You will see output like the following:
New 'X' desktop is mytest-machine.com:1
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/mytest-machine.com:1.log
Connecting to the VNC Server
To connect to the VNC server, use a VNC client (like RealVNC, TigerVNC, or VNC Viewer).
Download and install TigerVNC from here.. https://sourceforge.net/projects/tigervnc/files/stable/1.15.0/
The connection string will be:
mytest-machine.com:1
or
[Server_IP_Address]:5901
Enter the password you set earlier when prompted to log in.
Troubleshooting
If you encounter issues such as a gray screen or black screen, check the following:
- Ensure the
~/.vnc/xstartupfile is properly configured to start Xfce. - Check the VNC server logs located in
~/.vnc/for any errors. - Make sure that all required dependencies for Xfce are installed.
Additional Notes
- Firewall Configuration: If you’re running a firewall, make sure to allow VNC traffic by opening port
5901(for display:1) on the server:
sudo ufw allow 5901/tcp
- VNC Server Displays: If you need multiple VNC sessions, you can run multiple instances of the VNC server on different display numbers (e.g.,
vncserver :2,vncserver :3, etc.). Each display corresponds to a different port (e.g.,5902,5903). - Killing VNC Sessions: You can kill any running VNC session by using the command:
vncserver -kill :1
Conclusion
You have successfully installed and configured TightVNC Server with Xfce on your Ubuntu server. You can now access the server’s desktop remotely using a VNC client.
메타데이터
- post_id
- 8913a98bfa2d
- slug
- installing-and-configuring-tightvnc-server-with-xfce-on-ubuntu-8913a98bfa2d
- url
- https://medium.com/@techworldthink/installing-and-configuring-tightvnc-server-with-xfce-on-ubuntu-8913a98bfa2d
- canonical_url
- https://medium.com/@techworldthink/installing-and-configuring-tightvnc-server-with-xfce-on-ubuntu-8913a98bfa2d
- author_url
- https://medium.com/@techworldthink
- status
- ok
- fetched_at
- 2026-07-10 12:09:34