LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 01-18-2024, 07:56 PM   #1
Dan Suson
Member
 
Registered: Aug 2007
Location: Valparaiso, IN
Distribution: Slackware
Posts: 100

Rep: Reputation: 7
Cannot use x11vnc with Slackware64 current


I am doing my annual upgrade and have installed the 12/21/2023 version of Slackware64 current, along with some packages from Ponce's SlackBuild repository and others that I have obtained directly. One of the SlackBuild packages that I install early in the process is x11vnc. This allows me to continue installing additional packages without having to be at my desk. Up to this installation, I've never had trouble with x11vnc. I modified /etc/ssh_config so that ForwardX11 yes is turned on, /etc/sshd_config so that it has
Code:
Match User XXXX
     X11Forwarding yes
     X11UseLocalhost yes
where XXXX is my userid, and restarted the ssh daemon. I'm able to forward X11 windows to a client machine if I log in via
Code:
ssh -Y mycomputerURL
but when I try to set up a VNC session via
Code:
ssh -Y -L 5900:localhost:5900 mycomputerURL 'x11vnc -localhost -display :0 -nopw -nodamage'
I get an error message telling me that
Code:
XOpenDisplay (":0") failed.
Trying again with XAUTHLOCALHOSTNAME=localhost ...
Authorization required, but no authorization protocol specified
This is the same command amd ssh structure that I was successfully using prior to the upgrade. Has something changed that I'm not aware of? I have a .Xauthority file on my client and host, so I'm not sure what the error message is referring to. Any help is appreciated.
 
Old 01-19-2024, 08:31 AM   #2
BrunoLafleur
Member
 
Registered: Apr 2020
Location: France
Distribution: Slackware
Posts: 412

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Code:
ssh -Y -L 5900:localhost:5900 mycomputerURL 'x11vnc -localhost -display :0 -nopw -nodamage'
The display is not ':0' but the one that is set by th '-Y' option of ssh. The DISPLAY env variable is set by ssh.

So something like :

> ssh -Y -L 5900:localhost:5900 mycomputerURL 'x11vnc -localhost -display \"$DISPLAY\" -nopw -nodamage'

For example to test without x11vnc :

> ssh -Y -L 5900:localhost:5900 localhost 'echo -localhost -display \"$DISPLAY\" -nopw -nodamage'
-localhost -display "localhost:10.0" -nopw -nodamage

Last edited by BrunoLafleur; 01-19-2024 at 08:33 AM.
 
Old 01-19-2024, 03:36 PM   #3
Dan Suson
Member
 
Registered: Aug 2007
Location: Valparaiso, IN
Distribution: Slackware
Posts: 100

Original Poster
Rep: Reputation: 7
@BrunoLafleur, thank you for the suggestion. I tried it but it did not work. The only change was that the error now says
[CODE]
XOpenDisplay(""localhost:10.0"") failed
[\CODE]
Any other ideas?
 
Old 01-19-2024, 04:20 PM   #4
lostintime
Member
 
Registered: Dec 2021
Posts: 209

Rep: Reputation: Disabled
Possibly not related and I don't know if this is a typo or copy/paste issue, but I think -nodamage should be -noxdamage.

When I moved from 14.2 to 15.0 and began using KDE, I had to add the -noxdamage option to my x11vnc autostart config:

Code:
Exec=x11vnc -noxdamage -nevershared -forever -no6 -noipv6 -rfbport 5900 -rfbportv6 -1 -o .x11vnc
I don't know if that helps.
 
Old 01-20-2024, 09:46 PM   #5
Dan Suson
Member
 
Registered: Aug 2007
Location: Valparaiso, IN
Distribution: Slackware
Posts: 100

Original Poster
Rep: Reputation: 7
@lostintime, I double checked what I've been doing. I'm using -noxdamage. Thanks for catching that, but it doesn't apply to my problem. Any other ideas?
 
Old 01-21-2024, 06:19 AM   #6
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762
Have you tried using tigervnc that Slackware provides in /extra?
I find it very straightforward if SSH with passwordless keys is already in place.
The -via option to vncviewer automatically uses a SSH tuunel.
If the client does not have X running, I log in via SSH and type 'at now +1 minutes<ENTER>startx<ENTER><CRTL-D>', then logout. Just need to wait for X to start on the client before attempting to connect.
 
Old 01-21-2024, 09:07 AM   #7
henca
Senior Member
 
Registered: Aug 2007
Location: Linköping, Sweden
Distribution: Slackware
Posts: 1,013

Rep: Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678Reputation: 678
Quote:
Originally Posted by allend View Post
I find it very straightforward if SSH with passwordless keys is already in place.
And if those keys are not already in place there are man pages for the rather simple commands:

ssh-keygen (to create the keys)
ssh-copy-id (to put the keys in place)

Example:
Code:
ssh-keygen -t ecdsa
ssh-copy-id the_server.in.my.net
regards Henrik
 
Old 01-21-2024, 12:47 PM   #8
Dan Suson
Member
 
Registered: Aug 2007
Location: Valparaiso, IN
Distribution: Slackware
Posts: 100

Original Poster
Rep: Reputation: 7
@allend, I typically use tigervnc to connect after the pipe is set up. I just tried to run vncviewer from the command line using
Code:
vncviewer -via myComputerURL
I get a connection refused error. Suggestions?
 
Old 01-21-2024, 02:33 PM   #9
lostintime
Member
 
Registered: Dec 2021
Posts: 209

Rep: Reputation: Disabled
Quote:
I'm using -noxdamage. Thanks for catching that, but it doesn't apply to my problem. Any other ideas?
You shared you were performing an "annual upgrade." Not explicitly mentioned is what version of Slackware or distro is being used on the local and remote systems.

You shared, "This is the same command and ssh structure that I was successfully using prior to the upgrade." What release was being used previously? For example, are both the local and remote system running Current? There have been several SSH changes. For example, with newer versions of SSH, direct support of some host key algorithms have been dropped. Connecting to remote older systems might require using SSH options such as HostkeyAlgorithms and PubkeyAcceptedKeyTypes.

You already verified basic SSH is functional. If this is a local network not traversing the internet (reduced security), I would verify basic VNC is functional without SSH overhead. Perhaps in two steps SSH into the system and manually launch x11vnc. Then connect with the VNC client. The idea is to verify VNC is functional without SSH. Something like:

Code:
ssh mycomputer
x11vnc -noxdamage -nevershared -forever -no6 -noipv6 -rfbport 5900 -rfbportv6 -1 -o .x11vnc
In the home LAN I use krdc and sometimes remmina on the client side.

On a tangent with respect to maintaining remote systems, I use SSH or SSHFS and key pairs. No VNC.

Sometimes I use VNC in the home LAN, but not for normal maintenance. Just SSH. Everything in the house is 1 Gbps, but even then I find working through VNC a tad frustrating because of nominal latency.

In the home LAN I enable SSH X forwarding, but I limit myself to tools like GUI text editors. For example, I would not try launching LibreOffice using SSH X forwarding.

Also in the home LAN, my normal user accounts autostart x11vnc. That way all I need is to launch the VNC client. But usually a home LAN has lax security and I need not bother with tunneling the VNC session. In the home LAN I run servers and headless VMs with no desktop environment and only use SSH.

Another tangential thought is perhaps rather than edit the system SSH config files, use $HOME/.ssh/config to configure the connections of various remote systems. In my little home LAN I have more than 30 different configurations. The user config file reduces connections to a simple command. For example, all I need type is ssh remotebox and everything is configured as needed for that specific system.

Probably not directly helping, but I hope something helps.
 
Old 01-22-2024, 07:18 AM   #10
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762
Quote:
Originally Posted by Dan Suson View Post
@allend, I typically use tigervnc to connect after the pipe is set up. I just tried to run vncviewer from the command line using
Code:
vncviewer -via myComputerURL
I get a connection refused error. Suggestions?
Try
Code:
vncviewer -SecurityTypes None -via myComputerURL localhost
Comments:
'-SecurityTypes None' turns off other security schemes as traffic is encrypted in a SSH tunnel.
'localhost' connects to port 5900 on the host where vncviewer is run.
'-via <gateway>' sets up SSH local forwarding of port 5900 to port 5900 on the gateway host by default.

PS - Just tested without problems after upgrading to the latest tigervnc-1.12.0
 
Old 01-28-2024, 05:41 PM   #11
Dan Suson
Member
 
Registered: Aug 2007
Location: Valparaiso, IN
Distribution: Slackware
Posts: 100

Original Poster
Rep: Reputation: 7
@lostintime, I tried some variations on your suggestion. When I tried
Code:
x11vnc -noxdamage -nevershared -forever -no6 -noipv6 -rfbport 5900 -rfbportv6 -1 -o .x11vnc
while logged on to my server (what I'm calling mycomputerURL), the log made it look like the session was set up, but I wasn't sure how to direct TigerVNC to connect from my laptop. The connection was working though, as when I used TigerVNC to connect while on the server I got a connection, which then caused a loop on the display which I finally broke by closing TigerVNC. So, I then tried
Code:
ssh -Y -L 5900:localhost:5900 mycomputerURL 'x11vnc -localhost -nopw -noxdamage -nevershared -forever -no6 -noipv6 -rfbport 5900 -rfbportv6 -1 -o .x11vnc'
from my laptop. The .x11vnc log had a Warning about using DISPLAY localhost:10.0. I didn't see an option in the TigerVNC GUI on my laptop that let me specify the display port, so I didn't go forward. Finally, I tried
Code:
ssh -Y -L 5900:localhost:5900 mycomputerURL 'x11vnc -localhost -display:0 -nopw -noxdamage -nevershared -forever -no6 -noipv6 -rfbport 5900 -rfbportv6 -1 -o .x11vnc'
from my laptop. Since I accidentally ran the -display command together, it again attempted to use DISPLAY localhost:10.0. Finally, when I corrected the display value by entering -display :0, the log reported that the attempt to connect failed
Code:
Authorization required, but no authorization protocol specified
XOpenDisplay(:"0") failed
I would be interested in trying the SSH options HostkeyAlgorithms and PubkeyAcceptedKeyTypes that you mentioned, but I'm not familiar with them. Would these go in ssh_config or sshd_config?

@allend, I tried
Code:
vncviewer -SecurityTypes None -via myComputerURL localhost
from my laptop. It gave me the error,
Code:
Failed to connect to "localhost::34793":
unable to connect to socket: Connection refused (111)
Any suggestions on how to proceed?

Last edited by Dan Suson; 01-28-2024 at 05:47 PM.
 
Old 01-28-2024, 10:38 PM   #12
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762
Do you have x0vncserver running in an X session on the host that you want to connect?
Code:
 x0vncserver -localhost -SecurityTypes None &
 
Old 01-29-2024, 04:17 PM   #13
Dan Suson
Member
 
Registered: Aug 2007
Location: Valparaiso, IN
Distribution: Slackware
Posts: 100

Original Poster
Rep: Reputation: 7
Okay, well that was interesting!

I did not have x0vncserver running on my remote host (never had to use this before), so I logged in, changed to root and started x0vncserver using the supplied command. Initially, all that I saw was
Code:
Mon Jan 29 15:57:02 2024
 Geometry:    Desktop geometry is set to 3840x1080+0+0

Mon Jan 29 15:57:03 2024
 XDesktop:    Using evdev codemap
 XDesktop:
 XDesktop:    XTest extension present - version 2.2
 Main:        Listening for VNC connections on local interface(s), port 5900
I opened up a local terminal and tried to connect using
Code:
vncviewer -SecurityTypes None -via myComputerURL localhost
This lead to the following output in the root terminal
Code:
Mon Jan 29 15:57:45 2024
 Connections: accepted: [::1]::34010

Mon Jan 29 15:57:46 2024
 SConnection: Client needs protocol version 3.8
 SConnection: Client requests security type None(1)
 XDesktop:    Enabling 8 buttons of X pointer device
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image

Mon Jan 29 15:57:57 2024
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image
 XDesktop:    Allocated basic Xlib image

Mon Jan 29 15:58:08 2024
 VNCSConnST:  Server default pixel format depth 24 (32bpp) little-endian rgb888

Mon Jan 29 15:58:44 2024
 Geometry:    Desktop geometry is set to 3840x1080+0+0

Mon Jan 29 15:58:45 2024
 Geometry:    Desktop geometry is set to 3840x1080+0+0
 Geometry:    Desktop geometry is set to 1600x900+0+0
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image

Mon Jan 29 15:58:48 2024
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image

Mon Jan 29 15:58:49 2024
 ComparingUpdateTracker: 12.4416 Mpixels in / 3.10558 Mpixels out
 ComparingUpdateTracker: (1:4.00621 ratio)
 Geometry:    Desktop geometry is set to 1600x900+0+0

Mon Jan 29 15:58:52 2024
 Geometry:    Desktop geometry is set to 1600x900+0+0
 Geometry:    Desktop geometry is set to 1024x768+0+0
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image

Mon Jan 29 15:58:54 2024
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image
 ComparingUpdateTracker: 0 pixels in / 0 pixels out
 ComparingUpdateTracker: (1:-nan ratio)
 Geometry:    Desktop geometry is set to 1024x768+0+0
root@mycomputerURL:~#
Mon Jan 29 15:58:56 2024
 Geometry:    Desktop geometry is set to 1024x768+0+0
 Geometry:    Desktop geometry is set to 800x600+0+0
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image

Mon Jan 29 15:58:57 2024
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image

Mon Jan 29 15:58:58 2024
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image
 ComparingUpdateTracker: 0 pixels in / 0 pixels out
 ComparingUpdateTracker: (1:-nan ratio)
 Geometry:    Desktop geometry is set to 800x600+0+0
root@mycomputerURL:~#
Mon Jan 29 15:59:00 2024
 Geometry:    Desktop geometry is set to 800x600+0+0
 Geometry:    Desktop geometry is set to 640x480+0+0
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image

Mon Jan 29 15:59:01 2024
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image
 Image:       XShmAttach() failed
 Image:       Failed to create SHM image, falling back to Xlib image
 ComparingUpdateTracker: 0 pixels in / 0 pixels out
 ComparingUpdateTracker: (1:-nan ratio)
 Geometry:    Desktop geometry is set to 640x480+0+0

Mon Jan 29 16:01:41 2024
 VNCSConnST:  closing [::1]::34010: Clean disconnection
 EncodeManager: Framebuffer updates: 304
 EncodeManager:   Tight:
 EncodeManager:     Solid: 73 rects, 498.885 kpixels
 EncodeManager:            1.14062 KiB (1:1709.26 ratio)
 EncodeManager:     Bitmap RLE: 81 rects, 7.688 kpixels
 EncodeManager:                 2.42383 KiB (1:12.7816 ratio)
 EncodeManager:     Indexed RLE: 520 rects, 318.177 kpixels
 EncodeManager:                  122.912 KiB (1:10.1615 ratio)
 EncodeManager:   Tight (JPEG):
 EncodeManager:     Full Colour: 502 rects, 3.08598 Mpixels
 EncodeManager:                  1.89953 MiB (1:6.20039 ratio)
 EncodeManager:   Total: 1.176 krects, 3.91073 Mpixels
 EncodeManager:          2.02304 MiB (1:7.38083 ratio)
After about 10 seconds, I had a window open that appeared to be the vnc session, but the screen was black and I couldn't navigate around it. Then the screen started to duplicate itself and continually downscale my resolution until I finally opened up a non-KDM session and killed the vncviewer session. This stopped the cascading vnc connection, but I had to restart my computer to get the video settings back to normal. So, I would say this was a partial success at best. I'm willing to pursue this line further, but I will eventually also like to know why I'm having to hop through these extra hoops that I never used before.
 
Old 01-29-2024, 11:45 PM   #14
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,383

Rep: Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762Reputation: 2762
The messages you are seeing seem to be related to this tigervnc issue.
You need to be starting the x0vncserver from within the GUI X session on the target host. I do this by adding the x0vncserver command to the GUI autostart.
 
Old 01-31-2024, 01:55 PM   #15
Dan Suson
Member
 
Registered: Aug 2007
Location: Valparaiso, IN
Distribution: Slackware
Posts: 100

Original Poster
Rep: Reputation: 7
Latest update:

As you (hopefully) know, if you have the cursor hovering over the wallpaper and start typing, a small window opens at the top of the screen to allow a command to be inputted into the GUI X session. I ran the x0vncserver command in that and then tried the vncviewer command while at work. The good news is that it worked and I saw my desktop on my server at home. The bad news is that I only saw one of the screens. I'm sure there is a way to see both screens (by scrolling back and forth in the viewer), but I didn't see anything on this when I did a quick look at the man page. Once I can get this fixed then all I will need to do is set things up to automatically start up x0vncserver when I log in to my kde session. As always, I'll keep folks informed!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware64-current v.s. Slackware64-live-current for installing onto main PC? naarter Slackware 21 06-16-2023 05:11 AM
[SOLVED] x11vnc not working on slackware current auth guess: failed for display='unset' mfoley Slackware 5 03-17-2021 09:29 AM
x11vnc error: Only root will have read permission for the file, and so x11vnc must be yogesh_attarde Linux - Software 7 09-23-2014 06:30 AM
upgrading slackware64 13.1 multilib to slackware64 -current multilib Cultist Slackware 4 03-12-2011 09:04 AM
Updating from Slackware64-current to Slackware64 13. glore2002 Slackware 4 08-28-2009 06:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration