Linux MintUbuntu Based

How To Install VNC Server on Linux Mint 22

Install VNC Server on Linux Mint 22

Remote desktop access has become essential for system administrators, developers, and users who need to manage their Linux systems from anywhere. Linux Mint 22 “Wilma” provides excellent support for VNC (Virtual Network Computing) servers, enabling secure remote desktop connections with full graphical interface access. This comprehensive guide walks through installing and configuring multiple VNC server solutions, ensuring optimal performance and security for your remote desktop needs.

VNC technology allows complete control of your Linux Mint desktop environment from remote locations, making it invaluable for remote work scenarios, server management, technical support, and accessing files across different machines. Whether you’re managing multiple systems or need flexible access to your primary workstation, setting up a VNC server transforms your Linux Mint 22 system into a powerful remote-accessible platform.

Prerequisites and System Preparation

Before installing any VNC server on Linux Mint 22, proper system preparation ensures smooth installation and optimal performance. Your system requires administrative privileges, updated packages, and appropriate network configuration to support remote desktop connections effectively.

Start by ensuring your Linux Mint 22 system has the latest updates installed. Open the terminal using Ctrl + Alt + T and execute the following commands:

sudo apt update
sudo apt upgrade -y

These commands refresh the package repository index and install available system updates. Complete system updates prevent compatibility issues and security vulnerabilities that could affect VNC server functionality.

Verify that your user account has sudo privileges, as VNC server installation and configuration require administrative access. Check your desktop environment installation – while Linux Mint 22 includes the Cinnamon desktop by default, server installations may need additional desktop environment packages.

Network configuration plays a crucial role in VNC server accessibility. Determine whether you’ll use the VNC server for local network access or remote internet connections, as this affects firewall configuration and security measures. For local network usage, note your system’s IP address using ip addr show command.

VNC Server Options Comparison

Linux Mint 22 supports several VNC server implementations, each offering distinct advantages for different use cases. Understanding these options helps select the most appropriate solution for your specific requirements.

TigerVNC Server stands out as a high-performance, actively maintained VNC implementation designed for modern Linux systems. It provides excellent performance optimization, supports multiple display configurations, and offers robust security features. TigerVNC handles high-resolution displays efficiently and maintains compatibility with various VNC clients across different platforms.

X11VNC Server excels at sharing existing desktop sessions rather than creating separate virtual desktops. This lightweight approach makes it ideal for sharing your current desktop session with remote users without starting additional desktop environments. X11VNC consumes fewer system resources and provides immediate access to your active desktop session.

RealVNC Server offers commercial-grade features including cloud connectivity, file transfer capabilities, and cross-platform mobile applications. While the free version has limitations, RealVNC provides enterprise-level security features and professional support options for business environments.

TightVNC Server focuses on bandwidth efficiency and performance optimization for slower network connections. It provides excellent compression algorithms that reduce network traffic while maintaining acceptable display quality for remote desktop sessions.

Feature TigerVNC X11VNC RealVNC TightVNC
Performance Excellent Good Very Good Good
Session Type Virtual Existing Both Virtual
Security High Medium Very High Medium
Bandwidth Usage Low Medium Low Very Low
Commercial Support No No Yes No

Installing TigerVNC Server

TigerVNC installation on Linux Mint 22 requires specific packages that provide the server functionality, X11 extensions, and client viewer capabilities. This installation method ensures comprehensive VNC server functionality with optimal performance characteristics.

Begin the TigerVNC installation process by installing the required packages:

sudo apt install tigervnc-standalone-server tigervnc-xorg-extension tigervnc-viewer dbus-x11

The tigervnc-standalone-server package provides the core VNC server functionality, while tigervnc-xorg-extension ensures proper integration with the X11 display system. The tigervnc-viewer package includes the client software for testing connections, and dbus-x11 enables proper desktop session communication.

After installation completion, configure the VNC server password using the vncpasswd command:

vncpasswd

Enter a secure password between 6-8 characters when prompted. This password protects your VNC server from unauthorized access, so choose a strong combination of letters, numbers, and symbols.

Create the VNC startup configuration file to specify which desktop environment launches during VNC sessions:

mkdir -p ~/.vnc
touch ~/.vnc/xstartup
chmod +x ~/.vnc/xstartup

Edit the xstartup file using your preferred text editor:

nano ~/.vnc/xstartup

Add the following configuration for Cinnamon desktop environment:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
/usr/bin/cinnamon-session

This configuration ensures proper Cinnamon desktop startup while avoiding session conflicts between the VNC environment and host system sessions.

Test the TigerVNC server installation by starting a VNC session:

vncserver :1

The :1 parameter specifies display number 1, which corresponds to TCP port 5901. Successful startup displays output indicating the server is running and accessible on port 5901.

Installing X11VNC Server

X11VNC provides an alternative approach to VNC server functionality by sharing existing desktop sessions rather than creating separate virtual environments. This method suits scenarios where you need immediate access to your current desktop session without additional configuration complexity.

Install X11VNC using the standard package manager:

sudo apt update
sudo apt install x11vnc -y

Configure password protection for X11VNC connections:

x11vnc -storepasswd

This command creates an encrypted password file in your home directory that X11VNC uses for authentication. Choose a strong password to prevent unauthorized access to your desktop session.

Start X11VNC server to share your current desktop session:

x11vnc -usepw -forever -display :0

The command options perform specific functions:

  • -usepw: Uses the stored password for client authentication
  • -forever: Keeps the server running after client disconnections
  • -display :0: Shares the primary desktop display

For automatic startup, create a desktop autostart entry or add the command to your session startup scripts. X11VNC typically runs on port 5900, making it accessible via VNC clients using your system’s IP address.

Consider running X11VNC with additional security options for enhanced protection:

x11vnc -usepw -forever -display :0 -localhost -allow 192.168.1.0/24

The -localhost option restricts connections to local machine only (useful with SSH tunneling), while -allow specifies allowed IP address ranges for connection access.

Installing RealVNC Server

RealVNC Server installation on Linux Mint 22 requires downloading the official package from RealVNC’s website, as it’s not available in standard repositories. This commercial solution provides advanced features including cloud connectivity and enterprise security options.

Navigate to the official RealVNC website and download the DEB package for 64-bit Linux systems. Ensure you select the “DEB x64” option from the download dropdown menu.

Install the downloaded package using the following commands:

cd ~/Downloads
sudo apt install ./VNC-Server-*-Linux-x64.deb

The asterisk wildcard matches the version number in the filename, accommodating different RealVNC Server versions without requiring exact filename specification.

After installation, configure RealVNC Server for your system:

sudo systemctl enable vncserver-x11-serviced
sudo systemctl start vncserver-x11-serviced

Access the RealVNC Server configuration interface through the system settings or by running:

vncserver-config

Create a RealVNC account if you plan to use cloud connectivity features. The free tier provides basic remote desktop functionality, while paid subscriptions unlock advanced features like file transfer, session recording, and multi-platform mobile access.

Configure authentication settings and display options according to your requirements. RealVNC Server integrates with Linux Mint’s desktop environment automatically, providing seamless desktop sharing capabilities.

Security Configuration and Best Practices

VNC server security requires careful attention to prevent unauthorized access and protect sensitive data during remote sessions. Implementing proper security measures ensures safe remote desktop access while maintaining system integrity.

Password Security Implementation

Configure strong VNC passwords using complex combinations of uppercase letters, lowercase letters, numbers, and special characters. Change VNC passwords regularly, especially in multi-user environments or after suspected security incidents.

For enhanced security, consider implementing two-factor authentication where supported, or combine VNC access with additional authentication layers such as SSH key-based access.

SSH Tunneling Configuration

SSH tunneling provides encryption for VNC connections, which typically transmit data in plaintext. Establish SSH tunnels using the following command structure:

ssh -L 5901:localhost:5901 -C -N -l username server_ip

This command creates a secure tunnel from local port 5901 to the remote server’s VNC port, encrypting all VNC traffic through the SSH connection. The -C option enables compression for better performance over slower connections.

Firewall Configuration

Configure UFW (Uncomplicated Firewall) to restrict VNC server access to trusted networks and IP addresses:

sudo ufw allow from 192.168.1.0/24 to any port 5901
sudo ufw enable

This configuration allows VNC connections only from the local network range 192.168.1.0/24, preventing internet-wide access to your VNC server.

Network Access Controls

Implement network-level access controls by configuring VNC servers to bind only to specific network interfaces. For enhanced security, bind VNC servers to localhost and require SSH tunneling for all remote connections:

vncserver -localhost yes :1

This configuration prevents direct network access to the VNC server, forcing all connections through encrypted SSH tunnels.

System Service Configuration

Configuring VNC server as a systemd service enables automatic startup, proper service management, and integration with Linux Mint’s service management infrastructure. This approach ensures reliable VNC server operation and simplified administration.

Create a systemd service file for TigerVNC server:

sudo nano /etc/systemd/system/vncserver@.service

Add the following service configuration, replacing “username” with your actual username:

[Unit]
Description=Start TigerVNC server at startup
After=syslog.target network.target

[Service]
Type=forking
User=username
Group=username
WorkingDirectory=/home/username
PIDFile=/home/username/.vnc/%H:%i.pid
ExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1
ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 -localhost :%i
ExecStop=/usr/bin/vncserver -kill :%i

[Install]
WantedBy=multi-user.target

The service configuration includes important parameters:

  • Type=forking: Indicates the service forks background processes
  • ExecStartPre: Ensures clean startup by terminating existing sessions
  • ExecStart: Starts VNC server with specified display depth and geometry
  • ExecStop: Properly terminates VNC server sessions

Reload systemd configuration and enable the service:

sudo systemctl daemon-reload
sudo systemctl enable vncserver@1.service
sudo systemctl start vncserver@1.service

Verify service status and troubleshoot startup issues:

sudo systemctl status vncserver@1.service

For user-specific service configuration, create a user systemd service instead of system-wide service:

mkdir -p ~/.config/systemd/user
nano ~/.config/systemd/user/vncserver.service

User services start automatically when the user logs in and stop when the user logs out, providing session-specific VNC server management.

Client Connection and Usage

Connecting to your VNC server requires appropriate client software and proper connection configuration. Various VNC client options provide different features and compatibility levels across operating systems.

VNC Client Software Options

TigerVNC Viewer provides excellent compatibility with TigerVNC servers and offers advanced configuration options for display optimization. Install TigerVNC Viewer on client systems using distribution-specific package managers.

RealVNC Viewer supports multiple VNC server types and provides user-friendly interfaces for connection management. Download RealVNC Viewer from the official website for optimal compatibility and feature support.

Third-party VNC clients like VNC Connect, Remote Desktop Viewer, and browser-based solutions offer alternative access methods depending on client system capabilities and user preferences.

Direct Connection Methods

For direct network connections, use the server’s IP address followed by the display number:

192.168.1.100:1

This example connects to VNC server display 1 on IP address 192.168.1.100. The display number corresponds to the port number (5900 + display number).

SSH Tunnel Connections

When using SSH tunneling for security, establish the tunnel first:

ssh -L 5901:localhost:5901 -C -N -f -l username server_ip

Then connect your VNC client to:

localhost:5901

This method encrypts all VNC traffic through the SSH connection, providing secure remote desktop access over untrusted networks.

Mobile Device Connections

Many VNC clients support mobile devices, enabling remote desktop access from smartphones and tablets. Configure mobile clients with SSH tunneling capabilities for secure connections over cellular or Wi-Fi networks.

Optimize mobile connections by reducing color depth and resolution settings to accommodate limited bandwidth and screen sizes on mobile devices.

Troubleshooting and Performance Optimization

Common VNC server issues have established solutions that address installation problems, connection failures, and performance limitations. Understanding these troubleshooting approaches enables quick resolution of typical VNC server challenges.

Installation and Configuration Issues

Package dependency conflicts may occur during installation, particularly when multiple VNC servers are installed simultaneously. Resolve conflicts by removing conflicting packages or using alternative installation methods:

sudo apt remove --purge tightvnc-server
sudo apt autoremove
sudo apt install tigervnc-standalone-server

Desktop environment conflicts manifest as blank screens or session startup failures. The “xiccd has closed unexpectedly” error resolves by removing conflicting screensaver packages:

sudo apt purge gnome-screensaver xfce4-screensaver

Permission issues prevent proper VNC server startup or configuration file access. Ensure correct file ownership and permissions:

chmod 600 ~/.vnc/passwd
chmod +x ~/.vnc/xstartup

Connection and Authentication Problems

Firewall blocking prevents VNC client connections despite proper server configuration. Verify firewall rules and ensure appropriate ports are accessible:

sudo ufw status
sudo netstat -tlnp | grep :590

SSH tunnel failures often result from incorrect port forwarding or authentication issues. Verify SSH server configuration and test basic SSH connectivity before establishing VNC tunnels.

Authentication failures may indicate password synchronization issues between server and client. Reset VNC passwords and ensure proper password file permissions:

vncpasswd
chmod 600 ~/.vnc/passwd

Performance Optimization Strategies

Network bandwidth limitations affect VNC session responsiveness and display quality. Optimize performance by adjusting color depth and compression settings:

vncserver -depth 16 -geometry 1024x768 :1

Reduced color depth (16-bit instead of 24-bit) significantly improves performance over slower network connections while maintaining acceptable display quality for most applications.

Display resolution optimization balances visual quality with network performance. Use lower resolutions for remote administration tasks and higher resolutions for graphics-intensive applications:

vncserver -geometry 800x600 :1  # Low bandwidth
vncserver -geometry 1920x1080 :1  # High bandwidth

Client-side optimization includes disabling desktop effects, reducing animation settings, and closing unnecessary applications during VNC sessions to improve overall responsiveness.

Advanced Configuration and Management

Advanced VNC server configuration enables specialized deployment scenarios, enhanced security implementations, and optimized performance for specific use cases. These configurations address enterprise requirements and complex network environments.

Multiple VNC Sessions

Configure multiple VNC sessions for different users or purposes by starting servers on different display numbers:

vncserver :1  # Port 5901
vncserver :2  # Port 5902
vncserver :3  # Port 5903

Each session operates independently with separate desktop environments, password protection, and user contexts. This approach supports multiple simultaneous users or dedicated sessions for specific applications.

Custom Desktop Environments

Configure alternative desktop environments for VNC sessions by modifying the xstartup file. XFCE provides lightweight performance for remote sessions:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
startxfce4

MATE desktop offers another lightweight alternative with traditional interface design:

#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
mate-session

Logging and Monitoring

Enable comprehensive logging for VNC server activities and connection monitoring:

vncserver -log /var/log/vnc/display1.log :1

Monitor VNC server performance and connection statistics using system monitoring tools and log analysis utilities. Regular log review helps identify security issues and performance bottlenecks.

Congratulations! You have successfully installed VNC. Thanks for using this tutorial for installing the latest version of VNC Server on the Linux Mint 22 system. For additional help or useful information, we recommend you check the official VNC website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button