After following the tutorial (https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-22-04), I reached Step 4, ‘Running VNC as a System Service’. However, I encountered an issue while trying to start the VNC function. Using the command ‘ps -x’, I noticed that the TightVNC service was already running. Despite this, I received an error message when attempting to VNC, stating ‘target machine actively refused it’. To resolve this, I manually terminated the TightVNC service using the command ‘vncserver -kill :1’, and then restarted it with ‘vncserver’. This allowed me to successfully use the VNC function.
However, I find it inconvenient that I have to repeat this step after rebooting the PC every time. Could someone please assist with this issue? It’s proven to be quite troublesome.
I’m using Ubuntu Server 22.04."
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!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
When you enable the service it will start on boot and when you try to start it again it will fail to do so since the service is already running.
By setting up the VNC server to run as a
systemd
service you can start, stop, and restart it as needed, like any other service.When the the VNC is configured as
systemd
service it will be ready to use whenever your server boots up, and you can manage it withsystemctl
commands like any other systemd service.Hope that this helps!