How to Copy Paste in VNC Viewer (Ubuntu TightVNC)

We previously created a tutorial on installing VNC Server on Ubuntu Server 24. This follow-up article explains how to enable shared clipboards between the client and server, allowing you to copy and paste using VNC Viewer.

The first thing you need to do is install the autocutsel package:

sudo apt install autocutsel

After that, add the line autocutsel -fork before startxfce4 & in the xstartup file:

autocutsel -fork

Here's how the xstartup file will look:

#!/bin/sh
unset SESSION_MANAGER
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
autocutsel -fork
startxfce4 &

After updating the xstartup file, make sure to restart the VNC server. That’s it!