Solved

setting up x11vnc on Ubuntu 10

Posted on 2011-03-06
6
1,389 Views
Last Modified: 2012-05-11
Hi

I have root access to a ubunut 10 VM which i normally connect to via putty. I am trying
I am a linux novice trying to connect to ubunutu 10 via x11vnc.

I have tried to install x11vnc on the machine as follows
sudo apt-get install x11vnc vnc-java
x11vnc -storepasswd

 iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 5900 -j ACCEPT
iptables -A INPUT -p tcp -d 0/0 -s 0/0 --dport 5800 -j ACCEPT

x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800

 This seems to load ok but removes the shell prompt. I presume the server has started and is listening on the ports so i used another putty window to reconnect to my machine and ran sockstat -l and xllvnc is listening on the 2 ports.

 I then downloaded realvnc windows client and entered the hostname to connect
If i entered just the hostname or hostname:5900 i get a timeout error but if i enter hostname:5800 i get 'connection refused' error

I have been advised this is not the best way and i should start the server like so

x11vnc -auth -forever guess -display :0 -localhost -rfbport 20000 -xkb

 I tried starting the server like this but i got a warning saying i was running the server without a password.
There does appear to be an encrypted password in ~/.vnc/passwd though so i tried this instead

x11vnc -auth -forever guess -display :0 -localhost -rfbport 20000 -xkb -rfbauth ~/.vnc/passwd

There was some loading messages.
The root prompt returned so i assumed the server must be running in the background so i tried ps -ef | grep vnc to look for it but nothing was listed. How do i stop the vnc servers I have started???

I tried connecting via realvnc (with port 2000) but got connection refused. The linux machine uses a non-standard port for SSH so I don't know if realvnc is trying to connect via ssh over the standard port with forwarding to port 2000?

Note: please do not simply post a link to a website with instructions as your answer as I will not award the points. I have already looked at many websites and it seems I am unable to do this without some human guidance

thanks a lot
0
Comment
Question by:andieje
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 12

Accepted Solution

by:
upanwar earned 500 total points
ID: 35046656
To set password for vnc, run the command
# vncpasswd

To check whether VNC is running or not execute the below given command.

# ps -ef | grep -i vnc

If it dont show anything it means that VNC is not running on your box.

To check on which post your VNC is listening just run the command.

netstat -natp | grep -i vnc

It will show you the port on which VNC is listening.

Check on which ports your box is listening.

netstat -an | grep "LISTEN"

Check the which ports are open with below given command.

iptables -L -v

To check from your windows box whether your Linux box is listening on particular box or not just run the below given steps.

Start ---> Run ----> cmd

on command prompt execute below given command

telnet <ip address of linux box> <port>

If you are getting ^ Escape character, it means port is open otherwise there is some problem like if you get error message 'connection refused' it means server is not running on that port.

Hope these steps will help you to troubleshoot your issue but still if you face any issue or have any query. Please feel free to ask us.
0
 

Author Comment

by:andieje
ID: 35047378
it looks as though the vnc server is exiting as it loads.

It seems to start

06/03/2011 20:03:53 passing arg to libvncserver: guess
06/03/2011 20:03:53 passing arg to libvncserver: -rfbauth
06/03/2011 20:03:53 passing arg to libvncserver: /root/.vnc/passwd
06/03/2011 20:03:53 passing arg to libvncserver: -rfbport
06/03/2011 20:03:53 passing arg to libvncserver: 5900
06/03/2011 20:03:53 x11vnc version: 0.9.9 lastmod: 2009-12-21  pid: 27843
06/03/2011 20:03:53 Using X display :0
06/03/2011 20:03:53 rootwin: 0x101 reswin: 0x1600001 dpy: 0xbce480


then it ends like this and returns to the promopt

06/03/2011 20:03:53 Default visual ID: 0x21
06/03/2011 20:03:53 Read initial data from X display into framebuffer.
06/03/2011 20:03:53 initialize_screen: fb_depth/fb_bpp/fb_Bpl 24/32/3200
06/03/2011 20:03:53 *** unrecognized option(s) ***
06/03/2011 20:03:53     [1]  guess
06/03/2011 20:03:53 For a list of options run: x11vnc -opts
06/03/2011 20:03:53 or for the full help: x11vnc -help
06/03/2011 20:03:53
06/03/2011 20:03:53 Here is a list of removed or obsolete options:
06/03/2011 20:03:53
06/03/2011 20:03:53 removed: -hints, -nohints
06/03/2011 20:03:53 removed: -cursorposall
06/03/2011 20:03:53 removed: -nofilexfer, now the default.
06/03/2011 20:03:53
06/03/2011 20:03:53 renamed: -old_copytile, use -onetile
06/03/2011 20:03:53 renamed: -mouse,   use -cursor
06/03/2011 20:03:53 renamed: -mouseX,  use -cursor X
06/03/2011 20:03:53 renamed: -X,       use -cursor X
06/03/2011 20:03:53 renamed: -nomouse, use -nocursor
06/03/2011 20:03:53 renamed: -old_pointer, use -pointer_mode 1
root#
0
 

Author Comment

by:andieje
ID: 35047446
if i do the telnet command to the ssh port then it seems ok

if i used the vnc port i get the message 'connecting to server' and then the window closes automatically after about 30 secs
0
Quiz: What Do These Organizations Have In Common?

Hint: Their teams ended up taking quizzes, too.

 

Author Comment

by:andieje
ID: 35047461
the port 5900 appears to be open but i believe i don't need any other ports to be open to do ssh tunnelling

the first problem is that the vnc server is not starting
0
 

Author Comment

by:andieje
ID: 35058221
i got the server to start and is listening on port 5900 - i checked all of the above.

x11vnc  -forever  -display :0 -localhost  -xkb -rfbauth ~/.vnc/passwd


 i then tried to set up the client like so:

Setup the Client PC:
Launch PuTTY.
Under session:
Host Name: your Unix box FQDN or IP
Click SSH
Give the session a name

Under: Connection / SSH / Tunnels
Enter a port forward for Local
Source Port: 5901
Destination: localhost:5900
Click Add

Click on session again and save it.

Now launch (Open) your PuTTY session and logon to your Linux box's SSH
server.
 launch  VNC Viewer and enter localhost:1

with realVNC i got connection refused error 10061
0
 
LVL 12

Expert Comment

by:upanwar
ID: 35059502
Could you please run below given commands on your Linux box and provide the output.

netstat -an | grep "LISTEN"

ps -ef | grep -i vnc

iptables -L
0

Featured Post

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question