LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-24-2011, 08:09 AM   #1
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Rep: Reputation: Disabled
Slackware vncservers & vncviewer mess


Hi,

I have 3 machines on which I am using vncviewer & vncserver to remotely use them.

On my server, there is only a root account. No problem there, VNC works every time (crossing fingers...), but on my laptop and my htpc, its a different story.

On my htpc, it worked so far (for the last 8 months) but recently I noticed whenever I rebooted, there were a chance (50%) that vnc wouldnt work. Basically once I login using vncviewer, I get a blank desktop (grayish) with only a X shaped cursor. I investigated a bit and I believe it has something to do with session managers. Normally, I use XFCE 4.4 on this machine (stock from Slack 13.1 X64).

On my laptop, vncviewer never worked. Same problem: blank desktop with X cursor. See attached screenshot. I also investigated on this machine and my files look like:

/etc/rc.d/rc.vncservers.conf:

Code:
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.

VNCSERVERS="1:lpallard"
$HOME/.vnc/xstartup (Unmodified from Slack)

Code:
#!/bin/sh

# Slackware Linux VNC session startup script
#
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

# Another example of setting up desktop environment
#
# [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
# [ -r /.Xresources ] && xrdb /.Xresources
# xsetroot -solid grey
# vncconfig -iconic &
# xterm -geometry 80x24+10+10 -ls -title " Desktop" &
# twm &
$HOME/.vnc/laptop:1.log

Code:
24/07/11 09:10:00 Xvnc version TightVNC-1.3.10
24/07/11 09:10:00 Copyright (C) 2000-2009 TightVNC Group
24/07/11 09:10:00 Copyright (C) 1999 AT&T Laboratories Cambridge
24/07/11 09:10:00 All Rights Reserved.
24/07/11 09:10:00 See http://www.tightvnc.com/ for information on TightVNC
24/07/11 09:10:00 Desktop name 'X' (laptop:1)
24/07/11 09:10:00 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
24/07/11 09:10:00 Listening for VNC connections on TCP port 5901
24/07/11 09:10:00 Listening for HTTP connections on TCP port 5801
24/07/11 09:10:00   URL http://laptop:5801
xrdb:  "Xft.hinting" on line 9 overrides entry on line 6
xrdb:  "Xft.hintstyle" on line 11 overrides entry on line 7
Xlib:  extension "RANDR" missing on display ":1".

** ERROR **: Another session manager is already running
aborting...
/etc/X11/xinit/xinitrc: line 131:  7441 Aborted                 $xfcesm

24/07/11 09:10:28 Got connection from client 192.168.0.106
24/07/11 09:10:28 Using protocol version 3.8
24/07/11 09:10:28 Enabling TightVNC protocol extensions
24/07/11 09:10:31 Full-control authentication passed by 192.168.0.106
24/07/11 09:10:31 Pixel format for client 192.168.0.106:
24/07/11 09:10:31   32 bpp, depth 24, little endian
24/07/11 09:10:31   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
24/07/11 09:10:31   no translation needed
24/07/11 09:10:31 Using raw encoding for client 192.168.0.106
24/07/11 09:10:31 Using compression level 1 for client 192.168.0.106
24/07/11 09:10:31 Using image quality level 6 for client 192.168.0.106
24/07/11 09:10:31 Enabling X-style cursor updates for client 192.168.0.106
24/07/11 09:10:31 Enabling cursor position updates for client 192.168.0.106
24/07/11 09:10:31 Enabling LastRect protocol extension for client 192.168.0.106
24/07/11 09:10:31 KbdAddEvent: unknown KeySym 0xff8d - allocating KeyCode 89
24/07/11 09:10:33 Client 192.168.0.106 gone
24/07/11 09:10:33 Statistics:
24/07/11 09:10:33   key events received 1, pointer events 37
24/07/11 09:10:33   framebuffer updates 1, rectangles 3, bytes 3145834
24/07/11 09:10:33     cursor shape updates 1, bytes 82
24/07/11 09:10:33     cursor position updates 1, bytes 12
24/07/11 09:10:33     raw rectangles 1, bytes 3145740
24/07/11 09:10:33   raw bytes equivalent 3145740, compression ratio 1.000000
So I believe the bold lines of the log are describing the problem but I have no clue what they are... Anybody can help? I tried commenting out the lines in the xstartup script, no luck. I tried desktop :2, same thing...

Last edited by lpallard; 07-24-2011 at 08:14 AM.
 
Old 07-26-2011, 10:57 PM   #2
argon99
Member
 
Registered: Mar 2009
Posts: 37

Rep: Reputation: 16
Quote:
Originally Posted by lpallard View Post
Hi,

I have 3 machines on which I am using vncviewer & vncserver to remotely use them.

On my server, there is only a root account. No problem there, VNC works every time (crossing fingers...), but on my laptop and my htpc, its a different story.

On my htpc, it worked so far (for the last 8 months) but recently I noticed whenever I rebooted, there were a chance (50%) that vnc wouldnt work. Basically once I login using vncviewer, I get a blank desktop (grayish) with only a X shaped cursor. I investigated a bit and I believe it has something to do with session managers. Normally, I use XFCE 4.4 on this machine (stock from Slack 13.1 X64).

On my laptop, vncviewer never worked. Same problem: blank desktop with X cursor. See attached screenshot. I also investigated on this machine and my files look like:

/etc/rc.d/rc.vncservers.conf:

Code:
# The VNCSERVERS variable is a list of display:user pairs.
#
# Uncomment the line below to start a VNC server on display :1
# as my 'myusername' (adjust this to your own).  You will also
# need to set a VNC password; run 'man vncpasswd' to see how
# to do that.
#
# DO NOT RUN THIS SERVICE if your local area network is
# untrusted!  For a secure way of using VNC, see
# <URL:http://www.uk.research.att.com/vnc/sshvnc.html>.

VNCSERVERS="1:lpallard"
$HOME/.vnc/xstartup (Unmodified from Slack)

Code:
#!/bin/sh

# Slackware Linux VNC session startup script
#
unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc

# Another example of setting up desktop environment
#
# [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
# [ -r /.Xresources ] && xrdb /.Xresources
# xsetroot -solid grey
# vncconfig -iconic &
# xterm -geometry 80x24+10+10 -ls -title " Desktop" &
# twm &
$HOME/.vnc/laptop:1.log

Code:
24/07/11 09:10:00 Xvnc version TightVNC-1.3.10
24/07/11 09:10:00 Copyright (C) 2000-2009 TightVNC Group
24/07/11 09:10:00 Copyright (C) 1999 AT&T Laboratories Cambridge
24/07/11 09:10:00 All Rights Reserved.
24/07/11 09:10:00 See http://www.tightvnc.com/ for information on TightVNC
24/07/11 09:10:00 Desktop name 'X' (laptop:1)
24/07/11 09:10:00 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
24/07/11 09:10:00 Listening for VNC connections on TCP port 5901
24/07/11 09:10:00 Listening for HTTP connections on TCP port 5801
24/07/11 09:10:00   URL http://laptop:5801
xrdb:  "Xft.hinting" on line 9 overrides entry on line 6
xrdb:  "Xft.hintstyle" on line 11 overrides entry on line 7
Xlib:  extension "RANDR" missing on display ":1".

** ERROR **: Another session manager is already running
aborting...
/etc/X11/xinit/xinitrc: line 131:  7441 Aborted                 $xfcesm

24/07/11 09:10:28 Got connection from client 192.168.0.106
24/07/11 09:10:28 Using protocol version 3.8
24/07/11 09:10:28 Enabling TightVNC protocol extensions
24/07/11 09:10:31 Full-control authentication passed by 192.168.0.106
24/07/11 09:10:31 Pixel format for client 192.168.0.106:
24/07/11 09:10:31   32 bpp, depth 24, little endian
24/07/11 09:10:31   true colour: max r 255 g 255 b 255, shift r 16 g 8 b 0
24/07/11 09:10:31   no translation needed
24/07/11 09:10:31 Using raw encoding for client 192.168.0.106
24/07/11 09:10:31 Using compression level 1 for client 192.168.0.106
24/07/11 09:10:31 Using image quality level 6 for client 192.168.0.106
24/07/11 09:10:31 Enabling X-style cursor updates for client 192.168.0.106
24/07/11 09:10:31 Enabling cursor position updates for client 192.168.0.106
24/07/11 09:10:31 Enabling LastRect protocol extension for client 192.168.0.106
24/07/11 09:10:31 KbdAddEvent: unknown KeySym 0xff8d - allocating KeyCode 89
24/07/11 09:10:33 Client 192.168.0.106 gone
24/07/11 09:10:33 Statistics:
24/07/11 09:10:33   key events received 1, pointer events 37
24/07/11 09:10:33   framebuffer updates 1, rectangles 3, bytes 3145834
24/07/11 09:10:33     cursor shape updates 1, bytes 82
24/07/11 09:10:33     cursor position updates 1, bytes 12
24/07/11 09:10:33     raw rectangles 1, bytes 3145740
24/07/11 09:10:33   raw bytes equivalent 3145740, compression ratio 1.000000
So I believe the bold lines of the log are describing the problem but I have no clue what they are... Anybody can help? I tried commenting out the lines in the xstartup script, no luck. I tried desktop :2, same thing...

I use x11vnc all the time on many machines. That works fine for me.

To answer your question it would help if you included the code from the files mentioned
[B]xrdb: "Xft.hinting" on line 9 overrides entry on line 6
xrdb: "Xft.hintstyle" on line 11 overrides entry on line 7
and
/etc/X11/xinit/xinitrc: line 131:

If you can't get it to work try x11vnc instead of vnc. And if that doesn't work take a look at freenx. It is a different way of doing remote administration.
 
Old 07-27-2011, 09:04 AM   #3
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
I am a bit confused by these VNC servers/viewers... If I understand correctly, Slack ships with a simple VNC server right? So I can use any kind of viewers to connect to the server right?

If its true then I also assume that using the vncviewer command I am therefore using a low-end simple viewer. Again, if its true, then I'd like to upgrade to a more performant/flexible protocol and use SSH encryption for improved security.

I looked at the x11vnc and looks interesting. If I decide to use this do I need to change the vncserver on the remote machine so x11vnc and the server can communicate together? In other words, are they all kinda compatible?
 
Old 07-27-2011, 09:04 PM   #4
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Ok I've installed x11vnc & it's ssl companion ssvnc but I can't get them to interface together... I start x11vnc with

x11vnc -ssl -usepw -display :0

But selecting ssl in ssvnc and trying to connect opens a xterm and says something like:

Couldn't convert 'stunnel /tmp/vnc_viewer.blablabla' to a host address.

I'm not 100% sure of the message cause I'm not in front of the machine as we "speak" but it's damn close to that...

There is a million arguments to x11vnc ... Can you simply paste your startup command here?
 
Old 07-30-2011, 07:51 AM   #5
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
OK I managed to get x11vnc running locally on my laptop. Using ssvnc I can view the desktop x11vnc created, but I still cant figure out how to get the damn thing running on a remote machine.

Its a nightmare trying to make X sessions work with x11vnc. So to use this case as an example, once it works I will try the same on the other machines.

I installed x11vnc and libvncservers.
I normally have the machine running with the user logged in (its a htpc machine in my living room so the thing is on 24/7 with the user logged in). I never (or almost) log as root as I use ssh for admin.
I want to be able to access the user's desktop using x11vnc.

I use this command to start x11vnc:

Code:
x11vnc -bg -defer 10 -desktop :0 -display :0 -forever -logfile /var/log/x11vnc.log -ncache -overlay_nocursor -wait 10 -xkb
How I got this command? I used the working setup of my laptop and in the GUI, there is a function to show the command used.

This is what the log has in it:
Quote:
root@htpc:~# cat /var/log/x11vnc.log
30/07/2011 08:21:50 passing arg to libvncserver: -desktop
30/07/2011 08:21:50 passing arg to libvncserver: :0

30/07/2011 08:21:51 x11vnc version: 0.9.12 lastmod: 2010-09-09 pid: 2814
No protocol specified
30/07/2011 08:21:51 XOpenDisplay(":0") failed.
30/07/2011 08:21:51 Trying again with XAUTHLOCALHOSTNAME=localhost ...
No protocol specified

30/07/2011 08:21:51 ***************************************
30/07/2011 08:21:51 *** XOpenDisplay failed (:0)

*** x11vnc was unable to open the X DISPLAY: ":0", it cannot continue.
*** There may be "Xlib:" error messages above with details about the failure.

Some tips and guidelines:

** An X server (the one you wish to view) must be running before x11vnc is
started: x11vnc does not start the X server. (however, see the -create
option if that is what you really want).

** You must use -display <disp>, -OR- set and export your $DISPLAY
environment variable to refer to the display of the desired X server.
- Usually the display is simply ":0" (in fact x11vnc uses this if you forget
to specify it), but in some multi-user situations it could be ":1", ":2",
or even ":137". Ask your administrator or a guru if you are having
difficulty determining what your X DISPLAY is.

** Next, you need to have sufficient permissions (Xauthority)
to connect to the X DISPLAY. Here are some Tips:

- Often, you just need to run x11vnc as the user logged into the X session.
So make sure to be that user when you type x11vnc.
- Being root is usually not enough because the incorrect MIT-MAGIC-COOKIE
file may be accessed. The cookie file contains the secret key that
allows x11vnc to connect to the desired X DISPLAY.
- You can explicitly indicate which MIT-MAGIC-COOKIE file should be used
by the -auth option, e.g.:
x11vnc -auth /home/someuser/.Xauthority -display :0
x11vnc -auth /tmp/.gdmzndVlR -display :0
you must have read permission for the auth file.
See also '-auth guess' and '-findauth' discussed below.

** If NO ONE is logged into an X session yet, but there is a greeter login
program like "gdm", "kdm", "xdm", or "dtlogin" running, you will need
to find and use the raw display manager MIT-MAGIC-COOKIE file.
Some examples for various display managers:

gdm: -auth /var/gdm/:0.Xauth
-auth /var/lib/gdm/:0.Xauth
kdm: -auth /var/lib/kdm/A:0-crWk72
-auth /var/run/xauth/A:0-crWk72
xdm: -auth /var/lib/xdm/authdir/authfiles/A:0-XQvaJk
dtlogin: -auth /var/dt/A:0-UgaaXa

Sometimes the command "ps wwwwaux | grep auth" can reveal the file location.

Starting with x11vnc 0.9.9 you can have it try to guess by using:

-auth guess

(see also the x11vnc -findauth option.)

Only root will have read permission for the file, and so x11vnc must be run
as root (or copy it). The random characters in the filenames will of course
change and the directory the cookie file resides in is system dependent.

See also: http://www.karlrunge.com/x11vnc/faq.html
Anybody can help?
 
Old 08-17-2011, 04:42 AM   #6
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
Interesting coincidence that I come over here while looking over for some other problem.
I run x11vnc on my home machine and I connect to it using x11vnc using ssl. Now if no one is logged in to the system yet, you need to point xauth file of the DM you are using (IN my case, SLiM). SLiM puts its xauth file in /var/run/slim.auth so I need to use -auth /var/run/slim.auth flag to x11vnc. However it does not end there. /var/run/slim.auth is 600 as it should be so you have to run x11vnc as root. I used sudo for that successfully but your milage may vary.

PS: following is my command line
Code:
sudo x11vnc -unixpw USERNAME -ssl /home/USER/.vnc/certs/server.pem -auth /var/run/slim.auth -httpdir /usr/share/x11vnc/classes/ssl -display :0
 
Old 08-18-2011, 11:06 AM   #7
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Hey ozanbaba! Thanks for your reply!

You see this is my home setup:

Laptop ---> x11vnc + ssl + ssvnc ---> htpc (works flawlessly). I have x11vnc start automatically at user login, and I have auto login so in the end x11vnc starts automatically.

Now for my home server, I currently use TightVNC as normally, I dont start X automatically. This is a headless server, no monitor, no KB, no mouse. With tightVNC I can use the remote desktop without starting X server. If I was to use x11vnc, would I need to start a X server at boot time? I believe so but if you can confirm I would appreciate.
 
Old 08-18-2011, 11:28 AM   #8
ozanbaba
Member
 
Registered: May 2003
Location: İzmir
Distribution: Slackware64 15.0 Multilib
Posts: 778

Rep: Reputation: 135Reputation: 135
You will need X at remote machine but at local machine I don't know. You will need something to give you something graphical.

Follow this setup here:
Laptop at home, Xvfb -> x11vnc -> work machine (xp pro) -> ssvnc.

I start Xvfb at :1 to not to interfere with actual X running at :0. I connect to my machine via ssh and then start Xvfb inside a screen. After than I start x1vnc in another screen and wala I got full access to my system. At this setup, all programs started as normal user as well.
 
Old 08-22-2011, 05:25 AM   #9
lpallard
Senior Member
 
Registered: Nov 2008
Posts: 1,045

Original Poster
Rep: Reputation: Disabled
Pretty straight forward! I'll do that! Thanks for the info!
 
  


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
How to access multiple vncservers sirius56 Linux - Server 5 03-07-2007 04:40 PM
auto create 2 vncservers for 2 different users deadeyes Ubuntu 0 02-25-2007 10:13 AM
[root@localhost Desktop]# vncviewer 192.168.0.11:2 vncviewer not viewing kde display nickleus Linux - Software 13 10-27-2006 03:58 AM
VNCViewer and Slackware JockVSJock Slackware 6 05-13-2004 01:05 PM
vncviewer & kde jmarsh Linux - Networking 8 04-29-2004 10:08 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:34 PM.

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