Tools: How to Install and Configure VNC on Ubuntu 22.04 and 24.04 (2026)
Source: DigitalOcean
By Mark Drake, Jamon Camisso and Vinayak Baranwal Virtual Network Computing (VNC) is a graphical remote access protocol. It streams framebuffer updates to your local screen while forwarding keyboard and mouse events to the remote machine, which matches how administrators expect to manage files, browsers, and desktop utilities without standing at the physical console. This tutorial covers Ubuntu 22.04 and LTS versions. You will build the standard command-line install path with TigerVNC packages from Ubuntu repositories, pair them with Xfce for lightweight sessions, and optionally use GNOME when you standardize on GNOME over Xorg. TigerVNC forked from the historic TightVNC codebase and continues to ship fixes inside Ubuntu, so it replaces TightVNC in modern tutorials while preserving familiar vncserver workflows. You will set the VNC password with vncpasswd and assign display :1, wrap traffic inside an SSH tunnel, and register a systemd unit for the VNC server so restarts stay repeatable. VNC differs from Remote Desktop Protocol (RDP) because it focuses on raw framebuffer transport rather than the Windows-centric negotiation stacks common to RDP clients. SSH X forwarding pushes individual X11 windows through SSH, while VNC delivers a full session canvas that persists even if your client disconnects. Choose VNC when you want a dedicated desktop on the server and can accept rectangle-based compression. Choose SSH X forwarding when you only need a handful of apps and already trust X11 security on your network. Throughout this tutorial, TigerVNC stays bound to 127.0.0.1 and you reach it through SSH port forwarding instead of exposing TCP 5901 directly. To follow this tutorial, you need: Match the server project to how you deliver desktops. Virtual sessions suit cloud Droplets, while mirror-style servers fit deskside workstations. TigerVNC ships in the Ubuntu repositories as tigervnc-standalone-server and tigervnc-common, and it tracks upstream security fixes quickly. Pair it with XFCE on headless servers when you want low idle RAM. TightVNC instructions still circulate in older blogs, yet TigerVNC supersedes that lineage inside Ubuntu. Stay on TigerVNC unless compliance mandates byte-for-byte parity with legacy docs. RealVNC targets teams that want brokered cloud connectivity and enterprise policy bundles. Install vendor .deb packages when that tradeoff makes sense; otherwise TigerVNC covers repository-only needs. x11vnc attaches to an existing Xorg display rather than spawning a fresh Xvnc framebuffer. Use it when you need collaboration on a physical console, not on headless servers built from scratch. Note: If you previously followed the Ubuntu 20.04 version of this tutorial, the steps below replace TightVNC with TigerVNC and apply to both Ubuntu 22.04 and 24.04. See how to install and configure VNC on Ubuntu 20.04 for the legacy reference. This step installs the graphical stack your VNC session will launch. Xfce limits RAM and CPU use, which keeps XFCE sessions responsive on small Droplets. Update package indexes: The codename in the output reflects your Ubuntu release. Ubuntu 22.04 shows jammy; Ubuntu 24.04 shows noble. Both are expected. Install Xfce plus helper utilities: If the installer prompts for a default display manager, either option is acceptable on a headless server where you only launch Xfce through VNC. Optional GNOME baseline for readers planning a GNOME-based session: install ubuntu-desktop or gnome-session only if you accept higher RAM usage and the Xorg requirement from Step 2. Ubuntu 22.04 and 24.04 default to Wayland when GNOME and GDM3 are installed, but TigerVNC creates virtual Xorg displays and cannot share a Wayland session. This step switches GDM3 to Xorg so the local GNOME session and TigerVNC use the same display protocol, which prevents blank consoles when you troubleshoot GUI issues on the machine itself. Check whether GDM3 is active before continuing: If the output is inactive or Unit gdm3.service could not be found, GDM3 is not running on this host. Skip the remainder of this step and proceed to Step 3. Edit the GDM configuration: Under [daemon], ensure the file contains: Reboot to apply the setting: After the instance returns, sign in through the physical or serial console if you have one, open a terminal there, and verify the session type: Note: Skip this step when you deploy Ubuntu Server without GDM and only ever launch TigerVNC virtual sessions. Keep it when gdm3 is installed and GNOME runs locally on the same VM. This step applies to both Ubuntu 22.04 and Ubuntu 24.04 with no command divergence. Ubuntu 22.04 ships TigerVNC 1.12.x; Ubuntu 24.04 ships TigerVNC 1.13.x. Print build metadata: Expected output on Ubuntu 22.04 (Ubuntu 24.04 will show 1.13.x with a later build date): Exact version strings change when Ubuntu publishes security rebuilds, but you should always see a TigerVNC banner after installation. This step defines secrets and startup hooks so each display launches your desktop reliably. Run the interactive helper: TigerVNC stores the password as an obfuscated byte string in ~/.vnc/passwd. The protocol truncates passwords to 8 characters regardless of what you type, so use a unique value rather than reusing your system account password. Stop stray sessions before editing: If you instead see Can't find, continue because no session was active. Open the startup file: GNOME consumes more RAM than Xfce; monitor swap if you pick this route. Mark the script runnable: The command produces no output on success. Verify the permission with ls -la ~/.vnc/xstartup. This step validates that the TigerVNC server is listening before you automate startup. Launch display :1, which maps to TCP port 5901 because VNC binds to port 5900 plus the display number: List active displays: Confirm that listeners bind only to loopback: If ss prints nothing, tail ~/.vnc/*.log because those files explain most failures where TigerVNC does not start. This step hands lifecycle control to systemd so TigerVNC returns after kernel updates. Create the template unit: ExecStart must pass -localhost yes, not a bare -localhost flag, so TigerVNC refuses remote-origin TCP connects without SSH. Reload systemd metadata: Enable and start the service for display 1: A successful start produces no output. Run systemctl status immediately after to confirm the service came up. Inspect runtime state: Review further operations in how to use systemctl to manage systemd services and units when you extend this pattern. This step keeps TigerVNC off the public internet while still letting your desktop client attach. Warning: Do not open TCP 5901 in UFW or cloud firewalls. Automated scanners probe VNC constantly. Keep the port closed and rely on SSH instead. Review how to set up a firewall with UFW on Ubuntu when you adjust rules. From Linux or macOS terminals on your laptop, run: ASCII overview of the forwarding path: Windows 10 and later include OpenSSH; run the same command shown above from PowerShell or Command Prompt with no flag changes. If you use PuTTY on Windows, right-click the window title bar and choose Change Settings…: Navigate to Connection, expand SSH, select Tunnels, enter 59000 as Source port, enter localhost:5901 as Destination, click Add, then click Apply: Read how to use SSH tunneling for reverse tunnels and jump-host arrangements. Regardless of client, the viewer always targets the local forward (localhost:59000 here), not the public IP of the Droplet. Point your viewer at localhost:59000, accept the host key warning if prompted, then authenticate with the password from Step 4. You should see the default Xfce workspace: Browse files through Thunar or any terminal emulator: Closing your VNC viewer disconnects the client but leaves the server-side session running. Your applications and open windows persist between sessions, and you can reconnect any time by re-establishing the SSH tunnel and opening the viewer again. The pkill command below is for tearing down the tunnel itself when you are done for the day, not for ending a single VNC session. Because -f backgrounds the SSH process, stop the tunnel by targeting its command line instead of pressing CTRL+C: If you intentionally omit -f, CTRL+C in that foreground SSH session tears down the tunnel immediately. Start triage on the server before you suspect laptop networking. Confirm systemctl status, read ~/.vnc logs, then verify SSH forwarding on your workstation. That ordering prevents wasted firewall edits when TigerVNC never launched. Keep how to set up a firewall with UFW on Ubuntu nearby whenever ss proves the listener exists yet packets never arrive. Tail ~/.vnc/<hostname>:<display>.log, for example /home/sammy/.vnc/server.example.com:1.log, after each failed boot. Run vncserver -kill :1, fix xstartup, then restart the systemd unit. Confirm chmod +x ~/.vnc/xstartup succeeded and that startxfce4 & or the GNOME dbus-run-session block remains present. Missing execute bits strand TigerVNC at a blank framebuffer. Run vncpasswd, restart sudo systemctl restart [email protected], and reconnect through a fresh tunnel. Execute sudo systemctl status [email protected], ss -tlnp | grep 5901, and journalctl -u [email protected] -n 50. If listeners look healthy, verify your SSH forward still runs because the viewer always hits localhost on whichever machine hosts the tunnel endpoint. Reopen /etc/gdm3/custom.conf, confirm WaylandEnable=false, reboot, and repeat echo $XDG_SESSION_TYPE on the console session until it prints x11. How do I install and configure a VNC server on Ubuntu 24.04? Ubuntu 24.04 ships the same TigerVNC packages with refreshed patch versions. Install tigervnc-standalone-server, mirror the /etc/gdm3/custom.conf edit when GNOME runs locally, craft ~/.vnc/xstartup, then launch vncserver :1 -localhost yes. Validate vncserver --version output after apt install because minor numbers shift between releases. Which VNC server is best for Ubuntu? TigerVNC balances repository availability, documentation, and maintenance cadence for most Ubuntu installs. TightVNC remains in historical guides but receives fewer updates. RealVNC suits enterprises that purchase brokered connectivity. x11vnc fits when you must reflect an existing Xorg console rather than provisioning a virtual framebuffer. How do I know if vncserver is running on Ubuntu? Run vncserver -list for session IDs, combine ss -tlnp | grep vnc or ss -tlnp | grep 590 for listener checks, and inspect systemctl status [email protected] when systemd owns the process. Journal output highlights crashes immediately after package upgrades. Does VNC work with Wayland on Ubuntu 22.04 or 24.04? Most TigerVNC deployments still assume X11 semantics even though Xvnc provides its own framebuffer. Disable Wayland in /etc/gdm3/custom.conf, reboot, and confirm echo $XDG_SESSION_TYPE prints x11 on interactive GNOME consoles to avoid conflicting session types. Is there an open-source alternative to RealVNC available in the Ubuntu repositories? Yes. TigerVNC is available with sudo apt install tigervnc-standalone-server and requires no account. RealVNC-specific setup is outside the scope of this tutorial; see RealVNC’s official documentation for licensing and installation steps. For most Ubuntu use cases, TigerVNC is the recommended choice. How do I connect to a VNC server on Ubuntu securely? Run ssh -L 59000:localhost:5901 -C -N -f sammy@your_server_ip, then aim your viewer at localhost:59000. SSH encrypts payloads while TigerVNC stays on loopback. Combine with key-based SSH from how to set up SSH keys on Ubuntu 22.04. How do I stop or kill a VNC server session on Ubuntu? Execute vncserver -kill :1, replacing :1 with whatever vncserver -list reports. Use sudo systemctl stop [email protected] when systemd manages the lifecycle so logs remain coherent. What desktop environment should I use with VNC on Ubuntu Server? XFCE remains the pragmatic default for headless server workloads because it minimizes CPU, RAM, and bandwidth usage. GNOME works when you require its applications, but allocate extra resources and remain on Xorg so TigerVNC expectations stay consistent. You installed TigerVNC on Ubuntu 22.04 or 24.04, configured xstartup for Xfce with optional GNOME coverage, validated listeners with vncserver -list and ss, and registered systemd units so the service survives reboots. Together those tasks cover the standard command-line setup operators bring from older TightVNC guides while aligning packages with maintained repositories. You kept TigerVNC bound to loopback and relied on SSH forwarding, which delivers the secure connection pattern teams expect without widening UFW rules. If your team already uses SSH key-based authentication, the tunnel inherits that key without additional configuration; password-based SSH works identically. Continue tightening SSH with how to set up SSH keys on Ubuntu 22.04, deepen tunnel patterns via how to use SSH tunneling, and revisit how to set up a firewall with UFW on Ubuntu whenever networking changes. Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases. Learn more about our products Former Technical Writer at DigitalOcean. Focused on SysAdmin topics including Debian 11, Ubuntu 22.04, Ubuntu 20.04, Databases, SQL and PostgreSQL. Building future-ready infrastructure with Linux, Cloud, and DevOps. Full Stack Developer & System Administrator. Technical Writer @ DigitalOcean | GitHub Contributor | Passionate about Docker, PostgreSQL, and Open Source | Exploring NLP & AI-TensorFlow | Nailed over 50+ deployments across production environments. This textbox defaults to using Markdown to format your answer. You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link! If you get " xiccd has closed unexpectedly " run " sudo apt purge gnome-screensaver xfce4-screensaver " Hi, thanks for writing all of this up. Clearly a large effort and very much appreciated. Sadly, it didn’t come even close to working for me. Pretty much a disaster from start to end. My logs (for what it’s worth as I am abandoning this now): 07/03/23 20:56:10 Xvnc version TightVNC-1.3.10 07/03/23 20:56:10 Copyright © 2000-2009 TightVNC Group 07/03/23 20:56:10 Copyright © 1999 AT&T Laboratories Cambridge 07/03/23 20:56:10 All Rights Reserved. 07/03/23 20:56:10 See http://www.tightvnc.com/ for information on TightVNC 07/03/23 20:56:10 Desktop name ‘X’ (bob:1) 07/03/23 20:56:10 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t 07/03/23 20:56:10 Listening for VNC connections on TCP port 5901 Font directory ‘/usr/share/fonts/X11/75dpi/’ not found - ignoring Font directory ‘/usr/share/fonts/X11/100dpi/’ not found - ignoring xrdb: No such file or directory xrdb: can’t open file ‘/home/nello/.Xresources’ /usr/bin/startxfce4: X server already running on display :1 gpg-agent: a gpg-agent is already running - not starting a new one (xfwm4:40107): xfwm4-WARNING **: 20:56:12.091: XSync extension too old (3.0). (xfwm4:40107): xfwm4-WARNING **: 20:56:12.091: The display does not support the XRender extension. (xfwm4:40107): xfwm4-WARNING **: 20:56:12.091: The display does not support the XRandr extension. (xfwm4:40107): xfwm4-WARNING **: 20:56:12.091: The display does not support the XRes extension. (xfwm4:40107): xfwm4-WARNING **: 20:56:12.092: The display does not support the XComposite extension. (xfwm4:40107): xfwm4-WARNING **: 20:56:12.092: The display does not support the XDamage extension. (xfwm4:40107): xfwm4-WARNING **: 20:56:12.092: The display does not support the XFixes extension. (xfwm4:40107): xfwm4-WARNING **: 20:56:12.092: The display does not support the XPresent extension. (xfwm4:40107): xfwm4-WARNING **: 20:56:12.092: Compositing manager disabled. xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>Tab’ xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>KP_Up’ xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>KP_Left’ xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>KP_Right’ xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>KP_Down’ xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>KP_End’ xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>KP_Next’ xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>KP_Home’ xfwm4-Message: 20:56:12.109: Unsupported keyboard modifier ‘<Super>KP_Page_Up’ (xfwm4:40107): xfwm4-WARNING **: 20:56:12.112: Cannot find visual format on screen 0 (xfwm4:40107): GLib-CRITICAL **: 20:56:12.112: g_hash_table_destroy: assertion ‘hash_table != NULL’ failed (xfsettingsd:40115): xfsettingsd-CRITICAL **: 20:56:12.130: No RANDR extension found in display :1. Display settings won’t be applied. Xlib: extension “XInputExtension” missing on display “:1”. (xfsettingsd:40115): xfsettingsd-CRITICAL **: 20:56:12.130: XI is not present. (xfsettingsd:40115): xfsettingsd-CRITICAL **: 20:56:12.130: Failed to initialize the Xkb extension. (xfsettingsd:40115): xfsettingsd-CRITICAL **: 20:56:12.130: Failed to initialize the Accessibility extension. xfwm4-Message: 20:56:12.174: Unsupported keyboard modifier ‘<Super>Tab’ xfwm4-Message: 20:56:12.174: Unsupported keyboard modifier ‘<Super>KP_Up’ xfwm4-Message: 20:56:12.174: Unsupported keyboard modifier ‘<Super>KP_Left’ xfwm4-Message: 20:56:12.174: Unsupported keyboard modifier ‘<Super>KP_Right’ xfwm4-Message: 20:56:12.174: Unsupported keyboard modifier ‘<Super>KP_Down’ xfwm4-Message: 20:56:12.174: Unsupported keyboard modifier ‘<Super>KP_End’ xfwm4-Message: 20:56:12.174: Unsupported keyboard modifier ‘<Super>KP_Next’ ** (xfce4-power-manager:40130): WARNING **: 20:56:12.410: Failed to get name owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name ‘org.freedesktop.PowerManagement’: no such name ** (xfce4-power-manager:40130): WARNING **: 20:56:12.411: Failed to get name owner: GDBus.Error:org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name ‘org.xfce.PowerManager’: no such name AUDIT: Tue Mar 7 20:56:12 2023: 39987 Xtightvnc: client 10 rejected from local host Failure: Module initialisation failed ** (xiccd:40170): CRITICAL **: 20:56:12.435: RandR extension is not working on display :1.0 error: autostart failed: Xlib: extension “DPMS” missing on display “:1.0”. (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.486: Monitor is not DPMS capable (xfce4-power-manager:40130): GLib-GObject-WARNING **: 20:56:12.547: …/…/…/gobject/gsignal.c:2613: signal ‘Changed’ is invalid for instance ‘0x5586cf987920’ of type ‘GDBusProxy’ (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ff2a to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ffa8 to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ffa7 to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ff2f to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ff02 to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ff03 to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ff93 to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ff05 to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: could not map keysym 1008ff06 to keycode (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.575: No idle counter. (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.585: Unable to inhibit systemd sleep: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Permission denied ** (xfce4-power-manager:40130): WARNING **: 20:56:12.585: No XRANDR extension found (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.590: Failed to get keyboard max brightness level : GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/UPower/KbdBacklight” (xfce4-power-manager:40130): xfce4-power-manager-WARNING **: 20:56:12.590: Failed to get keyboard max brightness level : GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: Object does not exist at path “/org/freedesktop/UPower/KbdBacklight” ** (xfdesktop:40127): WARNING **: 20:56:12.595: Failed to set the background ‘/usr/share/backgrounds/xfce/xfce-verticals.png’: GDBus.Error:org.freedesktop.DBus.Error.InvalidArgs: No such interface “org.freedesktop.DisplayManager.AccountsService” Process already running (98:Address already in use). Exiting. (tracker-miner-fs-3:40131): Tracker-CRITICAL **: 20:56:12.763: Could not request DBus name ‘org.freedesktop.Tracker3.Miner.Files’: D-Bus service name:‘org.freedesktop.Tracker3.Miner.Files’ is already taken, perhaps the application is already running? ** (wrapper-2.0:40283): WARNING **: 20:56:13.122: Binding ‘XF86AudioLowerVolume’ failed! (wrapper-2.0:40283): pulseaudio-plugin-WARNING **: 20:56:13.122: Could not have grabbed volume control keys. Is another volume control application (xfce4-volumed) running? ** (wrapper-2.0:40283): WARNING **: 20:56:13.122: Binding ‘XF86AudioPlay’ failed! (wrapper-2.0:40283): pulseaudio-plugin-WARNING **: 20:56:13.122: Could not have grabbed multimedia control keys. ** (wrapper-2.0:40285): WARNING **: 20:56:13.127: No XRANDR extension found (wrapper-2.0:40286): GLib-GIO-CRITICAL **: 20:56:13.129: g_file_new_for_path: assertion ‘path != NULL’ failed (wrapper-2.0:40286): GLib-GIO-CRITICAL **: 20:56:13.129: g_file_monitor_file: assertion ‘G_IS_FILE (file)’ failed (wrapper-2.0:40286): GLib-GObject-WARNING **: 20:56:13.129: invalid (NULL) pointer instance (wrapper-2.0:40286): GLib-GObject-CRITICAL **: 20:56:13.129: g_signal_connect_data: assertion ‘G_TYPE_CHECK_INSTANCE (instance)’ failed (wrapper-2.0:40286): Gtk-WARNING **: 20:56:13.129: Attempting to add a widget with type GtkToggleButton to a container of type XfcePanelPlugin, but the widget is already inside a container of type XfcePanelPlugin, please remove the widget from its existing container first. (wrapper-2.0:40285): Gtk-CRITICAL **: 20:56:13.152: gtk_icon_theme_has_icon: assertion ‘icon_name != NULL’ failed (wrapper-2.0:40285): Gtk-CRITICAL **: 20:56:13.153: gtk_icon_theme_has_icon: assertion ‘icon_name != NULL’ failed (wrapper-2.0:40285): Gtk-CRITICAL **: 20:56:13.153: gtk_icon_theme_has_icon: assertion ‘icon_name != NULL’ failed (wrapper-2.0:40301): Gtk-WARNING **: 20:56:13.189: Negative content width -1 (allocation 1, extents 1x1) while allocating gadget (node button, owner XfceArrowButton) (wrapper-2.0:40283): Gtk-WARNING **: 20:56:13.193: Negative content width -3 (allocation 1, extents 2x2) while allocating gadget (node button, owner PulseaudioButton) (wrapper-2.0:40286): Gtk-WARNING **: 20:56:13.195: Negative content width -3 (allocation 1, extents 2x2) while allocating gadget (node button, owner GtkToggleButton) (wrapper-2.0:40285): Gtk-CRITICAL **: 20:56:13.200: gtk_icon_theme_has_icon: assertion ‘icon_name != NULL’ failed (wrapper-2.0:40285): Gtk-WARNING **: 20:56:13.213: Negative content width -3 (allocation 1, extents 2x2) while allocating gadget (node button, owner PowerManagerButton) (update-notifier:40144): libayatana-appindicator-WARNING **: 20:56:15.185: Unable to connect to the Notification Watcher: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying xfce4-panel-Message: 20:56:15.186: Plugin systray-6 has been automatically restarted after crash. (update-notifier:40144): libayatana-appindicator-WARNING **: 20:56:15.186: Unable to connect to the Notification Watcher: GDBus.Error:org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying Xlib: extension “DPMS” missing on display “:1.0”. Xlib: extension “DPMS” missing on display “:1.0”. Xlib: extension “DPMS” missing on display “:1.0”. Basically, I think there’s a whole lot of stuff this tutorial has assumed that just isn’t there. Sadly, this is very characteristic of my Ubuntu experience. I guess it’s just never the year of Linux on the destop, is it. Followed everything step by step and got the vncserver to work on my Ubuntu Server 22.04 running on a Raspberry Pi 4 I use TightVNC viewer (shows up as TigerVNC Viewer) on my Ubuntu desktop 22.04 to view the remote (server) I followed each step and got it working on Ubuntu Server 22.04 running on a Raspberry Pi 4. I then used TightVNC Viewer (shows up as TigerVNC Viewer) on my Ubuntu Desktop 22.04-LTS to view the remote (Ubuntu server 22.04) I followed Step 4, ‘Running VNC as a System Service’, but encountered an issue when trying to start the VNC function. While using the command ‘ps -x’, I could see that the TightVNC service was already running. However, when attempting to VNC, I received an error message stating ‘target machine actively refused it’. To resolve this, I had to manually terminate the TightVNC service using the command ‘vncserver -kill :1’, and then restart the service with the command ‘vncserver’. After doing this, I was able to successfully use the VNC function. Please help Hi I followed this guide and as usual everything worked great. thank you for . sharing your knowledge. But can i ask a couple questions please, when i tunnel in via ssh and then connect with vnc i still get the connection is unencrypted on vnc error. is this normal? is there no way to have a secure connection? and also to add that i use eset security which has banking security on my pc browser, but when i tunnel into server it says that my pc is unsecure and that its being controlled remotely and that its unsafe to do banking etc. why would this be. appreciate the help please. thanks This comment has been deleted When I followed the instructions above for creating the service, starting the service failed with the error message Can't find file ~/.vnc/interactive-UN45:1.pid In the systemd-documentation, I found an example of a traditional forking service. It says the following on PID-files: Note that the daemon should write that file before finishing with its initialization. Otherwise, systemd might try to read the file before it exists. I added the creation of a PID file to the service startup, and that appears to work: ExecStartPre=/usr/bin/touch /home/interactive/.vnc/%H:%i.pid However, the systemd-documentation includes the following under PIDFile: Note that PID files should be avoided in modern projects. Use Type=notify,Type=notify-reload or Type=simple where possible, which does not require use of PID files to determine the main process of a service and avoids needless forking. Would it be possible to avoid forking and PID-files for the vnc-service? It does not work for me. I tried also with the gnome desktop. I always get the gray screen. I tried every solution from the first 5 pages of google and forums, still nothing. I only managed to change the x cursor to a normal curson, and manage to get a really sketchy lxde desktop interface. Does it have something to do with Xorg? Can you please help me? This worked great for me on Ubuntu 24.04 except that I needed one extra step to install a missing package: Please complete your information! Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation. Full documentation for every DigitalOcean product. The Wave has everything you need to know about building a business, from raising funding to marketing your product. Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter. New accounts only. By submitting your email you agree to our Privacy Policy Scale up as you grow — whether you're running one virtual machine or ten thousand. From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.