getting VNC to work

Evening,

im having problems getting a working VNC server on my OS leap setup. I followed the very simple guide in the docs but to no avail. I suspect its something to do with graphics drivers but wanted to check I’d not missed something else before I consign the idea to the scrap heap.

Current set up is as follows;

enabled remote connections as per https://doc.opensuse.org/documentation/leap/reference/html/book.opensuse.reference/cha.vnc.html#sec.vnc.one-time.config including firewall config.
checked xinetd logs for visible connection attempts, output of the xinetd log is promising


16/6/24@22:48:22: START: vnc1 from=192.168.0.3
16/6/24@22:48:22: EXIT: vnc1 status=1 duration=0(sec)

as does xinetd status via “rcxinetd status”


matt@linux-3o78:~> sudo rcxinetd status
xinetd.service - Xinetd A Powerful Replacement For Inetd
   Loaded: loaded (/usr/lib/systemd/system/xinetd.service; enabled)
   Active: active (running) since Fri 2016-06-24 22:47:57 BST; 28s ago
 Main PID: 10318 (xinetd)
   CGroup: /system.slice/xinetd.service
           └─10318 /usr/sbin/xinetd -stayalive -dontfork


Jun 24 22:47:57 linux-3o78 xinetd[10318]: Reading included configuration file: /etc/xinetd.d/sane-port [file=/etc/xinetd.d/sane-port] [line=12]
Jun 24 22:47:57 linux-3o78 xinetd[10318]: Reading included configuration file: /etc/xinetd.d/servers [file=/etc/xinetd.d/servers] [line=14]
Jun 24 22:47:57 linux-3o78 xinetd[10318]: Reading included configuration file: /etc/xinetd.d/services [file=/etc/xinetd.d/services] [line=14]
Jun 24 22:47:57 linux-3o78 xinetd[10318]: Reading included configuration file: /etc/xinetd.d/svnserve [file=/etc/xinetd.d/svnserve] [line=14]
Jun 24 22:47:57 linux-3o78 xinetd[10318]: Reading included configuration file: /etc/xinetd.d/systat [file=/etc/xinetd.d/systat] [line=15]
Jun 24 22:47:57 linux-3o78 xinetd[10318]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=17]
Jun 24 22:47:57 linux-3o78 xinetd[10318]: Reading included configuration file: /etc/xinetd.d/time-udp [file=/etc/xinetd.d/time-udp] [line=15]
Jun 24 22:47:57 linux-3o78 xinetd[10318]: Reading included configuration file: /etc/xinetd.d/vnc [file=/etc/xinetd.d/vnc] [line=15]
Jun 24 22:47:57 linux-3o78 xinetd[10318]: xinetd Version 2.3.15 started with libwrap loadavg options compiled in.
Jun 24 22:47:57 linux-3o78 xinetd[10318]: Started working: 1 available service

but then my VLC client running on windows and android both fail to connect to my vlc session with the error “the session closed unexpectedly”

im guessing this is the Xvlc process then crashing out, but I dont know why. My /etc/xinetd.d/vnc file is,



service vnc1
{
        socket_type     = stream
        protocol        = tcp
        wait            = no
        user            = vnc
        server          = /usr/bin/Xvnc
        server_args     = -noreset -inetd -once -query localhost -geometry 1360x768 -x509key /etc/vnc/tls.key -x509cert /etc/vnc/tls.cert -InetdLogFile /home/matt/VNCLOG-$DISPLAYNUM-$USER.log -log *:syslog:30 -$
        type            = UNLISTED
        port            = 5901
}

i’ve tried to get the process to log to a local file for me so I can see whats going on, but so far nothing.
Any help would be appreciated.

I reviewed this documentation myself for this (VNC setup) not that long ago, and found no errors.

What command are you using to invoke the vncviewer client?
And, have you also tried invoking the java applet client?

At the moment I suspect something like not specifying the vnc configuration in your vnc client invocation.
As always, doublecheck the necessary firewall ports for the client you’re using are open.

TSU

VNC viewer is bVNC running on Android. Same problem occurs with VNCviewer on windows. Port scanning my opensuse machine shows port 5901 open as expected. however, as my previous log output form xinetd shows, the connection is closed after 0 seconds. Im guessing this is due to a failure of the Xvnc command in the background but I cant see any log output to diagnose whats going wrong.

Might be more difficult on an Android,
But at least on your Windows,
You should be able to launch your vncviewer from a console (ie. “Run… cmd” launches a console in Windows. Browse to or invoke the vncviewer with the necessary flags).
You should also try using the Java applet, should run using any modern web browser since Java is now integrated into all current web browsers and don’t require installing Java. Would be different if you tried this in a mobile device web browser.

The reason why I suggest you should launch from a console is because you then <know> exactly how you’re running vncviewer.
When you simply use the vncviewer gui forms and fill in info, you may not know if you’ve done it correctly and may be missing something.
You’ll also likely display a more informative error when launching from a console.

TSU

result is the same from all devices, connection tries then fails. trying a connection from localhost and vncviwer (tigervnc) produces this output;


matt@linux-3o78:~> vncviewer localhost:1


TigerVNC Viewer 64-bit v1.5.0
Built on: ??-??-?? ??:??
Copyright (C) 1999-2015 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.


Sun Jun 26 01:14:28 2016
 CConn:       connected to host localhost port 5901


Sun Jun 26 01:14:40 2016
 CConn:       End of stream


as though the Xvnc process is failing somewhere on the OS side. I’ve looked in system journal but no messages to note.

I’ve also tried starting a vncserver process manually, with command “vncserver” and all the same flags to Xvnc as in /etc/xinetd.d/vnc , except the -inetd

matt@linux-3o78:~> vncserver -noreset -once -query localhost -geometry 1360x768 -x509key /etc/vnc/tls.key -x509cert /etc/vnc/tls.cert -log *:stderr:100 -securitytypes none

when i try to connect to this from any of my viewers, including localhost vncviewer i get a connection asking for password followed by this error screen which im assuming is the login manager failing in the background.

https://ibin.co/w800/2lvzy1YQicAR.png

output from vncviewer during this session is


matt@linux-3o78:~> vncviewer localhost:2


TigerVNC Viewer 64-bit v1.5.0
Built on: ??-??-?? ??:??
Copyright (C) 1999-2015 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.


Sun Jun 26 01:27:10 2016
 CConn:       connected to host localhost port 5902
 CConnection: Server supports RFB protocol version 3.8
 CConnection: Using RFB protocol version 3.8
 CConnection: Choosing security type None(1)
 X11PixelBuffer: Using default colormap and visual, TrueColor, depth 24.
 CConn:       Using pixel format depth 24 (32bpp) little-endian rgb888
 CConn:       Using Tight encoding
 CConn:       Enabling continuous updates
matt@linux-3o78:~> 


vncserver output for this session is ;




Sun Jun 26 01:27:01 2016
 Config:      set SecurityTypes(String) to none


Xvnc TigerVNC 1.5.0 - built ??? ?? ???? ??:??:??
Copyright (C) 1999-2015 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11702000, The X.Org Foundation


 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on all interface(s), port 5902
 vncext:      Listening for HTTP connections on all interface(s), port 5802
 VNCServerST: creating single-threaded server linux-3o78:2 (matt)
 vncext:      created VNC server for screen 0


Sun Jun 26 01:27:10 2016
 Connections: accepted: ::1]::46178
 XserverDesktop: new client, sock 21
 SConnection: reading protocol version
 SConnection: Client needs protocol version 3.8
 SConnection: processing security type message
 SConnection: Client requests security type None(1)
 SConnection: processing security message
 VNCServerST: starting desktop
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888
 SConnection: reading client initialisation
 VNCSConnST:  non-shared connection - closing clients
 VNCSConnST:  Client pixel format depth 24 (32bpp) little-endian rgb888
 PixelBuffer: reallocating managed buffer (1360x768)


Sun Jun 26 01:27:15 2016
 Input:       keycode 50 down


Sun Jun 26 01:27:16 2016
 Input:       keycode 50 up


Sun Jun 26 01:27:52 2016
 XserverDesktop: client gone, sock 21
 Connections: closed: ::1]::46178 (Clean disconnection)
 EncodeManager: Framebuffer updates: 4
 EncodeManager:   Tight:
 EncodeManager:     Solid: 17 rects, 2.08154 Mpixels
 EncodeManager:            272 B (1:30611.6 ratio)
 EncodeManager:   Tight (JPEG):
 EncodeManager:     Full Colour: 10 rects, 83.966 kpixels
 EncodeManager:                  30.5342 KiB (1:10.7456 ratio)
 EncodeManager:   Total: 27 rects, 2.1655 Mpixels
 EncodeManager:          30.7998 KiB (1:274.655 ratio)
 VNCServerST: no authenticated clients - stopping desktop

so the package vncserver is able to run, but when launched from xinetd it does not work seemingly.

any thoughts?

Desktop? DM??

Desktop - gnome as available with opensuse (3.16.2)
DM - gdm as listed in sysconfig - desktop - display manager

Maybe try a different DM

I’m more interested in understanding what’s not working at present. I suppose my question are sno as follows;

Is xinetd launching Xvnc process in response to port 6901?
Where can I find detailed log/output from Xvnc server process to establish why it’s failing?

Thanks

I suspect you don’t have xorg-x11-server installed which would have been installed if you followed the documentation to install VNC server using the YaST applet “Remote Administration.” If you install VNC by simply selecting it in Software Management (or similar), then this important dependency isn’t guaranteed to be installed.

You can run the following to likely fix your immediate problem but if you do so, you will likely also need to open the firewall ports manually as needed. Re-run the YAST applet instead to automatically install and configure.

zypper in xorg-x11-server

When you install using YAST, check the boxes to “Allow remote administration” and to automatically open the firewall ports which will open the ports <only> for vnc display 1 (both vncviewer and the web java applet. If you want to enable the other 2 display configs or create new configs, you’ll have to manually open ports for those).

Also, note that when I suggest you try both vncviewer and the java applet, you should do so… in this case it was to test the likelihood of an error server-side or client-side and whether one or both of the two connection types might be faulty.

TSU

thanks for the reply TSU,
I had originally enabled as per the basic guide. xorg-x11-server is installed and has been through out.
I’ve tried http access as per your suggestion, java applet loads fine in browser (so firewall etc is working fine to my os machine) and the VNC session fails to connect;
https://ibin.co/2m8wUIs95YDz.jpg

when the firewall rules are created, im not certain but i believe port 58** and 59** are opened…

I tested this again by installing in a new LEAP, and although I’m seeing some display issues that should be another matter… Am connecting.

So, recommend…
Update your system

zypper up

“Disable” Remote Administration in YAST
YAST > Remote Administration > Disable
Reboot
YAST > Remote Administrtion > Enable

The above assumes you also accepted the YAST applet’s offer to open the Firewall ports on “all” interfaces.

If there is still no change after the above, then I recommend you do a force re-install of VNC and the x11 packages

zypper in -f xorg-x11-server vnc

And, re-boot.

If the above still doesn’t work, then
Post again the entire /etc/xinetd.d/vnc

cat /etc/xinetd.d/vnc

and your xinetd status

systemctl status xinetd.service

TSU

FYI -
This is what you want to see to verify a successful connection using vncviewer

vncviewer 10.88.88.129:1

TigerVNC Viewer 64-bit v1.4.1
Built on: ??-??-?? ??:??
Copyright (C) 1999-2014 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.

Wed Jun 29 10:03:46 2016
** CConn:       connected to host 10.88.88.129 port 5901**

Wed Jun 29 10:03:47 2016
 CConnection: Server supports RFB protocol version 3.8
 CConnection: Using RFB protocol version 3.8
 CConnection: Choosing security type None(1)
 X11PixelBuffer: Using default colormap and visual, TrueColor, depth 24.
 CConn:       Using pixel format depth 24 (32bpp) little-endian rgb888
 CConn:       Using Tight encoding
 CConn:       Enabling continuous updates
 X11PixelBuffer: Using default colormap and visual, TrueColor, depth 24.

TSU

Just a thought…
I’ve been focusing on what I think is your real problem which is network connectivity,

Although I had attached a lower possibility, you should also post what Display Manager you are using.

You can not only see what Display Manager is being used, you can also switch to something else by inspecting

YAST > /etc/sysconfig editor > Desktop > Display Manager

A number of Display Managers including sddm and lxdm do not support xserver which VNC requires, so you can try something else (lxdm is often recommended).

TSU

Hi matt_kbf](https://forums.opensuse.org/member.php/98832-matt_kbf)

I had the exact same problem, I spent the last 2 weeks trying to solve this, so that I can remote from my Laptop in the garden to my LEAP 42.1 PC.
Finally what worked for me was:

First I had a error message from my browser trying to connect to my LEAP 42.1 PC’s IP, Port 5801: I got this error in my browser „no matching security types“ I found a fix for that after googling around a bit:
The default settings on my vanilla LEAP 42.1 installation were wrong in the YAST > xinetd settings .
I had to correct them to :
service vnchttpd1
{
socket_type = stream
protocol = tcp
wait = no
user = vnc
server = /usr/bin/vnc_inetd_httpd
server_args = 1024 768 5901 -securitytypes **X509None **
type = UNLISTED
port = 5801

and

service vnc1
{
socket_type = stream
protocol = tcp
wait = no
user = vnc
server = /usr/bin/Xvnc
server_args = -noreset -inetd -once -query localhost -geometry
1024x768 -x509key /etc/vnc/tls.key -x509cert /etc/vnc/tls.cert -log *:syslog:30
-securitytypes **X509None **
type = UNLISTED
port = 5901

Then at least I got connected , but to a black screen.
After that had to install another window manager in YAST : kdm
But this was just half of the fix, I got now connected to a black screen.

After changing the display manager in YAST under /etc/sysconfig- editor , I changed it from sddm to kdm and then I got the login prompt.
But after login, I got as well the “stream ended” message and had no remote desktop presented.
The trick was, to look thru all the settings in YAST under /etc/sysconfig editor , under Desktop > Displaymanager there were 2 DISPLAYMANAGER entries :

The first one I changed from sddm to kdm , the second one I blanked out.
After restarting, I was able to connect via browser to the LEAP 42.1 PCs IP: Port 5801 no problem!

Hope this helps someone.
All the best

Sorry to break in on this, but as per my thread (https://forums.opensuse.org/showthread.php/519098-Remote-administration), I am also having issues with this…
Just wondering, above you are force installing “vnc”, but my system can’t even find that package…
Any clues to what the basic vnc package should be?
Thanks.

The default vnc package openSUSE installs today is tightvnc, try that.

TSU

FYI - I’ve posted a “cookbook” for setting up VNC (on any currently supported openSUSE) at this other similar, concurrently running Forum thread

https://forums.opensuse.org/showthread.php/519098-Remote-administration?p=2787001#post2787001

TSU