how to setup tigerVNC allows same user uses different ports

Issues related to applications and software problems and general support
Post Reply
terence.tang
Posts: 5
Joined: 2016/04/21 02:18:55

how to setup tigerVNC allows same user uses different ports

Post by terence.tang » 2022/05/21 15:16:34

i found i can only use different user for different port.
for,example:
1:=root
2:=user1
3:=user2

I want many vnc sessions but don't want create too many OS users.
so why i can't use
1:=user1
2:=user1
3:=user1

on 6.x, i can do it on vncserver. whatever use xinetd + vncserver, or setup vncserver configuration .

but i can't do it on 8.x

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to setup tigerVNC allows same user uses different ports

Post by TrevorH » 2022/05/21 16:18:45

What happened when you tried and what did your unit files look like?
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

terence.tang
Posts: 5
Joined: 2016/04/21 02:18:55

Re: how to setup tigerVNC allows same user uses different ports

Post by terence.tang » 2022/05/22 00:57:43

My systemd service file is same as original file.

for example:
1. vncserver@:1.service & vncserver@:2.service are same as below

[Unit]
Description=Remote desktop service (VNC)
After=syslog.target network.target

[Service]
Type=forking
ExecStartPre=+/usr/libexec/vncsession-restore %i
ExecStart=/usr/libexec/vncsession-start %i
PIDFile=/run/vncsession-%i.pid
SELinuxContext=system_u:system_r:vnc_session_t:s0

[Install]
WantedBy=multi-user.target

2. the /etc/tigervnc/vncserver.users are
1:cam
2:cam

3. Disable firewall & selinux, then systemctrl start vncserver@:1; systemctl start vncserver@:2
no any error message, but
:1 is OK.
:2 status is dead.

The systemctl status of vncserver@:2 is as below:
● vncserver@:2.service - Remote desktop service (VNC)
Loaded: loaded (/usr/lib/systemd/system/vncserver@:2.service; disabled; vendor preset: disabled)
Active: inactive (dead)
5月 22 08:56:11 192.168.147.129 systemd[1]: Starting Remote desktop service (VNC)...
5月 22 08:56:11 192.168.147.129 systemd[1]: Started Remote desktop service (VNC).
5月 22 08:56:11 192.168.147.129 systemd[1]: vncserver@:5.service: Succeeded.

4. if I added a new user: cam1, then change vncserver.users to:
1:cam
2:cam1

then :2 is OK.

BTW, my vncserver-config-defaults is as below:
session=xfce4
securitytypes=vncauth,tlsvnc
geometry=1920x1200
alwaysshared

and the :2.log is as below:

......
Sun May 22 09:35:03 2022
vncext: VNC extension running!
vncext: Listening for VNC connections on all interface(s), port 5905
vncext: created VNC server for screen 0
xinit: XFree86_VT property unexpectedly has 0 items instead of 1
xinit: connection to X server lost ### this is the key error message and was different with the :1.

waiting for X server to shut down ComparingUpdateTracker: 0 pixels in / 0 pixels out
ComparingUpdateTracker: (1:-nan ratio)

User avatar
TrevorH
Site Admin
Posts: 33202
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: how to setup tigerVNC allows same user uses different ports

Post by TrevorH » 2022/05/22 01:59:51

3. Disable firewall & selinux, then systemctrl start vncserver@:1; systemctl start vncserver@:2
Please don't. If you must then just do setenforce 0 to go permissive where everything is allowed but logs are created so that you can use them to actually fix the problem, not just ignore it. Now you have to do special things to re-enable it.

It's not selinux anyway, at the worst you just need to restorecon -RFv /home/$USER/.vnc to assign the correct contexts to the directory so that it can create the log files there.

I tried to get this to work on Rocky 8 and I have it so that either vncserver@:1 can start or :2 can start if they are started by systemd. The other one fails with no explanation. If I run the command that systemd would have run to start it but outside of systemd, then it starts. If I then start it from systemd it "sees" the running one and goes "oh, wait, it did work" and it shows as active too. I do not know what it is that is stopping it from starting the 2nd session but I think it is either systemd or something that systemd is setting prior to invoking /usr/libexec/vncsession-start. I tried adding a log line in /usr/libexec/vncsession-start to see if it reached the final one where it execs vncsession but it does and it looks fine. It is some internal check after that that fails.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

terence.tang
Posts: 5
Joined: 2016/04/21 02:18:55

Re: how to setup tigerVNC allows same user uses different ports

Post by terence.tang » 2022/05/22 07:41:44

Hi TrevorH , thanks for the kindly reply!.
I gave up, :).
I found it should be tigervnc limitation after I checked github tigervnc project. There was similar report and some guy said
the new tignervnc doesn't support multiple sessions with same user.
I'm not sure if the latest one resolved it or not. but from my experience, it's a regression. vncserver on CentOS 6.x has no such limitation.

I found the solution: use turbovnc instead of tigervnc, it works as my expectation.

Post Reply