Howto: Set up VNC Server with resumable sessions

Source: Internet
Author: User
Set up VNC ServerWith resumable sessions on dapper (6.06)

1. Enable XDMCP

Code:
sudo gedit /etc/gdm/gdm.conf

Then find this rule:
# The greeter for XDMCP logins, usually you want a less graphically intensive
# Greeter here so it's better to leave this with gdmlogin
# Remotegreeter =/usr/lib/TPD/gdmlogin

Remove the '#' in the last line so there shoshould be:

# The greeter for XDMCP logins, usually you want a less graphically intensive
# Greeter here so it's better to leave this with gdmlogin
Remotegreeter =/usr/lib/TPD/gdmlogin

Note: before doing the next step, you need to make sure the extra repositories (e.g. Universe) are enabled:
Http://easylinux.info/wiki/Ubuntu#Ho...a_repositories

2. install required packages (vncserver and xinetd)

Code: code:

sudo apt-get install vnc4server xinetd

Note to amd64 users: the current version of vnc4server In the repositories has a bug, so you need to download and install the fixed vnc4 packages as shown below:

Code:

Code:
wget http://qt1.iq.usp.br/download/vnc4server_4.0-7.3_amd64.deb wget http://qt1.iq.usp.br/download/xvnc4viewer_4.0-7.3_amd64.deb sudo dpkg -i vnc4server_4.0-7.3_amd64.deb sudo dpkg -i xvnc4viewer_4.0-7.3_amd64.deb

3. SetVNCPasswd
Code:

Code:
sudo vncpasswd /root/.vncpasswd

4. AddVNCService to xinetd:
Code: code:

sudo gedit /etc/xinetd.d/Xvnc

Enter this into the new file:

Code: code:

service Xvnc { type = UNLISTED disable = no socket_type = stream protocol = tcp wait = yes user = root server = /usr/bin/Xvnc server_args = -inetd :1 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd port = 5901 }

5. Restart xinetd (usually there is no need to reboot, but occasionally it might be required)

Code:

Code:
sudo /etc/init.d/xinetd stop sudo killall Xvnc sudo /etc/init.d/xinetd start

6. That's it! To test that this is working first try to connect from the same machine (the machine we just set upVNC ServerOn ):

Code: code:

vncviewer localhost:1

You shoshould be prompted forVNCPassword, and then see the TPD login screen where you can login and start a new X session. If that works, you can now go ahead and try to connect from remote machine using your favoriteVNCClient (remember to first close the local vncviewer we started above). Remember to useVNC ServerMachine's domain name or IP address, followed by: 1 (e.g. 192.168.0.100: 1 ). if connecting locally as shown above works, but connecting remotely fails, then this means you have a problem with a firewall which is blocking some ports. see the notes below about how to deal with that.

Note about ports:VNC ServerSet up as shown uses TCP port 5901. if you are using firewall software (e.g. firestarter) on that machine, you need to allow incoming connections on this port. if you are using a router which assigns your machine a private address (e.g. 192.168.0.100) which is not accessible from the Internet, then you need to forward TCP port 5901 from the router to this machine.

Note about security: This setup allows any user to start an X-session remotely by logging in using his regular password (after startingVNCConnection usingVNCPassword), so if the user disconnects without logging out, any other user which knowsVNCPassword can connect afterwards and resume the same session that the first user started. So if you do not want to log out before disconnecting, it's advisable to at least lock yourVNCX-session screen. Also note that while a remote user is connected thruVNC, No other connection will be accepted. An idleVNCClient will be disconnected after one hour, but this can be changed by using the "-idletimeout" option in the server_args line in/etc/xinetd. d/xvnc. for example, you can add "-idletimeout 300" to change it to 5 minutes.

PS. This was copy/pasted from a few posts made by tichondrius and elemental666. I simply putted them together and tested everything! It works here for me now.

 

Additional:

Enable remote login
System-> Administration-> login window
Remote tab
Choose "Same as local"

Problem:

Get mine working

When I do: "vncviewer localhost: 1"

I get:
Vncviewer: connecttotcpaddr: CONNECT: Connection refused
Unable to connectVNC Server

Resolution:

System-> Administration-> login window
Click on Remote tab
Changed style to "Same as local"
Click on the "Configure XDMCP..." buton
Uncheck "honor indirect request"
Click Close on both windows

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.