I have TightVNC installed and working on my Ubuntu 18.4 virtual server, following this guide. It says to use nano and create a 'unit' file called /etc/systemd/system/vncserver@.service. It then specifies the contents of the file, and I have checked and double-checked, but when I try and start the service with:

systemctl start vncserver@1 

I get an error that says:

Job for failed because the control process exited with error code. 

Then I run:

systemctl status 

and I get this output:

● - Start TightVNC server at startup Loaded: loaded (/etc/systemd/system/vncserver@.service; indirect; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2020-08-28 19:13:08 UTC; 12h ago Aug 28 19:13:08 BradysApp systemd[1]: Starting Start TightVNC server at startup... Aug 28 19:13:08 BradysApp vncserver[1232]: Can't find file /home/brady/.vnc/BradysApp:1.pid Aug 28 19:13:08 BradysApp vncserver[1232]: You'll have to kill the Xtightvnc process manually Aug 28 19:13:08 BradysApp systemd[1]: : Control process exited, code=exited status=2 Aug 28 19:13:08 BradysApp systemd[1]: : Failed with result 'exit-code'. Aug 28 19:13:08 BradysApp systemd[1]: Failed to start Start TightVNC server at startup. 

My unit file looks like this:

[Unit] Description=Start TightVNC server at startup After=syslog.target network.target [Service] Type=forking User=brady Group=brady WorkingDirectory=/home/brady PIDFile=/home/brady/.vnc/%H:%i.pid ExecStartPre=/usr/bin/vncserver -kill :%i > /dev/null 2>&1 ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%i ExecStop=/usr/bin/vncserver -kill :%i [Install] WantedBy=multi-user.target 

The user brady is my non-root user and works just fine, so that isn't the problem.

Any ideas or suggestions as to what might be wrong? I am a total Linux novice, working on a Digital Ocean VPS's web-based terminal.

10

2 Answers

Based on discussions in comments and chat, the issue was resolved by re-running the setup procedure after the addition of the user whose desktop was to be shared.

The Group parameter should be set to the group in your system. It's not the same as your username in general. You may use ll (an alias for the ls -l command) to check what group should be set to.

Group should be set to users in the example below:

-rw------- 1 awen users 406 Sep 26 07:15 .Xauthority -rw-r--r-- 1 awen users 1600 Apr 9 2020 .Xdefaults -rw-r--r-- 1 awen users 80 Sep 23 10:22 .bash_aliases -rw------- 1 awen users 8440 Sep 26 07:23 .bash_history 

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy