LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-22-2009, 08:07 AM   #1
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Rep: Reputation: 39
Error while trying to access vnc


I am getting following error while trying to establish a vnc session over ssh what should I do or look in for.

t@-laptop:~$ vncviewer 192.168.1.19
192.168.1.19 5900
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:525)
at java.net.Socket.connect(Socket.java:475)
at java.net.Socket.<init>(Socket.java:372)
at java.net.Socket.<init>(Socket.java:186)
at rfbProto.<init>(rfbProto.java:93)
at vncviewer.connectAndAuthenticate(vncviewer.java:193)
at vncviewer.run(vncviewer.java:122)
at java.lang.Thread.run(Thread.java:619)
java.net.ConnectException: Connection refused
 
Old 12-22-2009, 08:29 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
over ssh? What part of that is over ssh?? from the error there simply is no VNC server listening, or you're firewalled.
 
Old 12-22-2009, 09:00 AM   #3
Dig
Member
 
Registered: Nov 2009
Posts: 50

Rep: Reputation: 1
1- start the vncserver on the remote host
2- enable the remote desktop connection through ( System ==> preferences ==> Remote Desktop ) allow X from other hosts
3- grant access through firewall
4- to establish it via ssh

#vncviewer --via user@host host:1
 
Old 12-23-2009, 10:41 AM   #4
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by acid_kewpie View Post
over ssh? What part of that is over ssh?? from the error there simply is no VNC server listening, or you're firewalled.
I disabled firewall I am not clear with your question what part of that is over ssh
 
Old 12-23-2009, 10:42 AM   #5
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by Dig View Post
1- start the vncserver on the remote host
2- enable the remote desktop connection through ( System ==> preferences ==> Remote Desktop ) allow X from other hosts
3- grant access through firewall
4- to establish it via ssh

#vncviewer --via user@host host:1
Well this is the output I got
[root@ ~]# vncviewer --via tkmsr@localhost:1

VNC Viewer Free Edition 4.1.2 for X - built Mar 24 2009 19:52:30
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

usage: vncviewer [parameters] [host:displayNum] [parameters]
vncviewer [parameters] -listen [port] [parameters]

Parameters can be turned on with -<param> or off with -<param>=0
Parameters which take a value can be specified as -<param> <value>
Other valid forms are <param>=<value> -<param>=<value> --<param>=<value>
Parameter names are case-insensitive. The parameters are:

Global Parameters:
name - The X window name (default=)
MenuKey - The key which brings up the popup menu (default=F8)
DebugDelay - Milliseconds to display inverted pixel data - a debugging
feature (default=0)
Parent - X Window to use as a parent (default=)
via - Gateway to tunnel via (default=)
display - The X display (default=)
geometry - X geometry specification (default=)
listen - Listen for connections from VNC servers (default=0)
SendPrimary - Send the primary selection and cut buffer to the server as
well as the clipboard selection (default=1)
SendClipboard - Send clipboard changes to the server (default=1)
AcceptClipboard - Accept clipboard changes from the server (default=1)
Shared - Don't disconnect other viewers upon connection - share the
desktop instead (default=0)
ViewOnly - Don't send any mouse or keyboard events to the server
(default=0)
FullScreen - Full screen mode (default=0)
PreferredEncoding - Preferred encoding to use (ZRLE, hextile or raw) -
implies AutoSelect=0 (default=)
LowColourLevel - Colour level to use on slow connections. 0 = Very Low (8
colours), 1 = Low (64 colours), 2 = Medium (256 colours)
(default=1)
FullColor - Alias for FullColour
FullColour - Use full colour - otherwise low colour level is used until
AutoSelect decides the link is fast enough (default=0)
AutoSelect - Auto select pixel format and encoding (default=1)
DotWhenNoCursor - Show the dot cursor when the server sends an invisible
cursor (default=1)
UseLocalCursor - Render the mouse cursor locally (default=1)
passwd - Alias for PasswordFile
PasswordFile - Password file for VNC authentication (default=)
WMDecorationHeight - Height of window manager decoration around a window
(default=24)
WMDecorationWidth - Width of window manager decoration around a window
(default=6)
PointerEventInterval - Time in milliseconds to rate-limit successive pointer
events (default=0)
Log - Specifies which log output should be directed to which
target logger, and the level of output to log. Format is
<log>:<target>:<level>[, ...]. (default=)
ZlibLevel - Zlib compression level (default=-1)

Last edited by tkmsr; 12-24-2009 at 04:41 AM.
 
Old 12-23-2009, 11:46 AM   #6
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
it helps if you read the instructions there, what you did doesn't match what he told you to do. You combined the ssh host directive and the vnc service into one illegal parameter. I'm still concerned that you've not mentioned anything about ssh yourself, indeed you asked what I mean by over ssh. You yourself said you want to run it over ssh... do you know what that really means?

Last edited by acid_kewpie; 12-23-2009 at 11:50 AM.
 
Old 12-24-2009, 04:22 AM   #7
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by acid_kewpie View Post
You yourself said you want to run it over ssh... do you know what that really means?
No I am not able to understand it I have once done the following on computer that had Ubuntu and I installed vncserver
I logged on to this Ubuntu machine via SSH from CentOS and then did
vncviewer localhost:1
it worked but what ever above is being mentioned I am not able to follow or make it work.
More over I do not have physical access to the machine I am talking about it does not have an X environment installed so I do not know what is happening on it I just did following as root
service iptables stop
checked netstat -tualp | grep vnc
got the list of ports where vncserver was listening connections
I could not follow the replies given here.
I guess vnc-server is up but I am not able to get display on client machine and I need to set the parameters which i pasted in the above reply but then where and how to set and what should be set that I want to know.

Last edited by tkmsr; 12-24-2009 at 04:43 AM.
 
Old 12-24-2009, 04:39 AM   #8
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by Dig View Post
2- enable the remote desktop connection through ( System ==> preferences ==> Remote Desktop ) allow X from other hosts
I am not clear with this part I don't remember but if I am correct there is some line some where ,to which I need to modify saying
DISALLOW_TCP TRUE
not sure though I forgot it did a long time back.
 
Old 12-24-2009, 10:06 AM   #9
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
OK, so it seems you do *NOT* want to run it over ssh,you're just using ssh to start the VNC process. Well, you're then apparently using implicit X forwarding to make the application appear. Doing it that way, you said it worked, so what else is to do?

Once you've got the service running on display 1 then you'd just run vncviewer remotemachineipaddreess:1 and it should load. The way you did have it working is not the right way to use VNC, but still actually more secure than the "proper" way, and pretty similar to correctly use it over ssh.

vnc is appalling bad rubbish and awful btw, you should use NX instead IMHO.
 
Old 12-24-2009, 12:07 PM   #10
tkmsr
Member
 
Registered: Oct 2006
Distribution: Ubuntu,Open Suse,Debian,Mac OS X
Posts: 798

Original Poster
Rep: Reputation: 39
Quote:
Originally Posted by acid_kewpie View Post
OK, so it seems you do *NOT* want to run it over ssh,you're just using ssh to start the VNC process. Well, you're then apparently using implicit X forwarding to make the application appear. Doing it that way, you said it worked, so what else is to do?

Once you've got the service running on display 1 then you'd just run vncviewer remotemachineipaddreess:1 and it should load.
You are absolutely right every thing worked well when I posted my question I was in trouble but now I am able to access it I did
ssh -X remote IP
vncviewer localhost:1
it worked asked for vncpasswd done

Quote:
Originally Posted by acid_kewpie View Post
The way you did have it working is not the right way to use VNC, but still actually more secure than the "proper" way, and pretty similar to correctly use it over ssh.
I agree to this since I did without ssh vncviewer IP of remote:1
and voilla I was asked for VNC Passwd and it was showing me the remote desktop so it is obviously not a secure way.
Please tell me how to secure it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 the linux machine through vnc? srinivasam Linux - Newbie 4 03-19-2009 07:22 PM
Allow VNC access only to specific IP's proNick Linux - Newbie 2 02-06-2008 01:44 PM
vnc - remote access Fill Linux - Software 1 06-30-2007 06:41 PM
VNC console access. WRXSTi SUSE / openSUSE 14 03-28-2007 02:43 AM
vnc or remote access question coal-fire-ice Solaris / OpenSolaris 13 08-13-2005 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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