LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-16-2012, 02:09 PM   #1
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Rep: Reputation: Disabled
how to use: vncserver and vncviewer


Hi all,

Installed vncserver rpm on RHEL5 and trying to start vncviewer (installed realvnc on windows box) for a user and getting this error:

Code:
unable to connect to host: Connection refused (10061)
I stopped the firewall
Code:
]# service iptables status
Firewall is stopped.
MORE info:
Code:
]# rpm -qa |grep vnc
vnc-server-4.1.2-14.el5_5.4
vnc-4.1.2-14.el5_5.4

entry in /etc/sysconfig/vncservers

 VNCSERVERS="1:admin"
 VNCSERVERARGS[1]="-geometry 800x600 -depth 16"

and

]# more /root/.vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
Then as "admin" user
Code:
$ vncpasswd
Password:
Verify:

Then started vncserver as admin user

$ vncserver :1

New 'hostname:1 (admin)' desktop is hostname:1

Starting applications specified in /home/admin/.vnc/xstartup
Log file is /home/admin/.vnc/hostname:1.log

and 

$ more /home/admin/.vnc/xstartup
#!/bin/sh

[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
I am confused how to use this VNC ?

Does the RHEL server should be running at runlevel 5 to use VNC ?
it is currently at runlevel 3.



Thanks in advance!

Last edited by linuxandtsm; 03-16-2012 at 02:16 PM.
 
Old 03-16-2012, 02:49 PM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
Show log /home/admin/.vnc/hostname:1.log You can also check if vncviewer works on localhost. And you did not mentioned: are you trying to connect to port 5901? Like that:
Code:
vncviewer SERVER_IP:1
 
Old 03-16-2012, 02:52 PM   #3
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 80
You have started vncserver on the desktop 1 so the port will be default+1.
You can see wich one is by using:
Code:
netstat -nalpt | grep vncser
Then put in address on vncviewer iport
 
Old 03-16-2012, 03:04 PM   #4
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
Hi eSelix,

Code:
more /home/admin/.vnc/hostname:1.log
Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'
_XSERVTransmkdir: Owner of /tmp/.X11-unix should be set to root

Xvnc Free Edition 4.1.3 - built Oct 15 2008 12:55:42
Copyright (C) 2002-2008 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 40201000, The XFree86 Project, Inc


Fri Mar 16 14:55:05 2012
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on port 5901
 vncext:      Listening for HTTP connections on port 5801
 vncext:      created VNC server for screen 0
error opening security policy file /usr/X11R6/lib/X11/xserver/SecurityPolicy
Could not init font path element /usr/X11R6/lib/X11/fonts/misc/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Speedo/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/Type1/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/75dpi/, removing from list!
Could not init font path element /usr/X11R6/lib/X11/fonts/100dpi/, removing from list!

Fatal server error:
could not open default font 'fixed'
XIO:  fatal IO error 104 (Connection reset by peer) on X server "hostname:1.0"
      after 0 requests (0 known processed) with 0 events remaining.
vncconfig: unable to open display "hostname:1"
xterm Xt error: Can't open display: hostname:1
twm:  unable to open display "hostname:1"
I noticed that immediately after starting the vncserver, it is getting stopped.
Code:
# service vncserver status
Xvnc is stopped
[root@hostname ~]# service vncserver start
Starting VNC server: 1:admin
New 'hostname:1 (admin)' desktop is hostname:1

Starting applications specified in /home/admin/.vnc/xstartup
Log file is /home/admin/.vnc/hostname:1.log

                                                           [  OK  ]
# service vncserver status
Xvnc is stopped


I tried 

$ vncviewer IP:1

VNC Viewer Free Edition 4.1.3 for X - built Oct 15 2008 12:49:56
Copyright (C) 2002-2008 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
vncviewer: unable to open display ""
I am using vncviewer with hostname:1

Hi Celyr

Code:
# netstat -nalpt |grep vnc
# echo $?
1
and also DOES THE SERVER WHERE VNCSERVER INSTALLED NEED TO BE AT RUN_LEVEL ?

Last edited by linuxandtsm; 03-16-2012 at 03:21 PM.
 
Old 03-16-2012, 06:14 PM   #5
Celyr
Member
 
Registered: Mar 2012
Location: Italy
Distribution: Slackware+Debian
Posts: 321

Rep: Reputation: 80
No, you can run it at run level 3 with no problem at all.
It seems that the vncserver doesn't start because of the missing font, tomorrow I'll look for it
 
Old 03-16-2012, 07:18 PM   #6
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
Check 3rd question on vncserver FAQ They say that on Red Hat you probably need to install 100dpi fonts or use "-dpi 75" option.
 
Old 03-19-2012, 11:17 AM   #7
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
Ok, now i am able to see the desktop but it is all grey desktop but not real GUI one.

How to make it real GUI desktop ?

Below are few files
Code:
# more .vnc/xstartup
#!/bin/sh

# Uncomment the following two lines for normal desktop:
 unset SESSION_MANAGER
 exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &
The log file is

Code:
# more /root/.vnc/hostname:1.log
_XSERVTransSocketOpenCOTSServer: Unable to open socket for inet6
_XSERVTransOpen: transport open failed for inet6/hostname:1
_XSERVTransMakeAllCOTSServerListeners: failed to open listener for inet6

Xvnc Free Edition 4.1.2
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
Underlying X server release 70101000, The X.Org Foundation


Mon Mar 19 11:00:47 2012
 vncext:      VNC extension running!
 vncext:      Listening for VNC connections on port 5901
 vncext:      Listening for HTTP connections on port 5801
 vncext:      created VNC server for screen 0
localuser:root being added to access control list
No profile for user 'root' found

Mon Mar 19 11:02:02 2012
 Connections: accepted: 54.29.51.35::2993
 SConnection: Client needs protocol version 3.8
 SConnection: Client requests security type VncAuth(2)

Mon Mar 19 11:02:06 2012
 VNCSConnST:  Server default pixel format depth 16 (16bpp) little-endian rgb565
 VNCSConnST:  Client pixel format depth 8 (8bpp) rgb max 3,3,3 shift 4,2,0
 VNCSConnST:  Client pixel format depth 16 (16bpp) little-endian rgb565
Thanks in advance!
 
Old 03-19-2012, 11:41 AM   #8
Master_CAPS
Member
 
Registered: Mar 2012
Location: I live at ::1 usually...
Distribution: Yes.
Posts: 55

Rep: Reputation: Disabled
I think there is a GUI for modern distros. All I did was click some stuff in settings and allowed vnc users with a special password.
 
Old 03-19-2012, 01:51 PM   #9
Satyaveer Arya
Senior Member
 
Registered: May 2010
Location: Palm Island
Distribution: RHEL, CentOS, Debian, Oracle Solaris 10
Posts: 1,415

Rep: Reputation: 305Reputation: 305Reputation: 305Reputation: 305
checkout this link: http://www.walkernews.net/2007/07/05...ux-vnc-server/, very helpful..
 
Old 03-19-2012, 02:11 PM   #10
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
Hi Satyaveer Arya,

Thank you for the link.
I did similar setup/config but not getting desktop manager to work.
Only having text based console only.
 
Old 03-19-2012, 06:06 PM   #11
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
But do you have twm installed? If not, install it or run another window manager that you have, in your xstartup file. Show also your /etc/X11/xinit/xinitrc.
 
Old 03-20-2012, 09:06 AM   #12
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
Hi eSelix,

I think twm is installed
Code:
]# rpm -qa |grep -i twm
xorg-x11-twm-1.0.1-3.1
and below is the /etc/X11/xinit/xinitrc file
Code:
# Mandatorily source xinitrc-common, which is common code shared between the
# Xsession and xinitrc scripts which has been factored out to avoid duplication
. /etc/X11/xinit/xinitrc-common

# The user may have their own clients they want to run.  If they don't,
# fall back to system defaults.
if [ -f $HOME/.Xclients ]; then
    exec $SSH_AGENT $DBUS_LAUNCH $HOME/.Xclients || \
    exec $SSH_AGENT $HOME/.Xclients
elif [ -f /etc/X11/xinit/Xclients ]; then
    exec $SSH_AGENT $DBUS_LAUNCH /etc/X11/xinit/Xclients || \
    exec $SSH_AGENT /etc/X11/xinit/Xclients
else
    # Failsafe settings.  Although we should never get here
    # (we provide fallbacks in Xclients as well) it can't hurt.
    [ -x /usr/bin/xsetroot ] && /usr/bin/xsetroot -solid '#222E45'
    [ -x /usr/bin/xclock ] && /usr/bin/xclock -geometry 100x100-5+5 &
    [ -x /usr/bin/xterm ] && xterm -geometry 80x50-50+150 &
    [ -x /usr/bin/twm ] && /usr/bin/twm
fi
and how to know what is the default window manager and how to change them ?
 
Old 03-20-2012, 10:38 AM   #13
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
are you able to use vncserver as root?

just give a cross check

instead of admin use root and assign a vncpasswd for root

Code:
#vncpasswd

#service vncserver restart
and check the status of service

and post the output of
Code:
#rpm -qa | grep vnc

Last edited by deep27ak; 03-20-2012 at 10:41 AM.
 
Old 03-20-2012, 11:17 AM   #14
linuxandtsm
Member
 
Registered: May 2011
Posts: 194

Original Poster
Rep: Reputation: Disabled
Hi deep27ak,

Yes i am running vnc as root. I assigned a passwd and started the vncserver.

Code:
# service vncserver status
Xvnc (pid 2464) is running...
below is rpm output
Code:
# rpm -qa |grep vnc
vnc-4.1.2-14.el5_5.4
vnc-server-4.1.2-14.el5_5.4
 
Old 03-20-2012, 06:16 PM   #15
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 314Reputation: 314Reputation: 314Reputation: 314
If you get "text based console only" then it means that your Xvnc is working, but only window manager not started. Default in my system (Ubuntu) is stored in "/etc/X11/default-display-manager". You can change it in "~/.vnc/xstartup" file in place of line "/usr/bin/twm &".
 
  


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
Vncviewer Filious Linux - Newbie 12 01-31-2013 01:24 PM
Vncviewer doesn't show the remoteaccess screen when trying to connect to vncserver viritha30 Linux - Newbie 1 12-13-2011 10:59 AM
vncserver works, vncviewer fails Yordan AIX 2 03-29-2007 04:54 AM
[root@localhost Desktop]# vncviewer 192.168.0.11:2 vncviewer not viewing kde display nickleus Linux - Software 13 10-27-2006 04:58 AM
Robust vncserver startup file (rc.vncserver) arobinson74 Slackware 4 05-14-2005 06:33 AM


All times are GMT -5. The time now is 04:26 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration