VNCserver vs VNCmanager persistant

Hello there,
As seen in this guide, there are 2 different persistent VNC server sessions:

  1. VNC Session Initiated Using vncserver
  2. VNC Session Initiated Using vncmanager

I can’t figure out what is the difference, in the guide, I find the explanation of vncserver not clear to me and there is no comment on the vncmanager.

My use-case is:
I have a local desktop that I switch on/off every day running Opensuse 15.2 Mate DE.
I have a remote (in another room) laptop running Opensuse 15.2 Mate DE always on. Applications are running on and sometime I go to this laptop and work with it.
Both are connected on the local LAN.
I want to have access to the laptop DE from the desktop in the current running DE to control, start, stop, manage the running applications and use the DE as if I am in front of the laptop. When I disconnect the running applications should carry on.

Could you let me know what I can do and can’t with both of type?
Many thanks

vncserver cannot do it - it starts separate X server so you cannot share what is running on your local X server. You may try x0vncserver for it - see e.g. https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sec-vnc-sharing-an-existing-desktop.

Thank you for your answer

I did what is in the link you provided in the laptop (remote):

  • Tigervnc was installed
  • Set password
  • run x0vncserver…
    From the desktop (local) I start Tigervnc viewer and tried to connect with ip address (or ip address:0).
    I get the error message: unable to connect to socket: “Connection refused (111)” with both firewalld service Inactive
    Then from the desktop (local) I start Vinagre and tried to connect with Protocol VNC and ip address (or ip address:0).
    I get the error message: “Connection closed” even with both firewalld service Inactive

How to debug?

That’s SLES documentation describing methods not recommended for openSUSE

Unless something has changed, IIRC vncmanager is not mentioned as a recommended configuration but if you look at various tigervnc documentation, vncmanager is still a prominent described method (There are at least a few other methods described in various “official” documentation)

Here is the LEAP documentation for both persistent and “one time” connections

https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha-vnc.html

TSU

IIRC you can also find even better documentation in an ArchWiki article but is not recommended mainly for performance.reasons.
And,
The LEAP documentation describes configuration that’s supported by Wayland which now does not require an X server application to support remote connections… Today, VNC can be supported through network sockets instead.

See my other post that provides a link to LEAP documentation for the methods recommended by openSUSE although of course a great many other configurations can be made to work.

TSU

Thank you TSU but I am puzzled about my question in my first post. The link you provide is the same I provided in my first post.
Is it possible to share the existing X server displayed on the remote computer?
What type of persistent session I should choose, vncserver or vncmanager? What are the differences?

Although the links aren’t the same,
I can see that the content is for all practical purposes the same.

The main difference is that for the “vncserver” method a session has to be initiated on the Server, then clients are allowed to join the session. It’s also managed by command line.
When you use the “vncmanager” method, you configure how the parameters of vnc sessions are set up but they aren’t yet invoked… A client can invoke a first session subject to the configuration you set up beforehand in vncmanager(YaST) and then others can join. In the case of a persistent session, when a person authorized to terminate the session does so, only then the session is terminated.

Although it’s likely you won’t see any difference in the content this time, I’d advise using my link which points to the LEAP documentation for anything you want guidance instead of the SLES link you’re using… At some point, you might or eventually run into something that will be different.

TSU

As usual. Check whether x0vncserver is running at all. Check what port it is listening on. Check whether you can connect to this port without using VNC client. Verify that VNC client actually connects to the port x0vncserver is listening on. Read logs …

I did quick test and x0vncserver works in Leap 15.1 when started from within local X11 session in terminal and I get remote access to full local X11 session.

Oh, and of course your DE which you want to access should be running under X11 and not Wayland. I am not sure what happens in Wayland - at most you can get access to whatever is running under Xwayland, but even this may be blocked by Wayland security policy.

Unfortunately this is not as usual for me! :frowning:

I followed the guide to set vncmanager with session management then tried with tigerVNC Viewer and Vinagre. No luck
I tied to debug with

sudo lsof -i -P -n | grep LISTEN
[sudo] password for root: 
...
sshd      1075  root    3u  IPv4  22676      0t0  TCP *:22 (LISTEN)
sshd      1075  root    4u  IPv6  22682      0t0  TCP *:22 (LISTEN)
master    1736  root   13u  IPv4  25862      0t0  TCP 127.0.0.1:25 (LISTEN)
master    1736  root   14u  IPv6  25863      0t0  TCP ::1]:25 (LISTEN)
vncmanage 5229   vnc    5u  IPv4 114446      0t0  TCP *:5901 (LISTEN)
vncmanage 5229   vnc    6u  IPv6 114447      0t0  TCP *:5901 (LISTEN)
transmiss 6096    jp   16u  IPv4 159605      0t0  TCP *:51413 (LISTEN)
transmiss 6096    jp   17u  IPv6 159607      0t0  TCP *:51413 (LISTEN)


I see that the listening port is 5901 -> display :1. I understand this is not the running display I use in front of the remote laptop.I tried the viewers with display:0. Not working, still the same error.
Question: Can I use vncmanager to get access to the display:0 in the remote laptop?

Edit: I tried the viewers with display:1. Not working, still the same error.

Normally Display :0 is reserved for the locally logged in User at keyboard, so wouldn’t be available to a remotely logged in User for initiating a session.

I hadn’t thought about how vncmanager stores its configurations and I wasn’t able to locate any documentation.
One guy posted a decent post elsewhere asking for information but didn’t get a response
https://unix.stackexchange.com/questions/546313/is-there-a-way-how-to-persist-vncmanager-settings-for-user

I suspect that the configuration might be stored in multiple places and/or written to the Display Manager’s configuration file which could possibly be reason for lack of documentation since what actually happens could depend on a machine’s unique setup(but IMO should still be publicly documented). If that doesn’t work, I guess it’s worth looking up the YaST module source and inspecting it.

A recommended try is to open a console displaying system events while you set up VNC in YaST… If something is written somewhere, maybe it’ll be captured in the console

journalctl -f

TSU

Was this feature working in a previous version? See here
In fact I have 2 separate issues:
1 - I don’t know what program to use to share the desktop (DISPLAY:0)
2 - I can’t connect to the remote laptop using another display like DISPLAY:1

Point 2:
From remote laptop I set as in 4.3 Configuring One-time Sessions on the VNC Server then logout, login

sudo lsof -i -P -n | grep LISTEN
[sudo] password for root: 
systemd       1  root   33u  IPv6 769797      0t0  TCP *:5901 (LISTEN)
cupsd       735  root    6u  IPv6  21032      0t0  TCP ::1]:631 (LISTEN)
...

From local desktop

vncviewer 192.168.1.115

TigerVNC Viewer 64-bit v1.9.0
Copyright (C) 1999-2018 TigerVNC Team and many others (see README.rst)
See http://www.tigervnc.org for information on TigerVNC.
No protocol specified

Tue Mar 17 17:59:35 2020
 DecodeManager: Detected 8 CPU core(s)
 DecodeManager: Creating 4 decoder thread(s)
 CConn:       unable connect to socket: Connection refused (111)

nc -zv 192.168.1.115 5900-5905
nc: connect to 192.168.1.115 port 5900 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5901 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5902 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5903 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5904 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5905 (tcp) failed: Connection refused

sudo traceroute is ok

What I should do to fix it?

How is it related to x0vncserver?

I see that the listening port is 5901 -> display :1. I understand this is not the running display I use in front of the remote laptop.

VNC “display” port number has absolutely nothing to do with X11 DISPLAY. 5901 is simply TCP port number used to communicate with client. You can chose any port number, it does not matter. Nor do local applications use port 5901 to communicate with X server.

Question: Can I use vncmanager to get access to the display:0 in the remote laptop?

No. You already asked this and I already answered this.

](https://www.techotopia.com/index.php/Remote_Access_to_the_openSUSE_Linux_Desktop)
This article is specific to KDE. It is using krfb program that does exactly the same as x0vncserver.

1 - I don’t know what program to use to share the desktop (DISPLAY:0)

You do (ar least, you have been told it). You are free to ignore this of course.

What I should do to fix it?

Fix what? You show some random command output without explaining what you did, what result you expected to achieve and why you think command output does not match this result.

Once more. Your local desktop runs under X11 server (I presume, you still did not answer whether this assumption is correct). You have no way to connect to this X11 server using VNC viewer, because X11 server does not speak VNC protocol. You must use some gateway program which on one side communicates with your local X11 server and on another side exports content of local X11 server display via VNC protocol. Such program may be krfb (like in article you mention), x0vncserver or some other similar programs. When you start this program you must tell it which local X11 DISPLAY to use - and it must not be :0 (but probably is in your case) and you must tell it which TCP port number to listen on for VNC viewers. This may be 5900 but may also be any other port number. Read documentation of program you intend to use how to configure it.

Sorry arvidjaar for the mix-up. TSU2 provided a link with programs I should use, vncserver or vncmanager nothing about x0vncserver in this page. I was thinking vncmanager could work for my usecase.
Thanks to you explanation I understand now neither can work but x0vncserver.

In the link above “Remote Graphical Sessions with VNC”, one can read

vncserver uses the ports 5901 for display :1, 5902 for display :2, and so on.
I understand this is not bonded but only a way this program choose the port.

Now I’ll start over with x0vncserver.

I hope that is cleared up…
x0vncserver stands on its own.
Both vncserver and vncmanager implement Xvnc which is different and incompatible with x0vncserver.

So,
You do need to decide what you want to set up and stick with that.
And BTW - Your recent post also described setting up One-time sessions which is another variation which can confuse what you’re setting up… Although vncmanager supports both types of configurations (one time and persistent), I don’t recommend doing both if you’re already confused, you’re just complicating what you’re not understanding.

As for the relationship between displays and network ports…
You’d have to read the original TigerVNC documentation (I’m working on my own documentation re-work that covers things like this) to discover that there is no fixed configuration that links a specific port to a specific display number but without an explicit setting TigerVNC will try to comply with the idea Users will assume there is a relationship and configure accordingly.

In fact,
If you want to skim a very early draft of my VNC documentation-in-progress, you might find it covers some ground you won’t find in the openSUSE documentation but may or may not be useful. If you read it and find it’s only more confusing, try to forget what you read… Or, don’t finish reading it isn’t helpful early
I even cover that Display vs port number in my draft.
Or, if you’re going to concentrate on x0vncserver, don’t read it because down near the bottom I’ll even explicitly say that nothing on the page applies to it but builds on current recommended setups which in general all use Xvnc instead of x0vncserver.

https://en.opensuse.org/User:Tsu2/remote_administration_VNC

TSU

After refreshing my own memory what I wrote in my rough draft documentation,
I’d encourage the @OP and everyone else interested in getting VNC to work to read what I wrote…
Although recent,
There’s a lot there that can be very important for anyone setting up VNC.

And, there is stuff in there that might provide sufficient understanding to address problems described in this thread…

https://en.opensuse.org/User:Tsu2/remote_administration_VNC

I gotta find some time to put some polish on this and make it more “official” but the raw information and even how it reads now is important…

TSU

Your recent post also described setting up One-time sessions which is another variation which can confuse what you’re setting up…

I tried that because I had 2 issues:

  • Choice of program
  • Connection to the remote
    This was to try solving the connection issue. I feel that I’ll have the connection issue as well with x0vncserver.

The choice of program issue is solved now: x0vncserver

May I write here my feeling as a newbie, novice like me.

As I wrote in my first post, due to my ignorance or my bad English language (I am not native) I could not understand what the different programs can provide or not.
Newbies like I need to fulfil a use-case and try to find the corresponding program for that. In all the documents I have read none have a clear presentation in term of user need.
Thanks to you both, I learned a lot in this forum.
It could be very interesting to have a concise document that list the programs and describe what they do, what they don’t, in usage, security, platform, etc and add some use-cases. After reading that the newbie will read the full, detailed documentation of the appropriate program.

For example, I tried X over ssh, was working fine. Before that I didn’t know that only the program I started on the remote computer from the local will be in its own tiny graphical window (ie: xeyes in the howto I used). Thankfully it was straight to set it up and run it. But in fact I don’t know if I could start another program like the full Desktop Environment.

Maybe this document is in the Internet but I didn’t find it, but if my trouble is due to my English understanding, please let me know, I’ll avoid to bother you.

Now I start over with x0vncserver only.

I appreciate your involvement. Thanks

Now x0vncserver is running on the remote laptop.
From local through ssh to remote:

sudo lsof -i -P -n | grep LISTEN
[sudo] password for root: 
...
x0vncserv 4358    jp    4u  IPv4 115494      0t0  TCP *:5900 (LISTEN)
x0vncserv 4358    jp    5u  IPv6 115495      0t0  TCP *:5900 (LISTEN)
...
ss -tunlp4
tcp   LISTEN     0      5                           0.0.0.0:5900                                    0.0.0.0:*                   users:(("x0vncserver",pid=4358,fd=4))

Good!

From local desktop

sudo traceroute 192.168.1.115
[sudo] password for root: 
traceroute to 192.168.1.115 (192.168.1.115), 30 hops max, 60 byte packets
 1  laptop.domain.org (192.168.1.115)  0.249 ms  0.262 ms  0.872 ms

But I cant connect with tigervnc viewer

vncviewer 192.168.1.115

TigerVNC Viewer 64-bit v1.9.0
Copyright (C) 1999-2018 TigerVNC Team and many others (see README.rst)
See http://www.tigervnc.org for information on TigerVNC.
No protocol specified

Wed Mar 18 14:04:09 2020
 DecodeManager: Detected 8 CPU core(s)
 DecodeManager: Creating 4 decoder thread(s)
 CConn:       unable connect to socket: Connection refused (111)

Can I reach with another program?

nc -zv 192.168.1.115 5900-5905
nc: connect to 192.168.1.115 port 5900 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5901 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5902 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5903 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5904 (tcp) failed: Connection refused
nc: connect to 192.168.1.115 port 5905 (tcp) failed: Connection refused

telnet 192.168.1.115 5900
Trying 192.168.1.115...
telnet: connect to address 192.168.1.115: Connection refused

I tried to look at the Ethernet trafic with Wireshark. When I send a telnet command from local I get a TCP packet from source local to destination remote computer. The a TCP answer from remote to local.

9    9.472827143    192.168.1.110    192.168.1.115    TCP    74    43920 → 5900 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=3805077991 TSecr=0 WS=128
10    9.473052701    192.168.1.115    192.168.1.110    TCP    60    5900 → 43920 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0

When I try to connect with tigervnc viewer

20    0.946954641    192.168.1.110    192.168.1.115    TCP    74    43964 → 5900 [SYN] Seq=0 Win=29200 Len=0 MSS=1460 SACK_PERM=1 TSval=3805468957 TSecr=0 WS=128
21    0.947158981    192.168.1.115    192.168.1.110    TCP    60    5900 → 43964 [RST, ACK] Seq=1 Ack=1 Win=0 Len=0

I see that the commands go to the destination and the remote answer. I am stick at this point.
I’d guess you have more to say with that info.

Sounds like firewall is active on your x0vncserver sytem.

Unfortunately both local and remote (with ssh, yes I can ssh the remote laptop from where I want to see the desktop remotely)

firewall-cmd --state
not running

Moreover I have another desktop with the same OS Opensuse 15.1. Same install, same config, same issue.