![]() |
ubuntu.com - launchpad.net - ubuntu help
|
|
|||||||
|
Outdated Tutorials & Tips Outdated Tutorials & Tips |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Way Too Much Ubuntu
![]() Join Date: Jan 2005
Beans: 210
|
HOWTO: Set up VNC server with resumable sessions
Warning!
This howto is old, unsupported, and relies on a broken package. This should be used as reference only. So here's the complete list of steps that are required to set the VNC server that any user can login into and start a session. It is also persistent, meanning that even if you disconnect the VNC client your X session will not end (unless you explicitly log out) and you can reconnect to the same session again. The VNC server uses a separate display (:1) than your regular X server, which works with your physical display (:0). So two sessions can be active at the same time (one person sitting at the physical display and another remotely connecting using VNC). 1. Enable XDMCP System->Administration->Login Screen Setup Tab Security->Enable XDMCP Tab XDMCP--> You can disable "Honor Indirect Requests" 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:
sudo apt-get install vnc4server xinetd 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. Set the VNC passwd Code:
sudo vncpasswd /root/.vncpasswd Code:
sudo gedit /etc/xinetd.d/Xvnc 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
}
Code:
sudo /etc/init.d/xinetd stop sudo killall Xvnc sudo /etc/init.d/xinetd start Code:
vncviewer localhost:1 Note about ports: The VNC server set 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 starting the VNC connection using the VNC password), so if the user disconnects without logging out, any other user which knows the VNC password 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 your VNC X-session screen. Also note that while a remote user is connected thru VNC, no other connection will be accepted. An idle VNC client 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. Last edited by dmizer; May 7th, 2009 at 11:28 PM.. |
|
|
|
|
|
#2 |
|
Guest
Beans: n/a
|
Re: HOWTO: Set up VNC server with resumable sessions
u are all set.. the other howto on VNC to GDM stands defunct from now on.
|
|
|
|
#3 |
|
Just Give Me the Beans!
![]() Join Date: Apr 2005
Beans: 54
|
Re: HOWTO: Set up VNC server with resumable sessions
Tichondrius, Thanks a lot for the update. As I understand, I should remove the old /etc/xinted.conf file which the old how-to told us to create, right? I also found that XDMCP uses port 177 with UDP protocol. So this port should be taken in the router's config.(i.e. firewall and port forwarding)?
Can it be used to let a specific user login via vnc? Update : This is the output I got after I borught back /etc/xinited.conf to its original form and then following Tichondrius how-to. I have an AMD chipset, so I installed vncserver(instead of vnc4server). Moreover, I have opened port 177 in my router's firewall with UDP protocol and forwarded this port to my machine's internal LAN IP address. Also port 5901 is open in my firewall and forwarded to my laptop's LAN IP. From the old how-to I still have this line in /etc/services vnc1024 5901/tcp # VNC & GDM Should I remove it? I am confused. I got this response by issuing the following command : $ vncviewer localhost:1 VNC viewer version 3.3.7 - built Sep 27 2005 11:12:00 Copyright (C) 2002-2003 RealVNC Ltd. Copyright (C) 1994-2000 AT&T Laboratories Cambridge. See http://www.realvnc.com for information on VNC. ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104) Last edited by mssm; January 28th, 2006 at 04:44 AM.. |
|
|
|
|
|
#4 |
|
Way Too Much Ubuntu
![]() Join Date: Jan 2005
Beans: 210
|
Re: HOWTO: Set up VNC server with resumable sessions
You only need to do the steps in this howto. All other steps mentioned in the old howto (like editing /etc/xinetd.conf or /etc/services) are not required and may in fact interfere with this setup.
You need to have the original file /etc/xinetd.conf (from the xinetd package) which looks like this: Code:
# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/
defaults
{
}
includedir /etc/xinetd.d
After you've restarted the xinetd as shown in the step 5, you can check that xinetd is listening on port 5901 by doing this: Code:
sudo netstat -tap | grep xinetd tcp 0 0 *:5901 *:* LISTEN 10932/xinetd Now you can try to connect with the local VNC client Code:
vncviewer localhost:1 Last edited by Tichondrius; January 28th, 2006 at 07:09 AM.. |
|
|
|
|
|
#5 |
|
Just Give Me the Beans!
![]() Join Date: Apr 2005
Beans: 54
|
Re: HOWTO: Set up VNC server with resumable sessions
Hi,
I have followed your instruction in toto but this command yields nothing : sudo netstat -tap | grep xinetd It just stays there without giving any output. Also I think the last line of step 5 of your how-to should be sudo /etc/init.d/xinetd start instead of sudo /etc/init.d/xinetd/start. I have also commented the line I entered in /etc/services following the old how-to. I am running kubuntu though the display manager for login is gdm. Should I reboot then? Also I installed vncserver and not vnc4server since I have AMD64 chipset. Should I install vnc4server instead of vncserver? Last edited by mssm; January 28th, 2006 at 08:04 AM.. |
|
|
|
|
|
#6 | |||
|
Way Too Much Ubuntu
![]() Join Date: Jan 2005
Beans: 210
|
Re: HOWTO: Set up VNC server with resumable sessions
Quote:
Code:
sudo netstat -tap | grep xinetd Code:
grep xinetd /var/log/syslog Quote:
Quote:
Let me know if this works. Last edited by Tichondrius; January 28th, 2006 at 08:39 AM.. |
|||
|
|
|
|
|
#7 |
|
Just Give Me the Beans!
![]() Join Date: Apr 2005
Beans: 54
|
Re: HOWTO: Set up VNC server with resumable sessions
Thanks Tichondrius. I rebooted and this time I got an answer from both the commands :
$ sudo netstat -tap | grep xinetd tcp 0 0 *:5901 *:* LISTEN 8397/xinetd $ grep xinetd /var/log/syslog Jan 28 15:05:06 localhost xinetd[8397]: Reading included configuration file: /etc/xinetd.d/Xvnc [file=/etc/xinetd.conf] [line=11] Jan 28 15:05:06 localhost xinetd[8397]: Reading included configuration file: /etc/xinetd.d/chargen [file=/etc/xinetd.d/chargen] [line=12] Jan 28 15:05:06 localhost xinetd[8397]: Reading included configuration file: /etc/xinetd.d/daytime [file=/etc/xinetd.d/daytime] [line=28] Jan 28 15:05:06 localhost xinetd[8397]: Reading included configuration file: /etc/xinetd.d/echo [file=/etc/xinetd.d/echo] [line=26] Jan 28 15:05:06 localhost xinetd[8397]: Reading included configuration file: /etc/xinetd.d/time [file=/etc/xinetd.d/time] [line=26] Jan 28 15:05:06 localhost xinetd[8397]: removing chargen Jan 28 15:05:06 localhost xinetd[8397]: removing chargen Jan 28 15:05:06 localhost xinetd[8397]: removing daytime Jan 28 15:05:06 localhost xinetd[8397]: removing daytime Jan 28 15:05:06 localhost xinetd[8397]: removing echo Jan 28 15:05:06 localhost xinetd[8397]: removing echo Jan 28 15:05:06 localhost xinetd[8397]: removing time Jan 28 15:05:06 localhost xinetd[8397]: removing time Jan 28 15:05:06 localhost xinetd[8397]: Started working: 1 available service Then $ vncviwer localhost:1 gives me the same msg. as before. After this again I issued : $ grep xinetd /var/log/syslog which yielded Deactivating service Xvnc due to excessive incoming connections. Restarting in 10 seconds. Jan 28 15:08:18 localhost xinetd[8397]: Activating service Xvnc But there were many error msgs. What exactly should I get after issuing vncviewer localhost:1? Last edited by mssm; January 28th, 2006 at 09:20 AM.. |
|
|
|
|
|
#8 |
|
A Carafe of Ubuntu
![]() Join Date: Dec 2005
Beans: 108
|
Re: HOWTO: Set up VNC server with resumable sessions
I also get the following when issuing:
# vncviewer localhost:1 VNC viewer version 3.3.7 - built Sep 27 2005 12:10:30 Copyright (C) 2002-2003 RealVNC Ltd. Copyright (C) 1994-2000 AT&T Laboratories Cambridge. See http://www.realvnc.com for information on VNC. ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104) I am also running AMD64, with vncserver (not vnc4server) installed. |
|
|
|
|
|
#9 |
|
A Carafe of Ubuntu
![]() Join Date: Dec 2005
Beans: 108
|
Re: HOWTO: Set up VNC server with resumable sessions
I also get as mssm does:
# grep xinetd /var/log/syslog Jan 28 08:29:56 localhost xinetd[13968]: warning: can't get client address: Transport endpoint is not connected : : : Jan 28 08:29:57 localhost xinetd[14180]: warning: can't get client address: Transport endpoint is not connected Jan 28 08:29:57 localhost xinetd[14181]: warning: can't get client address: Transport endpoint is not connected Jan 28 08:29:57 localhost xinetd[14182]: warning: can't get client address: Transport endpoint is not connected Jan 28 08:29:57 localhost xinetd[14183]: warning: can't get client address: Transport endpoint is not connected Jan 28 08:29:57 localhost xinetd[14184]: warning: can't get client address: Transport endpoint is not connected Jan 28 08:29:57 localhost xinetd[14185]: warning: can't get client address: Transport endpoint is not connected Jan 28 08:29:57 localhost xinetd[14186]: warning: can't get client address: Transport endpoint is not connected Jan 28 08:29:57 localhost xinetd[14187]: warning: can't get client address: Transport endpoint is not connected Jan 28 08:29:57 localhost xinetd[10673]: Deactivating service Xvnc due to excessive incoming connections. Restarting in 10 seconds. Jan 28 08:30:07 localhost xinetd[10673]: Activating service Xvnc What does this mean? Last edited by kacheng; January 28th, 2006 at 09:44 AM.. |
|
|
|
|
|
#10 |
|
A Carafe of Ubuntu
![]() Join Date: Dec 2005
Beans: 108
|
Re: HOWTO: Set up VNC server with resumable sessions
I was just going through the HOWTO again and noticed that the Xvnc service doesn't seem to start:
$ sudo /etc/init.d/xinetd stop Stopping internet superserver: xinetd. $ sudo killall Xvnc Xvnc: no process killed $ sudo /etc/init.d/xinetd start Starting internet superserver: xinetd. $ sudo /etc/init.d/xinetd stop Stopping internet superserver: xinetd. $ sudo killall Xvnc Xvnc: no process killed $ sudo /etc/init.d/xinetd start Starting internet superserver: xinetd. I'll reboot and try again. |
|
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|