Difference between revisions of "VNC"

From Amahi Wiki
Jump to: navigation, search
Line 22: Line 22:
 
= Server: Installation=  
 
= Server: Installation=  
  
To start the server in your HDA, you need install the vnc-server rpm package:
+
* To start the server in your HDA, you need install tigervnc-server rpm package:
  
From the '''root''' user:
+
* From the '''root''' user:
 +
yum -y install tigervnc-server xinetd
 +
chkconfig vncserver off
 +
service vncserver stop
  
<pre>
+
* Create /etc/gdm/custom.conf file and add the following:
yum -y install vnc-server
+
# GDM configuration storage
</pre>
+
[xdmcp]
 +
Enable=true
 +
[chooser]
 +
[security]
 +
DisallowTCP=false
 +
[debug]
  
  
When that is installed, run the server by typing this at the command line.
 
  
  vncserver
+
* Create /etc/xinetd.d/vnc1024 file and add the following:
 +
service vnc1024
 +
{
 +
disable = no
 +
socket_type = stream
 +
protocol = tcp
 +
group = tty
 +
wait = no
 +
user = nobody
 +
server = /usr/bin/Xvnc
 +
server_args = -inetd -query localhost -geometry 1024×768 -depth 16 -once -fp /usr/share/X11/fonts/misc -securitytypes=none
 +
}
  
The first time it runs it will ask for setting up a password. This will be the password for the '''root''' user. So, pick a good one.
+
* Now restart the xinetd service
 +
  service xinetd restart;
  
When the server starts, it will assign a session number (like :1, :2 ...)Remember it. You will need it when you launch the client. If the session number was set to ":1" then in the client you will enter
+
* Run your VNC Client and enter your HDA IP address.  You should now see your HDA Desktop login screen.  If you do not, a reboot may be requiredThis can be done via the dashboard or by executing the following:
+
  reboot now
  hda:1
 
  
You can also specify a window size of the session, which I typically do a hair smaller than the desktop I plan to use it from. Example for 1280x1024:
 
 
  vncserver -geometry 1250x1000
 
 
To make the VNC server start automatically after a reboot use this command as root:
 
 
  chkconfig vncserver on
 
  
 
<big>'''More detailed instructions are available [http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/ here].'''</big>
 
<big>'''More detailed instructions are available [http://www.g-loaded.eu/2005/11/10/configure-vnc-server-in-fedora/ here].'''</big>

Revision as of 12:56, 22 October 2010

Using VNC to use a remote desktop in the HDA

Using VNC is useful if:

  • You would like a Linux desktop to the HDA remotely
  • You run your HDA headless (no monitor) and like to still use a desktop in it
  • You would like to use a GUI to configure printer(s) or have a scanner or other device that requires a desktop program to configure and the machine is headless

What you need

  • A server
  • A client

Client: Installation

Download the client software and install:

  • For Windows
  • For MAC
  • For Linux, you have the vncviewer package, available in most, if not all distros

Server: Installation

  • To start the server in your HDA, you need install tigervnc-server rpm package:
  • From the root user:
yum -y install tigervnc-server xinetd
chkconfig vncserver off
service vncserver stop
  • Create /etc/gdm/custom.conf file and add the following:
  1. GDM configuration storage

[xdmcp] Enable=true [chooser] [security] DisallowTCP=false [debug]


  • Create /etc/xinetd.d/vnc1024 file and add the following:

service vnc1024 { disable = no socket_type = stream protocol = tcp group = tty wait = no user = nobody server = /usr/bin/Xvnc server_args = -inetd -query localhost -geometry 1024×768 -depth 16 -once -fp /usr/share/X11/fonts/misc -securitytypes=none }

  • Now restart the xinetd service
service xinetd restart;
  • Run your VNC Client and enter your HDA IP address. You should now see your HDA Desktop login screen. If you do not, a reboot may be required. This can be done via the dashboard or by executing the following:
reboot now


More detailed instructions are available here.

Running the Full Gnome Desktop

In order to run the full gnome desktop in vnc, you have to edit this file in the home directory of the user you want to run vnc on:

First kill the VNC session: vncserver -kill :1

.vnc/xstartup

and make sure it has these two lines uncommented, per the comment there:

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

Now restart the vncserver: vncserver

I use remote desktop viewer, hit the connect button and type hda:1
That should be it.

Killing the Server

To kill the server in session :1, you can do:

vncserver -kill :1

Setup Automatic Login

Automatic login is useful if you want to run a headless HDA and enjoy the benefits that VNC provides without having to login from the command line via SSH and manually start X.

Add the following to the file /etc/gdm/custom.conf

#Enable Auto login to the GNOME desktop
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=<username>
TimedLoginEnable=true
TimedLogin=<username>
TimedLoginDelay=0

Replace <username> with the username that you want to automatically login to the GNOME desktop.

If you want to have a script help you to accomplish the task, download AutomaticLogin.rb and run the script as root (directions to accomplish this are below).

Login as root then run the following commands:

cd /tmp
wget http://wiki.amahi.org/images/a/a3/AutomaticLogin.rb
chmod +x AutomaticLogin.rb
./AutomaticLogin.rb

Then follow the prompts to guide you in the setup.

Troubleshooting for Vista

This helpful page has helped with blocking VNC