0

I used to be able to run: vncserver or vncserver :2 just from the command line as a normal user and then connect to this if the port is available.

This is useful if you temporarily need a functional graphical environment from your linux computer and don't necessarily have a local X server or a speady enough line.

This option seems gone now? I am unable to find anything in the Release Notes on the topic. So I'm basically wondering:

1: How can I run vnc as a normal user these days (without having to give him sudo and do system wide configuration)

2: Why was this taken away? Was this not a normal use case? I find it greatly adds flexibility that I have come to rely on.

Edit: To be perfectly clear, vncserver is gone. I'm wondering why and if there's still a way to run it ad-hoc as a normal user

0

If you look at the changes in the new version of tigervnc, you will see:

  • vncserver has gotten a major redesign to be compatible with modern distributions

Basically, they removed the vncserver wrapper around a vnc, and want you to use systemd to start vnc served sessions. See the howto included in the package. It involves editing some files in /etc and launching a systemd service per user.

Honestly, not an ideal setup.

1

The reason why starting vncserver as user may fail, is when the check for vncUserDir gets ran in the vncserver script. vncserver script itself does not need sudo to be simply executable from the path by any basic user.

The solution to the vncUserDir issue is to simply first create a .vnc directory in the user home directory beforehand like so.

cd $HOME
mkdir .vnc

and then run vncserver as that basic user:

vncserver

where you will now be greeted by a password prompt, followed by additional messages:


You will require a password to access your desktops.

Password:
Verify:
Would you like to enter a view-only password (y/n)? n

Starting applications specified in /etc/X11/Xvnc-session
Log file is /home/[$USER]/.vnc/[$HOSTNAME]:1.log
Use xtigervncviewer -SecurityTypes VncAuth -passwd /home/[$USER]/.vnc/passwd :1 to connect to the VNC server.

Mind that the VNC protocol by default is not encrypted and can be easily sniffed on and not only that the attacker can take over your connection. Please take precautions in case you're exposing your PC to the Internet, e.g. for instance you can route VNC via SSH port forwarding which will make it secure.

2
  • Maybe I wasn't clear. There is no vncserver in $PATH any more. I used to be able to run it just fine when it was. – Sirius Sep 28 '20 at 11:24
  • In the latest version of tigervnc, they removed the “vncserver” script, so this answer is incomplete unless it also shows how to get it back. – jsbillings Sep 29 '20 at 0:07

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.