Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora Resources > Guides & Solutions (No Questions)
FedoraForum Search

Forgot Password? Join Us!

Guides & Solutions (No Questions) Post your guides here (No links to Blogs accepted). You can also append your comments/questions to a guide, but don't start a new thread to ask a question. Use another forum for that.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11th July 2008, 10:53 PM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
VNC-Server Vino Mini Guide

VNCServer and Vino, a Mini Guide

1-Install and configure VNC-Server
2-Install and configure vncviewer
3-Install and configure Vino
4-Install additional desktop
5-Access VNC-Server via browser
6-Encrypted connection via ssh tunnel * New *


I recommend step 1 (VNC-server approach) over step 3 (Vino approach).
Step 2 is instruction to install vncviewer for client machine.
Step 4 may be required if you need to install additional desktop.
Step 5 is for accessing VNC-server via browser. Useful for occasional access from cyber cafe.
Step 6 is for ssh tunnel encrypted connection. Vncviewer free edition does not offer encryption.

Command prompt:
# denotes root login ( $ su - )
$ denotes non-root login
Editor: although "vi" is indicated, use any of your favorite text editor



1. Installing and configuring VNC-Server:

With this approach, a VNC session will be created independent of console X session.
Can be used at init runlevel 3 or 5, means you don't have to run desktop at console. Very handy for server especially at remote location.

Install VNC-server

Code:
# yum install vnc-server
Configure VNC-server

I recommend running VNC-server as system service. Edit /etc/sysconfig/vncservers, the configuration file used by vncserver service.

Code:
# vi /etc/sysconfig/vncservers
  ......
  VNCSERVERS="1:user1"
  #comment next line if only 1 user required.
  VNCSERVERS="1:user1 2:user2"
  # specify geometry to taste (can be anything you like. eg 1200x720)
  VNCSERVERARGS[1]="-geometry 1280x1024"
  VNCSERVERARGS[2]="-geometry 1024x768"
  ......
Stop vncserver service in case already started.
Code:
# /sbin/service vncserver stop
User configuration

Now login or "su" as individual user for user configuration.
Code:
# su - user1
$ vncserver :1 -geometry 1280x1024
  Password: xxxxx
After the last command, vncserver process will be started for user1.

It should have created .vnc directory under user1 home directory.

~/.vnc (/home/user1/.vnc) directory should contain following files:

Code:
$ ls -l ~/.vnc
-rw------- user1 group1 passwd {vnc server access password xxxxx}
-rw-rw-r-- user1 group1 host.domain.com:1.log
-rw-rw-r-- user1 group1 host.domain.com:1.pid
-rwxr-xr-x user1 group1 xstartup {need to be edited for start up option}
Make sure xstartup access mode is -rwxr-xr-x (755), if not
Code:
$ chmod 755 ~/.vnc/xstartup
Now stop vncserver to edit the xstartup file
Code:
$ vncserver -kill :1
$ vi ~/.vnc/xstartup
  ......
  # uncomment the following 2 lines
  unset SESSION_MANAGER
  exec /etc/X11/xinitrc/xinitrc
  ......
To change vnc process login password
Code:
$ vncpasswd
Password: xxxxxx
$ exit
#
Repeat User Configuration for user2, replacing :1 to :2

Firewall

Configure firewall to append or insert into INPUT chain, or use system-config-firewall in gui mode.

Code:
# vi /etc/sysconfig/iptables 
......
# 5901 corresponds to :1, 5902 for :2 and so on.
-A INPUT -m state --state NEW -m tcp -p tcp --dport 5901:5902 -j ACCEPT
......
Restart firewall (iptables service)
Code:
# /sbin/service iptables restart
Before we start vncserver service, select desktop GNOME, KDE or XFCE.

Desktop Selection

Default desktop being GNOME.

To change desktop used to KDE, create or edit /etc/sysconfig/desktop:
Code:
DESKTOP=KDE
# DESKTOP=GNOME
To use XFCE desktop, make following changes to ~/.vnc/xstartup, and follow step 4 to install XCFE later.

Code:
# Leave the following two lines commented
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
.....
# twm &
startxfce4 &
Now you are ready to enable and start vncserver service.
Code:
# /sbin/chkconfig vncserver on
# /sbin/service vncserver restart
2. Install and running vncviewer

Install vncviewer at client machine

To access from other Fedora machine, install vnc package there.
Code:
# yum install vnc
To access from Windows/XP, install one of the following vncviewers:

TightVNC http://www.tightvnc.com/download.html
RealVNC http://www.realvnc.com/products/download.html
UltraVNC http://www.uvnc.com/download/

Start vncviewer at client machine

Start vncviewer,

specify hostname:1 to attach as user1 -or- hostname:2 to attach as user2

specify hostname:0 to connect to Vino. (See step 3 later)

When prompted, enter the vncpasswd, and you are set.

Good luck!



3. Install and configure Vino:

With this approach, client's vncviewer will attach to the running console X session at server.

Must be init runlevel 5 and login, and I think it only works for gnome. (???)

Installing vino

Code:
# yum install vino
Configure and start vino

Login console desktop, in your gnome-terminal, execute the following:

Code:
$ vino-preferences

[x] Allow other users to view your desktop
  [x] Allow other users to control your desktop

When a user tries to view or control your desktop
[ ] Ask you for confirmation
[x] Require the user to enter this password
   Password: xxxxxx
When "Close," vino will start a vnc session at port 5900, (firewall need to open port 5900). IMO, don't check "Ask you for confirmation", but use "password" option instead, unless you will be at console to answer "Y" when connecting remotely.

Follow Step 2 to install vncviewer.

To connect remotely, use vncviewer to open hostname:0

Do not use vncviewer within gnome session to connect to yourself, or you will have "nested" windows.


4. Install additional Desktop

To Install Gnome, KDE or XFCE

Firstly, check desktop group names:
Code:
# yum grouplist
The following are valid for F9.

Code:
# yum groupinstall "GNOME Desktop Environment"
or
# yum groupinstall "KDE (K Desktop Environment)"
or
# yum groupinstall XFCE

5. Access vncserver via browser

Disable browser access

Browser Java access is enabled by default. To disable Java access, add -nohttpd option in /etc/sysconfig/vncserver

Code:
...
  VNCSERVERARGS[1]="-geometry 1280x1024 -nohttpd"
  ...
Installing missing Java classes for F9 and F10

Vnc-server package on F9/F10 is missing the Java classes for browser access.

If you are using F9/F10, goto http://www.realvnc.com/

Download vnc-4_1_3-x86_linux.tar.gz (free linux x86 version)

Create following directory

Code:
# mkdir -p /usr/share/vnc/classes
Extract the downloaded tarball

Code:
# tar xvf vnc-4_1_3-x86_linux.tar.gz
# cp -v vnc-4_1_3-x86_linux/java/* /usr/share/vnc/classes/
You should now have 3 files in /usr/share/vnc/classes directory

Code:
index.vnc
logo150x150.gif
vncviewer.jar
Restart your vncserver. You should now see following message during startup:
Code:
# /sbin/service vncserver restart
.....
New 'host.domain.com:1 (userid)' desktop is host.domain.com:1
Accessing Via Browser

To access via browser, specify port 580x in URL (ports need to be opened in iptables)

http://host.domain.com:5801 to connect as user1 and so on.

6. Encrypted connection via ssh tunnel

Linux Client

In a terminal session, establish a connection and login to server with following option:

Code:
$ ssh -L 5901:hostname:5901 userid@hostname
In another terminal session or via menu, start vncviewer and specify localhost:1 to connect.

Code:
$ vncviewer localhost:1
Windows Client

Free edition of vncviewer does not offer encryption connection.

To enable encrypted connection, download PuTTY, ssh client for Windows.

http://www.chiark.greenend.org.uk/~s.../download.html

Go for "A Windows installer for everything except PuTTYtel"

Install and start PuTTY, at the configuration page:-

On the left pane: Connection->SSH->Tunnels
On the right pane: Enter following information and click "Add". hostname is the domain name or ip address of vnc-server.
Code:
Source Port: 5901
Destination: hostname:5901
[x] Local   [  ] Remote   [  ] Dynamic
Add additional ports, 5902 and so on, as needed.

Select "Session" on left pane, enter hostname, ssh port#, session name and "Save" session.

Open connection via PuTTY and login to server.

Start vncviewer, specify localhost:1 to connect. VNC session will be connected via ssh secured tunnel.


EDIT: If you get gray screen using GNOME desktop.

****F9 Gnome may need some fixing up in dbus configuration before it can be used. Edit /etc/dbus-1/system.d/gdm.conf , insert the 2 lines in red. Restart messagebus service (may kill gnome session), or simply reboot. gui response in Gnome may be a bit sluggish. Your mileage varies.
Code:
  <policy user="gdm">
    <allow send_interface="org.gnome.DisplayManager.Manager"/>
    <allow send_interface="org.gnome.DisplayManager.Display"/>
    <allow send_interface="org.gnome.DisplayManager.LocalDisplayFactory"/>
    <allow send_interface="org.gnome.DisplayManager.Settings"/>
    <allow send_interface="org.gnome.DisplayManager.Slave"/>
    <allow send_interface="org.gnome.DisplayManager.Session"/>
    <allow send_destination="org.gnome.DisplayManager"
           send_interface="org.gnome.DBus.Properties" />
  </policy>
Code:
# /sbin/service messagebus restart

Last edited by briantan; 6th December 2008 at 03:02 AM.
Reply With Quote
  #2  
Old 12th July 2008, 09:49 PM
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 43
Posts: 4,168
Nice guide!

I always uses secure tunnel with TightVNC.
When using the java version, I noticed encryption is grayed out, pass that, and now see the colors looks funny. I see everything like you see in TightVNC.
Am I doing something wrong with encrytion or colors?

Last edited by marcrblevins; 12th July 2008 at 09:50 PM. Reason: Show my appreciation of the guide.
Reply With Quote
  #3  
Old 13th July 2008, 03:22 AM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Color palette is chosen based on network speed. Higher-bit colors are used for higher speed and vice versa. I get this low-bit color when accessing over a slow internet link. I think Java version just use lower-bit palette for some reason.

Perhaps RealVNC will have encrypt version for Java desktop in the future.

Last edited by briantan; 13th July 2008 at 03:25 AM.
Reply With Quote
  #4  
Old 30th July 2008, 08:59 PM
miller521 Offline
Registered User
 
Join Date: Jul 2008
Posts: 12
Will this method allow me to log out of the VNC and log back in and have the same applications open?

Also, how can I make sure its running on startup, I don't plan on having a monitor attachd to the machine and if I need to reboot, I'll need VNC to start back up automatically.
Reply With Quote
  #5  
Old 30th July 2008, 09:36 PM
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 43
Posts: 4,168
Quote:
Also, how can I make sure its running on startup, I don't plan on having a monitor attachd to the machine and if I need to reboot, I'll need VNC to start back up automatically.
If you did this part:
Code:
chkconfig vncserver on
Then you are ok to reboot the rig.
Reply With Quote
  #6  
Old 30th July 2008, 09:52 PM
miller521 Offline
Registered User
 
Join Date: Jul 2008
Posts: 12
Quote:
Originally Posted by marcrblevins
If you did this part:
Code:
chkconfig vncserver on
Then you are ok to reboot the rig.

Is there any difference between using VNC and NX or Xming? I just want to know which would work the best. I am not totally sure about the difference between then all.
Reply With Quote
  #7  
Old 30th July 2008, 10:50 PM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Quote:
Originally Posted by miller521
Will this method allow me to log out of the VNC and log back in and have the same applications open?
Yes.

Just close the VNC viewer. Next time you open VNC viewer, it is right where you left it.
Reply With Quote
  #8  
Old 30th July 2008, 10:53 PM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Quote:
Originally Posted by miller521
Is there any difference between using VNC and NX or Xming? I just want to know which would work the best. I am not totally sure about the difference between then all.
Try them. Find out first hand.

Edit: Please share your findings here. Also look at Cygwin/X http://www.cygwin.com . Tried it, but prefer VNC.

Last edited by briantan; 30th July 2008 at 11:10 PM.
Reply With Quote
  #9  
Old 30th July 2008, 11:07 PM
miller521 Offline
Registered User
 
Join Date: Jul 2008
Posts: 12
Quote:
Originally Posted by briantan
Try them. Find out first hand.
I'll take that as a, 'I have no information in order to answer your question correctly, so I'll just be rude and tell you to try them yourself'

I run into more rude people on this forum than any other Linux distro forum out there.
Reply With Quote
  #10  
Old 30th July 2008, 11:14 PM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Quote:
Originally Posted by miller521
I'll take that as a, 'I have no information in order to answer your question correctly, so I'll just be rude and tell you to try them yourself'

I run into more rude people on this forum than any other Linux distro forum out there.
It was more of 'I have never tried them, no interest in trying them, why don't you try them and share with us your findings.' If you want to interpret as rude, so be it.
Reply With Quote
  #11  
Old 31st July 2008, 10:05 AM
Blisk Offline
Registered User
 
Join Date: Sep 2004
Posts: 36
I have installed VNC server it works OK when I login on server.
But when I reboot machine, than VNC doesn't work, until I login again on server.

Can someone help me? I did all what is suggested here.
Reply With Quote
  #12  
Old 31st July 2008, 10:13 AM
marcrblevins Offline
Registered User
 
Join Date: Jun 2006
Location: Texas
Age: 43
Posts: 4,168
Miller, Briantan is NOT being rude, please give each a try if you have time with your hands and share us how it went. I'm sitting with VNC cause I use Windows and Linux...

Blisk, did you do this step?:
[/code]
su -
chkconfig vncserver on
[/code]
Then reboot your rig and see if it started at boot time.
Reply With Quote
  #13  
Old 31st July 2008, 10:56 AM
Blisk Offline
Registered User
 
Join Date: Sep 2004
Posts: 36
yes I tryed, but still VNC doesn't work until I login on server as root.
Reply With Quote
  #14  
Old 31st July 2008, 12:14 PM
miller521 Offline
Registered User
 
Join Date: Jul 2008
Posts: 12
Quote:
Originally Posted by marcrblevins
Miller, Briantan is NOT being rude, please give each a try if you have time with your hands and share us how it went. I'm sitting with VNC cause I use Windows and Linux...

Blisk, did you do this step?:
[/code]
su -
chkconfig vncserver on
[/code]
Then reboot your rig and see if it started at boot time.

I'm sorry, but it was just plain rude.

Could you imagine going somewhere and trying to ask the opinion of someone and simply be told 'Try it yourself'

I am an adult, I fully understand that I can try it myself, the reason for asking however was to see if anyone who has experience in the matter would give me their opinion on the technologies.

I'm glad when I open up my MSDN Developers magazine there isn't just article after article saying, Try this for yoruself, we don't have any info on how this works.
Reply With Quote
  #15  
Old 31st July 2008, 01:24 PM
briantan Offline
Registered User
 
Join Date: Jun 2008
Posts: 715
Quote:
Originally Posted by Blisk
yes I tryed, but still VNC doesn't work until I login on server as root.
What version of Fedora are you using and which desktop is configured. Could be a network problem. Would be helpful if you include output of these:

$ su -
# chkconfig --list NetworkManager
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
replace eth0 with your service interface
Reply With Quote
Reply

Tags
guide, mini, vino, vncserver

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Nexus Personal mini guide nickeh Guides & Solutions (No Questions) 13 17th June 2011 01:22 AM
Wolfenstein: Enemy Territory! (mini-guide for newbies like me) rpl Gamers' Lounge 7 9th January 2008 10:21 AM
vino-server cdlaforc Using Fedora 4 19th March 2007 06:09 AM
Mini-Guide: Installing grub from Fedora Core 5 (FC5) Rescue CD Nemesis02 EOL (End Of Life) Versions 3 5th June 2006 10:35 PM
Vino-Server jolly_green_gia Using Fedora 1 28th December 2004 06:44 PM


Current GMT-time: 05:35 (Friday, 18-04-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat