LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-06-2020, 02:00 PM   #1
MichRX7
LQ Newbie
 
Registered: Feb 2020
Posts: 8

Rep: Reputation: Disabled
x11vnc on Debian problems, can't get it to allow connections


Hello, very newbie here and have gotten the newest build of Debian on an old dell laptop I had sitting around, but now trying to remote into it graphically using TightVNC on my windows PC and can't get it to work.

I have installed x11VNC, and every time I try to run it from the GUI I get "The x11vnc program failed to start! Maybe there is another VNC server already listening on port 5900? You will need to start over after you make sure x11vnc can start."

Ok, so how do I check? In the GUI I can open Task Manager, but I don't see any other VNC servers running in there. From the terminal I opened port 5900.

I've tried reading from about 1,000 websites that all tell me how easy this should be, except it isn't. Can anyone help?
 
Old 02-06-2020, 08:02 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
My educated guess is that by default debian 10 uses Wayland which x11vnc is known not to work.

Try disabling Wayland by uncommenting WaylandEnable=false in your /etc/gdm3/custom.conf file.
 
Old 02-07-2020, 07:54 AM   #3
MichRX7
LQ Newbie
 
Registered: Feb 2020
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
My educated guess is that by default debian 10 uses Wayland which x11vnc is known not to work.

Try disabling Wayland by uncommenting WaylandEnable=false in your /etc/gdm3/custom.conf file.
Thank you for the reply. So I went to do that... But, I cd /etc/gdm3/ and do a dir -ls and there is no custom.conf file. Should I just create one and add that line?

Here is the list of files in that dir:
daemon.conf
greeter.dconf-defaults
Init
PostLogin
PostSession
PreSession
Xsession
 
Old 02-07-2020, 08:41 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Sorry for the bad info.

The file you want to edit is daemon.conf
 
Old 02-07-2020, 09:42 AM   #5
MichRX7
LQ Newbie
 
Registered: Feb 2020
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Sorry for the bad info.

The file you want to edit is daemon.conf
Ok, I edited that file, saved and rebooted.

I then open a ssh connection from my pc and sign-in, then login as root and run
x11vnc -find

Here is the output (minus all the comments it displays):
07/02/2020 10:39:21 x11vnc version: 0.9.13 lastmod: 2011-08-10 pid: 8479
07/02/2020 10:39:21
07/02/2020 10:39:21 wait_for_client: WAIT:cmd=FINDDISPLAY
07/02/2020 10:39:21
07/02/2020 10:39:21 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/2560
07/02/2020 10:39:21
07/02/2020 10:39:21 Autoprobing TCP port
07/02/2020 10:39:21 Autoprobing selected TCP port 5900
07/02/2020 10:39:21 Autoprobing TCP6 port
07/02/2020 10:39:21 Autoprobing selected TCP6 port 5900
07/02/2020 10:39:21 listen6: bind: Address already in use
07/02/2020 10:39:21 Not listening on IPv6 interface.
07/02/2020 10:39:21

So, how do I tell what is in use on 5900? There shouldn't be anything in use on that port.
 
Old 02-07-2020, 10:43 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Look at the output of the command ( as root )
netstat -tunlp
 
Old 02-07-2020, 11:17 AM   #7
MichRX7
LQ Newbie
 
Registered: Feb 2020
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Look at the output of the command ( as root )
netstat -tunlp
I must be missing a path statement or something. When I try and run netstat it tells me command not found. But if I do a find -iname netstat* from my root directory it finds a lot of them.
 
Old 02-07-2020, 11:30 AM   #8
MichRX7
LQ Newbie
 
Registered: Feb 2020
Posts: 8

Original Poster
Rep: Reputation: Disabled
Ok, not sure the netstat will even tell us anything. I did ss and didn't see anything using 5900, could be an IPv6 thing, but it does run if I use the -find command as in x11vnc -find

But, when I connect to it (attempt to connect) with TightVNC on my other machine the Linux box spits this out on the terminal:
The VNC desktop is: linux:0
PORT=5900
07/02/2020 12:25:11 Got connection from client 192.168.1.141
07/02/2020 12:25:11 other clients:
07/02/2020 12:25:12 Normal socket connection
07/02/2020 12:25:12 incr accepted_client=1 for 192.168.1.141:57656 sock=5
07/02/2020 12:25:12 wait_for_client: got client
07/02/2020 12:25:12 Client Protocol Version 3.8
07/02/2020 12:25:12 Protocol version sent 3.8, using 3.8
07/02/2020 12:25:12 client progressed=1 in 4/7 0.004842 s
07/02/2020 12:25:12 client useCopyRect: 192.168.1.141 0
07/02/2020 12:25:12 client_set_net: 192.168.1.141 0.0160
07/02/2020 12:25:12 wait_for_client: running: env X11VNC_SKIP_DISPLAY='' /bin/sh /tmp/x11vnc-find_display.A3pW4F
/tmp/x11vnc-find_display.A3pW4F: 1: /tmp/x11vnc-find_display.A3pW4F: netstat: not found
07/02/2020 12:25:12 wait_for_client: find display cmd failed.
07/02/2020 12:25:12 wait_for_client: bad reply '
'

And it drops me to a $ prompt
 
Old 02-07-2020, 12:30 PM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
As a frame of reference just to see if I could get a connection I started x11vnc from the command line as my regular user. My regular user UID is 1000 and you will see messages about no password but on your local lan that should not be a problem for a quick test. Change to match your system.
x11vnc runs in the foreground and you should see all the messages.
Code:
x11vnc -display :1 -noxdamage -wait 50 -auth /run/user/1000/gdm/Xauthority
On the client I used Remmina.

I don't know enough about x11vnc to understand why you see the find display cmd failed or wait_for_client bad reply messages.
 
1 members found this post helpful.
Old 02-07-2020, 12:36 PM   #10
MichRX7
LQ Newbie
 
Registered: Feb 2020
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
As a frame of reference just to see if I could get a connection I started x11vnc from the command line as my regular user. My regular user UID is 1000 and you will see messages about no password but on your local lan that should not be a problem for a quick test. Change to match your system.
x11vnc runs in the foreground and you should see all the messages.
Code:
x11vnc -display :1 -noxdamage -wait 50 -auth /run/user/1000/gdm/Xauthority
On the client I used Remmina.

I don't know enough about x11vnc to understand why you see the find display cmd failed or wait_for_client bad reply messages.
And it works! Thank you very much!
 
Old 02-07-2020, 12:46 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
The next step I assume would be to figure out how to start it as a service. I saw several variations and I would have to play around and see what works for debian 10.
 
Old 02-07-2020, 01:09 PM   #12
MichRX7
LQ Newbie
 
Registered: Feb 2020
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
The next step I assume would be to figure out how to start it as a service. I saw several variations and I would have to play around and see what works for debian 10.
Yeah, that would work as well, but for now if I can ssh in and run your command then fire up vnc and connect I am in a really good mood.
 
Old 02-07-2020, 05:57 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
An additional option is to use the -bg option. This puts x11vnc in the background and will keep it from being killed if or when you log out of ssh or the connection times out.
 
Old 02-08-2020, 09:32 AM   #14
MichRX7
LQ Newbie
 
Registered: Feb 2020
Posts: 8

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
An additional option is to use the -bg option. This puts x11vnc in the background and will keep it from being killed if or when you log out of ssh or the connection times out.
Thanks, that worked great. Now I'm going to try and work on getting the machine to come up headless (even though it's a laptop, lol...) and start x11vnc automatically so I can stick it on a shelf somewhere. My wife kicked the power brick last night and she's still mad at me.
 
  


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
Kubuntu KDE and x11vnc problems mfoley Ubuntu 1 09-14-2016 05:03 PM
[SOLVED] Run X11VNC at Startup - Debian 8.3.0 - Cinnamon 2.2.16 Toonses82 Debian 2 02-27-2016 12:01 PM
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
how do i get x11vnc to work inside a screen session kain184 Linux - Newbie 1 03-30-2014 03:05 PM
Debian/GPROFTPD won't allow TLS connections sandygws Linux - Newbie 2 12-21-2009 03:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:52 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