PDA

View Full Version : HOWTO: Set up VNC server with resumable sessions



Pages : [1] 2 3

Tichondrius
January 27th, 2006, 07:51 PM
Warning!
This howto is old, unsupported, and relies on a broken package. This should be used as reference only.

CLOSED THREAD

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#How_to_add_extra_repositories

2. Install required packages (vncserver and xinetd)


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:



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

sudo vncpasswd /root/.vncpasswd

4. Add vnc service to xinetd:

sudo gedit /etc/xinetd.d/Xvnc

Enter this into the new file:



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)


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 up the VNC server on):


vncviewer localhost:1

You should be prompted for the VNC password, and then see the GDM 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 favorite VNC client (remember to first close the local vncviewer we started above). Remember to use the VNC server machine'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: 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.

arnieboy
January 27th, 2006, 10:59 PM
u are all set.. the other howto on VNC to GDM stands defunct from now on.

mssm
January 28th, 2006, 09:40 AM
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)

Tichondrius
January 28th, 2006, 12:00 PM
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:



# Simple configuration file for xinetd
#
# Some defaults, and include /etc/xinetd.d/

defaults
{


}

includedir /etc/xinetd.d


Notice how it instructs xinetd to load all the file in directory /etc/xinetd.d which is were we put the new Xvnc service configuration file. So restore the original /etc/xientd.conf if you made a backup copy, or just edit it to look like shown above.

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:


sudo netstat -tap | grep xinetd

And you should see a line like this: (your process ID doesn't have to be the same as mine 10932)

tcp 0 0 *:5901 *:* LISTEN 10932/xinetd

Now you can try to connect with the local VNC client


vncviewer localhost:1

Let me know if this works.

mssm
January 28th, 2006, 12:57 PM
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?

Tichondrius
January 28th, 2006, 01:20 PM
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?

Yes, please reboot. And then check again if xinetd is listening on port 5901 using the command


sudo netstat -tap | grep xinetd

as I explained previously. If it still doesn't show anything, you should check the system log to see why xinetd didn't read the Xvnc service file.


grep xinetd /var/log/syslog

And you should see a few lines showing xinetd activity. Look for a line mentioning xvnc, it should look similar to this:


Jan 27 03:42:32 localhost xinetd[10932]: Reading included configuration file: /etc/xinetd.d/Xvnc [file=/etc/xinetd.conf] [line=11]

Look for any error messages, or if it loaded successfully you should see another line which looks like this:


Jan 27 03:42:32 localhost xinetd[10932]: Started working: 1 available service

btw, you are right about the spelling mistake in step 5, I corrected it. Also I understand you are using kubuntu on amd64, and if vnc4server package is not available for amd64, then vncserver (which is version 3.x) should be OK.

Let me know if this works.

mssm
January 28th, 2006, 02:15 PM
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?

kacheng
January 28th, 2006, 02:32 PM
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.

kacheng
January 28th, 2006, 02:39 PM
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?

kacheng
January 28th, 2006, 05:34 PM
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.

mssm
January 28th, 2006, 06:23 PM
Yes, I also noticed like kacheng that no process is killed after issuing the command killall Xvnc.

Tichondrius
January 29th, 2006, 12:39 AM
From your description it seems that after the reboot xinetd is listening on port 5901 and the setup is correct.

xinetd is supposed to start Xvnc as soon as it gets an incoming connection from a VNC client.

I assume you copied /etc/xined.d/Xvnc exactly from this howto without changing anything, right ? if so, then maybe the fact you are using the old vnc sever (version 3.x) is related because it might not support some of the arguments ?

After you start the vncviewer, xinetd should spwan Xvnc with the arguments specified in the Xvnc file we created in step 3. So immediately after starting vncviewer (and even before entering the vnc password), you can check the Xvnc started by issueing this command:


ps -ef | grep Xvnc

This should show something like this:


root 9777 9527 0 15:28 ? 00:00:00 Xvnc -inetd :1 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

If it doesn't work it means that Xvnc wasn't started. So in that case I would suggest to try starting Xvnc manually (not from within xinetd) just to make sure it can run at all (we will use screen :2 so it doesn't overlap with the original Xvnc):


sudo Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

Now, from another terminal try to connect:


vncviewer localhost:2

tell me if that works......

mssm
January 29th, 2006, 10:27 AM
Yes, I copied the /etc/xinetd.d/Xvnc exactly as you mentioned.

I issued :
$ vncviewr localhost:1
which yields
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)

As you can see I am running vncserver 3.3.7, since I have an AMD64 chipset and in this matter I followed the old how-to by not installing vnc4server.

After this command I issued
$ps -ef | grep Xvnc
which yields
myname 19963 8823 0 11:12 pts/1 00:00:00 grep Xvnc

Now I issued the big command :
$sudo Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

It asked for root passwd :
Password:
After entering the password, it said
Unrecognized option: -DisconnectClients=0
use: X [:<display>] [option]
-a # mouse acceleration (pixels)
-ac disable access control restrictions
-audit int set audit trail level
-auth file select authorization file
bc enable bug compatibility
-bs disable any backing store support
-c turns off key-click
c # key-click volume (0-100)
-cc int default color visual class
-co file color database file
-core generate core dump on fatal error
-dpi int screen resolution in dots per inch
-deferglyphs [none|all|16] defer loading of [no|all|16-bit] glyphs
-f # bell base (0-100)
-fc string cursor font
-fn string default font name
-fp string default font path
-help prints message with these options
-I ignore all remaining arguments
-ld int limit data space to N Kb
-lf int limit number of open files to N
-ls int limit stack space to N Kb
-nolock disable the locking mechanism
-logo enable logo in screen saver
nologo disable logo in screen saver
-nolisten string don't listen on protocol
-p # screen-saver pattern duration (minutes)
-pn accept failure to listen on all ports
-nopn reject failure to listen on all ports
-r turns off auto-repeat
r turns on auto-repeat
-s # screen-saver timeout (minutes)
-su disable any save under support
-t # mouse threshold (pixels)
-terminate terminate at server reset
-to # connection time out
-tst disable testing extensions
ttyxx server started from init on /dev/ttyxx
v video blanking for screen-saver
-v screen-saver without video blanking
-wm WhenMapped default backing-store
-x string loads named extension at init time
-query host-name contact named host for XDMCP
-broadcast broadcast for XDMCP
-indirect host-name contact named host for indirect XDMCP
-port port-num UDP port number to send messages to
-once Terminate server after one session
-class display-class specify display class to send in manage
-cookie xdm-auth-bits specify the magic cookie for XDMCP
-displayID display-id manufacturer display ID for request
Xvnc version 3.3.7 - built Sep 27 2005 11:14:24

-geometry WxH set framebuffer width & height
-depth D set framebuffer depth
-pixelformat format set pixel format (BGRnnn or RGBnnn)
-rfbport port TCP port for RFB protocol
-rfbwait time max time in ms to wait for RFB client
-nocursor don't put up a cursor
-rfbauth passwd-file use authentication on RFB protocol
-httpd dir serve files via HTTP from here
-httpport port port for HTTP
-deferupdate time time in ms to defer updates (default 40)
-economictranslate less memory-hungry translation
-maxrects num max number of rectangles in an update (default 50)
-desktop name VNC desktop name (default x11)
-alwaysshared always treat new clients as shared
-nevershared never treat new clients as shared
-dontdisconnect don't disconnect existing clients when a new non-shared
connection comes in (refuse new connection instead)
-localhost only allow connections from localhost
-inetd Xvnc is launched by inetd

Although I understand that it didn't work, even then I tried to issue this command from another workspace

$vncviewer localhost:2

which gave the expected result :

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.
vncviewer: ConnectToTcpAddr: connect: Connection refused
Unable to connect to VNC server

Is it possible that I am using vncserver 3.3.7, it doesn't understand the commnds given in /etc/xinetd.d/Xvnc file? This file also contains the option -DisconnectClients and the above output shows that it is not a valid option.

Tichondrius
January 29th, 2006, 12:00 PM
Ok, just for you I installed vncserver package on my system instead of vnc4server. It looks like this old version of vncserver has slighlty different options.

Here's how your /etc/xinetd.d/Xvnc config file should look like:



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 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd
port = 5901
}


Now repeat step 5, and then try to connect:


vncviewer localhost:1

If that doesn't work then reboot and try to connect again.

Now I'm pretty sure it should work......keep us posted !

mssm
January 29th, 2006, 07:55 PM
Nope, it's not working.

I issued the commands of step 5 after I modified /etc/xinetd.d/Xvnc to its latest form and rebooted the machine. Next I issued the 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)

What does this output imply?

Finally I issued the command as a root, after going to superuser shell by issuing su. Alas, I have no success this time too.

Did it work for your machine? Is it an AMD64?

Tichondrius
January 29th, 2006, 09:08 PM
Turn OFF your firewall software (e.g. firestarter) - or at least add a rule to allow inbound connections on all ports from the localhost. I just realized it might be causing a problem even when connecting from localhost.

Now Try this - open a terminal and enter this command:


sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd

The Xvnc program should start correctly which will be confirmed by its output which will include a line tlike this:


29/01/06 03:20:11 Listening for VNC connections on TCP port 5902

Now, open another terminal (do not kill the Xvnc you started above) and give this command:


vncviewer localhost:2

You SHOULD be able to connect and see a login screen. Otherwise something is messed up in your system. And yes, this works for me 100%.

mssm
January 30th, 2006, 10:45 AM
Turn OFF your firewall software (e.g. firestarter) - or at least add a rule to allow inbound connections on all ports from the localhost. I just realized it might be causing a problem even when connecting from localhost.

Now Try this - open a terminal and enter this command:


sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -NeverShared -rfbauth /root/.vncpasswd

The Xvnc program should start correctly which will be confirmed by its output which will include a line tlike this:



Now, open another terminal (do not kill the Xvnc you started above) and give this command:


vncviewer localhost:2

You SHOULD be able to connect and see a login screen. Otherwise something is messed up in your system. And yes, this works for me 100%.

I do not have any firewall software installed in my computer. On my cable modem cum router I have the ports 5900 and 5901 both open in firewall config. for both incoming and outgoing requests. Also these ports are forwarded to my internal IP address. Should I try to open any other ports? I did one extra thing : I have opened a UDP port no. 177 in my firewall for XDMCP. I shall turn it off and try.

I am at my office right now. So I shall try all these after I get back home. Thanks a lot for your patience and help.

BTW, I have tried a completely different thing : I tried to install tightvnc java-client from this thread

http://www.ubuntuforums.org/showthread.php?t=107503&highlight=tightvnc

and it is perfectly working for me. I think this is allowed only when remote desktop is turned on. From my office computer, I just issued te command

$vncviewer myservername.org

It opened the login screen but the one due to tightvnc java based client. Issuing the command

$vncviewer myservername.org:1

gives connection reset by peer. To avoid confusion, I should add that vncserver was not working even befoer installing tightvnc java client, since it may seem that they are kind of conflicting each other. I forget to ask one thing: should I turn off ubuntu's built-in remote desktop feature for vncserver to work properly?

mssm
January 30th, 2006, 09:11 PM
Yes, Tichondrius, it works !!!

After issuing that big command I got this output

30/01/06 22:03:59 Xvnc version 3.3.7 - built Sep 27 2005 11:14:24
30/01/06 22:03:59 Copyright (C) 2002-2003 RealVNC Ltd.
30/01/06 22:03:59 Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
30/01/06 22:03:59 All Rights Reserved.
30/01/06 22:03:59 See http://www.realvnc.com for information on VNC
30/01/06 22:03:59 Desktop name 'x11' (strings:2)
30/01/06 22:03:59 Protocol version supported 3.3
30/01/06 22:03:59 Listening for VNC connections on TCP port 5902

From another terminal, when I I issued :

$vncviewer localhost:2

I got my login screen along with this output inside that terminal :
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.
VNC server supports protocol version 3.3 (viewer 3.3)
Password:
VNC authentication succeeded
Desktop name "root's x11 desktop (strings:2)"
Connected to VNC server, using protocol version 3.3
VNC server default format:
16 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 31 green 63 blue 31, shift red 11 green 5 blue 0
Using default colormap and visual, TrueColor, depth 24.
Got 256 exact BGR233 colours out of 256
Using BGR233 pixel format:
8 bits per pixel.
True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
Throughput 20000 kbit/s - changing to Hextile
Throughput 20000 kbit/s - changing from 8bit
Using viewer's native pixel format:
8 bits per pixel.
True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
Throughput 20000 kbit/s - changing to Hextile
Throughput 20000 kbit/s - changing from 8bit
Using viewer's native pixel format:
32 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Throughput 20000 kbit/s - changing to Raw

So what should I do now? Should I change my /etc/xinetd.d/Xvnc? I should also add that after startind xinetd by issuing

$sudo /etc/init.d/xinetd start

and then issuing this command :

$ps -ef |grep xinetd

yields

myname 26831 24082 0 22:59 pts/2 00:00:00 grep Xvnc

It seems Xvnc is not running.

Another wild guess: does it depend in anyway on the permission of this file?

Tichondrius
January 30th, 2006, 11:13 PM
Great, Xvnc works for you when you start manually, so now the only issue is to get it started by xinetd. Let me just clarify that xinetd listens on the requested port but only starts Xvnc when a client is attempting to connect. So it's ok that you don't see Xvnc running before connecting with a client.

So yeah, now go ahead and change the /etc/xinetd.d/Xvnc file to have the same options (on the server_args line) as when you started it manually, except that you should use screen :1 and also the "-inetd" option. That's exactly what I listed in my message #14 above.

Then try to connect to localhost:1 and see that it works. If it doesn't then maybe it's something with your Kubuntu display manager that is different than regular GDM on Ubuntu.

BTW, you can also try to connect from another PC to the Xvnc you started locally by using the VNC server machine address with :2 appended.

kacheng
January 31st, 2006, 03:34 PM
mssm I'm very jealous that you got it to work!

I just upgraded to Dapper to try and solve my nvidia driver issue. Now I can't install vncserver due to dependency issue.
vncserver:
Depends: xserver-common but it is not installable

However, I can install tightvncserver, but when I run your command Tichondrius, I get:

# sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd

Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'
MAXSOCKS=1000
Segmentation fault


Is this something to do with Dapper and it's changes in the Xserver?
How would I fix it?

mssm
January 31st, 2006, 08:35 PM
Tichondrius, I observed a strange thing. Afetr starting the xinetd service, If I issue the command

$ vncviewer localhost:0

I am getting the current desktop screen but not the login screen which I obtained last time by issuing that big command.

Update : This occurred due to enabling ubuntu's built-in remote desktop feature. When I turn off this feature, the above command yields nothing. But still vncviewer localhost:1 gave the error msg. I thought if this remote desktop feature is interfering with the vncserver setup, but it's not the case.

Moreover, I should add that right now I am working in gnome desktop and my /etc/xinetd.d/Xvnc file is exactly identical to the config. you alluded to in post #14. And still, the error msg. with vncviewer localhost:1. So using kDE desktop is not an issue. I shall follow method of elimination to pinpoint the trouble, if I can. If anybody else can help us, it will be really appreciated.

Kacheng, sorry, I could not help you since I am a novice in this regard but you can try to install the tightvnc java-client from the thread I linked to in my previous post. You need to enable ubuntu's built-in remote desktop so that it can work and of course if you are behind a router, you need to fwd those ports.

mdr
February 2nd, 2006, 03:48 AM
sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd


I too am trying this on AMD 64., Following this thread I get to this point and I all I get is

Segmentation Fault

:confused:

kacheng
February 2nd, 2006, 03:54 PM
mssm - thanks, I have no problem with using vnc and the remote desktop - even can tunnel over ssh. That works great.


However, at some point I'd really like to get the XDMCP working properly and have the ability to utilize several sessions. (e.g. two people logged in at the same time).

CTD
February 3rd, 2006, 01:52 AM
using a fresh install of 5.10. running


sudo apt-get install vncserver xinetd
yeilds me the following results:


Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package vnc4server
what am I missing here? Do I need to add an additional installation source?

EDIT: I found the package in a different installation source. Open package manager, go to settings->repositories, clicked the 'community maintained' button.

vnc4server installed and works like a champ. Thanks!

linuxfan
February 3rd, 2006, 06:47 AM
mssm - thanks, I have no problem with using vnc and the remote desktop - even can tunnel over ssh. That works great.


However, at some point I'd really like to get the XDMCP working properly and have the ability to utilize several sessions. (e.g. two people logged in at the same time).

Hi Kacheng,

Is there a How-To for tunnelling VNC over SSH? Some pointers would help a lot ... thanks ;)

Tichondrius
February 3rd, 2006, 12:15 PM
Yes, you are suipposed to enable the extra repositories because vnc4server is from the universe repository which is not enabled by default.

http://easylinux.info/wiki/Ubuntu#How_to_add_extra_repositories

CosMix
February 3rd, 2006, 04:57 PM
Hey guys,

ive installed vnc and it works fine...on one machine, while on the other, always the same breezy badger 5.10 installation, all i get is grey screen when i log onto vnc....
i mean....the server is obviously running, and i can access it from outside...but when i connect all i see is grey screen instead of my ubuntu desktop....what could this be? :-k


Gorazd

mssm
February 3rd, 2006, 09:34 PM
Hey guys,

ive installed vnc and it works fine...on one machine, while on the other, always the same breezy badger 5.10 installation, all i get is grey screen when i log onto vnc....
i mean....the server is obviously running, and i can access it from outside...but when i connect all i see is grey screen instead of my ubuntu desktop....what could this be? :-k


Gorazd

Hi cosmix, good to learn that you are running vnc on one machine? Did you follow Tichondrius's how-to? Are you behind a router? I am still trying hard.

kacheng
February 3rd, 2006, 09:53 PM
Hi Kacheng,

Is there a How-To for tunnelling VNC over SSH? Some pointers would help a lot ... thanks ;)


Yes here's one:

http://pigtail.net/LRP/vnc/

There are many others.

mssm
February 4th, 2006, 07:02 PM
Yes here's one:

http://pigtail.net/LRP/vnc/

There are many others.

Hi Kacheng, thanks for the link and thanks for your appreciation before.

I found that freenx is much smoother less jerky and easy to install than vnc. Moreover, it supports vnc too. There is no headache for port opening and forwarding, since it uses standard ssh port and hence the whole session can be encrypted. So I switched to freenx. I followed this thread :

http://www.ubuntuforums.org/showthread.php?t=97277

Good luck!

kacheng
February 5th, 2006, 01:52 AM
Thanks mssm, unfortunately, I have an amd64 system, and I'm running Dapper, and the repositories don't exist yet for me.

kacheng
February 9th, 2006, 10:46 PM
Tichondrius,

Any insight as to why:

# sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd

yields:

Couldn't open RGB_DB '/usr/X11R6/lib/X11/rgb'
MAXSOCKS=1000
Segmentation fault


Again, I'm on amd64 using tightvncserver and xinetd.

Thanks.

Jaygo333
February 15th, 2006, 07:08 AM
Where Would I be able to add the IdelTimeout.
Right after the end of /etc/xvnc?

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 24 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd
port = 5901
==> idletimeout -300
}

Or where?

:h34r: Jaygo333 :h34r:

Eternal Blade
February 15th, 2006, 06:12 PM
nevermind, I got it figured out

chugru
February 15th, 2006, 08:16 PM
Hi, All...

I'm a new kubuntu user, and I'm very interested in this thread. I'm a little baffled though by the fact that I have KDE rather than Gnome, and I don't know what to do with the initial part concerning settings for XDMCP??

Would someone please give me some suggestions??

Thanks...

Tichondrius
February 15th, 2006, 10:34 PM
Where Would I be able to add the IdelTimeout.
Right after the end of /etc/xvnc?

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 24 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd
port = 5901
==> idletimeout -300
}

Or where?

:h34r: Jaygo333 :h34r:


look at the HOWTO again:


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.

You have to add it on the "server_args = ...." line:



server_args = -inetd :1 -query localhost -geometry 1024x768 -depth 24 -once -IdleTimeout 300 -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd

TherapyQuestionMark
February 17th, 2006, 04:04 AM
How would I go about adding the ability to connect to my server through a web based java client?

kacheng
February 17th, 2006, 04:44 AM
You might try something like SSL Explorer.

However, this thread related mainly to connecting securely to your computer using VNC.

TherapyQuestionMark
February 17th, 2006, 07:00 AM
that's what I meant, Vnc's java applet embedded in a webpage.

mbeach
February 19th, 2006, 04:11 AM
thanks Tichondrius for the great info. All is working for me as you lay it out. However, I'm trying to get vnc4config to work and have met with failure thus far.

If I have the working INETD model on the go, and try:

~$ sudo vnc4config -display 0 -connect myhost:myport

I get the error:

vnc4config: unable to open display "0"

and if I use

~$ sudo vnc4config -display :0 -connect myhost:myport
I get:

No VNC extension on display :0


(the same error is observed if I try -display 1 or variations such as -display localhost:0 or -display localhost:1 etc...)

So I tried starting the Xvnc manually with the one liner starting with:

~$ sudo Xvnc :2 -query localhost -geometry .....
which starts the Xvnc server nicely with the following:


Xvnc version 4.0 - built Apr 19 2005 04:26:49
Underlying X server release 40200000, The XFree86 Project, Inc

Sat Feb 18 22:58:07 2006
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5902
vncext: created VNC server for screen 0

so I try from another terminal:

~$ sudo vnc4config -display :2 -connect myhost:myport
which yeilds:


Xlib: connection to ":2.0" refused by server
Xlib: No protocol specified
vnc4config: unable to open display ":2"

and in the terminal runing the Xvnc, this audit appears:

AUDIT: Sat Feb 18 23:00:38 2006: 22313 Xvnc: client 5 rejected from local host

The pc at MYHOST is running a listening VNC viewer which I can connect to with a WinVNC 'add new client' option. From my reading I thought vncconfig would start Xvnc if the -connect option was given which does not seem to be the case, but if there is a manually started Xvnc running, there does seem to be some interactivity between vncconfig and the Xvnc server.

As you obviously know your stuff, any chance you could tell me if you can get vnc4config to initiate a connection to a remote server running a listening vnc viewer?

mb.
( Ubuntu 5.10 on a Dell Optiplex GX150 [I'm extending the life of some older pcs] )

Jeromy
February 19th, 2006, 09:33 AM
Below is a fix for users having trouble on AMD64 such as the "Segmentation Fault" or SystemException. I had all the same problems as mssm and kacheng with the vncserver on an amd64 system.

There is a bug in vncserver for AMD64 that has been discussed in detail over at the Debian forums.
http://lists.debian.org/debian-amd64/2004/11/msg00064.html (late 2004)
http://lists.debian.org/debian-amd64/2005/12/msg00255.html (late 2005)

The work-around is briefly discussed at Ubuntu 5.10 Support (GNOME) > AMD 64 Users :
http://ubuntuforums.org/archive/index.php/t-82548.html

Repeating the work-around, until there's a trusted source for vnc4server for amd64, you can download the fixed vnc4server and vncviewer as .deb packages from:

http://qt1.iq.usp.br/download/
vnc4server_4.0-7.3_amd64.deb [2.0M]
xvnc4viewer_4.0-7.3_amd64.deb [140K]

You then simply need to manually install them using dpkg from the download directory:


sudo dpkg -i vnc4server_4.0-7.3_amd64.deb
sudo dpkg -i xvnc4viewer_4.0-7.3_amd64.deb


Once installed, Tichondrius' HOWTO works perfectly following the original instructions.
It would be useful if a reference to the fix for AMD64 was included as the start of this how-to until vnc4server is available for amd64 by normal means.

Thanks!

simon0t7
February 19th, 2006, 03:59 PM
excellent howto, got it to work and it doesn't have problems with refreshing the screen unlike the other vnc servers i've tried

SSH Tech
February 20th, 2006, 03:37 AM
Okay, so this setup will allow me to start a new session on display 1. But can I resume an existing session on my physical display 0? Let's say I start a session at home normally on display 0. I start up gaim and firefox then lock the screen and go over to a friend's place. Can I resume this session using this method, or only start a new session?

Tichondrius
February 20th, 2006, 07:36 PM
Okay, so this setup will allow me to start a new session on display 1. But can I resume an existing session on my physical display 0? Let's say I start a session at home normally on display 0. I start up gaim and firefox then lock the screen and go over to a friend's place. Can I resume this session using this method, or only start a new session?


No, this howto will not do that. I actually have VNC on display :0 working as well using x11vnc which is a VNC extension to the regular X server (e.g. xorg). I plan to publish a separate howto on that. Stay tuned.

Tichondrius
February 20th, 2006, 07:46 PM
Below is a fix for users having trouble on AMD64 such as the "Segmentation Fault" or SystemException. I had all the same problems as mssm and kacheng with the vncserver on an amd64 system.

There is a bug in vncserver for AMD64 that has been discussed in detail over at the Debian forums.
http://lists.debian.org/debian-amd64/2004/11/msg00064.html (late 2004)
http://lists.debian.org/debian-amd64/2005/12/msg00255.html (late 2005)

The work-around is briefly discussed at Ubuntu 5.10 Support (GNOME) > AMD 64 Users :
http://ubuntuforums.org/archive/index.php/t-82548.html

Repeating the work-around, until there's a trusted source for vnc4server for amd64, you can download the fixed vnc4server and vncviewer as .deb packages from:

http://qt1.iq.usp.br/download/
vnc4server_4.0-7.3_amd64.deb [2.0M]
xvnc4viewer_4.0-7.3_amd64.deb [140K]

You then simply need to manually install them using dpkg from the download directory:


sudo dpkg -i vnc4server_4.0-7.3_amd64.deb
sudo dpkg -i xvnc4viewer_4.0-7.3_amd64.deb


Once installed, Tichondrius' HOWTO works perfectly following the original instructions.
It would be useful if a reference to the fix for AMD64 was included as the start of this how-to until vnc4server is available for amd64 by normal means.

Thanks!


Done. Thanks !

CosMix
February 20th, 2006, 11:17 PM
Hey there,

Im just curious about one thing...can i set another port on which vnc server would accept connections in order to be able to have two or more simultaneous connections on one vnc server ?...like...can i add another port in this conf file ?


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 = 55566
port = can i add another port here?
}

And btw, great howto! Wish there were more ppl like you...willing to help and above all, able to help.

Gorazd

Tichondrius
February 23rd, 2006, 10:43 AM
Hey there,

Im just curious about one thing...can i set another port on which vnc server would accept connections in order to be able to have two or more simultaneous connections on one vnc server ?...like...can i add another port in this conf file ?


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 = 55566
port = can i add another port here?
}

And btw, great howto! Wish there were more ppl like you...willing to help and above all, able to help.

Gorazd

Let me clarify that every X-windows server manges one display. Your actual monitor is display :0 and is controlled by Ubuntu's default X-windows server. The Xvnc program is also an X-windows server which controls display :1 (which is a virtual diplay that can be projected to a VNC client) according to how we set it up in this guide. It also serves as a VNC server which listens on port 5901.

If you want more than one VNC client to share the display you can remove the -NeverShared option from the server_args line in the script. But that means that all the clients still connect to the server on the same port 5901 and see the exact same display. In fact, if any client moves the mouse for example, then the other clients will see the mouse cursor move as well.

If you want to allow more than one concurrent sessions, than you need to run another instance of Xvnc on a different display. To do that, make a copy of the Xvnc script in /etc/xinetd.d called Xvnc2 (in the same directory), and in the new file change the display to :2 and the port to 5902. Now restart xinetd as shown in step 6 of the howto, and you will have two Xvnc servers running, each waiting for a connection on a different port and managing a different display. So you could have two users running independent sessions, each one on a different virtual display.

edsel6502
February 24th, 2006, 01:32 AM
Hi there I'm having a problem resuming an old session.

What I do is login via GDM then quit the vncviewer program and then try to reconnect. Instead of letting me resume, it gives me the GDM login again.

The following is the args I'm passing Xvnc. I had to remove the -fp option as it refused to connect saying that I did not have a fixed font.

service vnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/Xvnc
server_args = -inetd :1 -query localhost -geometry 1280x1024 -depth 16 -DisconnectClients=0 -IdleTimeout=0 -NeverShared -SecurityTypes=none
port = 5901
}

Update:

Ok I'm stumped. It seems to behave as expect when run from the commandline. Multiple tests to localhost:2 confirms it.

Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -DisconnectClients=0 -IdleTimeout=0 -NeverShared -SecurityTypes=none

The only thing it seems to be choking on is launching from xinetd which makes it want to login via GDM each and every time...

Tichondrius
February 24th, 2006, 02:21 AM
I think it might be the fact that you set Idle timeout to zero, so try changing that option. I understand that when you disconnect you don't mean that you explicitly log out from the gnmoe session, right ?

Also you should restart xinetd and kill all the Xvnc processes by doing step 5, because sometimes things get messed up and xinetd just keeps spawning more and more Xvnc process instead of waking up the old one.

edsel6502
February 24th, 2006, 02:53 AM
When I quit I just quit the vncviewer application. I am still logged in via my windowmanager session.

I also do a cold boot. To make sure everything is running properly.

I'll try it without the IdleTimeout=0 But I really really need that vnc session not to timeout.

Update:

Nope that didn't work.

I think I might have to force a script to launch on boot.

kharyett
February 24th, 2006, 07:08 PM
This is a great Howto. It worked great after I ironed out a stupidity issue.

Word of advice:
If you have the root accound enabled with a password, DO NOT set the vnc server passwrod the same as your root password, otherwise, the sessions will not work, and it will chown .ICEauthority to root ownership and lock you out of any gdm sessions except for the one you are currently logged into. After loging out, you will be locked out till you chown the .ICEauthority file back to your usernames ownership.

Like I said, stupidity issue. Time to change that password... ;)

Tichondrius
February 24th, 2006, 07:18 PM
Having the root account enabled is not a good idea, and it's even worse to log in to GDM as root. To perform system maintenance, you should log in as a user with administrator privileges (not root) and use sudo. If typing in your password every time you use sudo is too much of a hassle, you can edit /etc/sudoers file and change the admin line to read:


%admin ALL=(ALL) NOPASSWD: ALL

Or follow this howto in the guide:

http://easylinux.info/wiki/Ubuntu#How_to_use_.22sudo.22_without_prompt_for_pa ssword_.28not_secure.29

_kk
February 24th, 2006, 10:58 PM
Hey guys.

I really hope someone will help me out here. I've read this guide many many times by now and I'm getting alot of the same errors as others here. I'm at the point where I can start the Xvnc by hand and that works great but now I need to get 'xinetd' to start it for me as I understand.

When I sudo netstat -tap | grep xinetd I get:
tcp 0 0 *:5901 *:* LISTEN 6885/xinetd

and when I try vncviewer localhost:1 I get this:
ReadFromRFBServer: rdr::SystemException read: Connection reset by peer(104)

I've checked the log: grep xinetd /var/log/syslog and I get the same as others has described:
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.

I've really double checked everything and have no idea where to go now. I've used vnc a great deal on windows but linux is all new to me :?

Where do I go from here? :-k

kk,
installed ubuntu yesterday

Tichondrius
February 24th, 2006, 11:12 PM
Repeat steps 5 and 6

_kk
February 25th, 2006, 09:36 AM
Repeat steps 5 and 6

Ok, in step 5 it says:

Stopping the internet superserver: xinetd.
Xvnc: no process killed
Starting internet superserver: xinetd.

In step 6 I get:

ReadFromRFBServer: rdr::SystemException read: Connection reset by peer(104)

Update: Something has changed since yesterday. Now when I start the server manually and connect to it all I see is a blank screen. It's like a giant chess board with black and white pixels. Also the cursor changes into a big X - nevermind, XDMCP was disabled.

kharyett
February 25th, 2006, 05:23 PM
Having the root account enabled is not a good idea, and it's even worse to log in to GDM as root. To perform system maintenance, you should log in as a user with administrator privileges (not root) and use sudo. If typing in your password every time you use sudo is too much of a hassle, you can edit /etc/sudoers file and change the admin line to read:


I know that having root with a passwrod is not a good idea for most people, but I have it enabled for a few good reasons which are irrelleavent here.

I don't allow a GDM or remote login by root anywhere besides console. And my sudo user is not allowed a remote login, only console and gdm. The console is locked up and accessable by only me.

Now, back to the conversation about VNC.

I wonder what kind of load it would be on the system to have a server setup like a terminal server for many users. Hmmmm.... I see possibilities here. I wonder how many would be too many... Time to start something over in the Server Talk forum...
\\:D/

simon0t7
February 25th, 2006, 05:27 PM
hm... I can login remotely via VNC, but when I'm at the actual machine my login no longer works.... am I missing a step here?

kharyett
February 25th, 2006, 08:12 PM
hm... I can login remotely via VNC, but when I'm at the actual machine my login no longer works.... am I missing a step here?

Do you get an error in the GDM when you try to logon? If it does, login to the console and check the ownership of the .ICEauthority file in your home directory.

If there is no error, can you still login to the console?

simon0t7
February 25th, 2006, 08:52 PM
it tells me my password or login is incorrect. I can log in fine via console from putty.


-rw------- 1 simon simon 787 Feb 25 11:50 .ICEauthority


That's the output for .ICEauthority, is it correct?

kharyett
February 26th, 2006, 02:03 AM
That looks good.
Check to see if any files in your home directory have suddenly changed to root ownership. If any have, let us know which ones. If none have, try the following:


sudo /etc/init.d/xinetd stop

sudo killall Xvnc

sudo /etc/init.d/xinetd start

sudo /etc/init.d/gdm restart


That will kill the xinet daemon, kill all Xvnc processes, restart xinet daemon and restart the GDM. See if that lets you login again.

When I screwed up with the root password, after I reclaimed ownership of the file, I had to do the above steps before I could login on the console GDM.

I have had a few quirks since then, but luckily I have ssh access for remote logins setup. Even if the console goes kerblewey, I can still use the SSH login... And yes, it happened that the keyboard was not accessable due to a motherboard port failure. SSH allowed me to get in and shut it down cleanly so I could changed the motherboard.

See if that helps.

Tichondrius
February 26th, 2006, 03:20 AM
Okay, so this setup will allow me to start a new session on display 1. But can I resume an existing session on my physical display 0? Let's say I start a session at home normally on display 0. I start up gaim and firefox then lock the screen and go over to a friend's place. Can I resume this session using this method, or only start a new session?


Ok, to resume a session you started on your physical display (display :0) all you really need is to turn on Ubuntu's remote desktop feature using the Remote Desktop Preferences dialog box accessible from System->Preferences->Remote Desktop menu item. Just check the first two options there (allow other users to view your desktop and allow other users to control your desktop) and set the password in the bottom of the dialog box (check the REuqire password option), and you're done !
The above uses the built in VNC capability that Ubuntu comes installed with, but the drawback is that it's a little slow, and you need to enable it for each user which wants to allow his desktop to be view or controlled remotely. Also this doesn't allow remote VNC clients to log in to GDM, only to view a GDM session that was started by someone actually using the physical display. So if currently no one is logged in, a remote user cannot connect to display :0 and start a new session.
But don't worry - there is a better way which allows you to view the phyical display remotely and also log-in to a new session from GDM (using a remote VNC client) ! And it works faster (as fast as the regular VNC server), and works for all users. Here's how to do that :

1. Install x11vnc package


sudo apt-get install x11vnc

2. Add x11vnc service to xinetd:


sudo gedit /etc/xinetd.d/x11vnc

Enter this into the new file:



service x11vnc
{
port = 5900
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/x11vnc
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg
disable = no
}


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


sudo /etc/init.d/xinetd stop
sudo killall Xvnc
sudo killall x11vnc
sudo /etc/init.d/xinetd start

4. From a remote machine use your VNC client to connect to display :0


vncviewer vnchost:0

Note that after loggging from GDM and also after logging out from the X-session back and going back to GDM, the VNC client gets disconnected for some reason. So you just need to re-connect and you will get back into the session you logged into. When logging out, the disconnect happens when gnome asks you to confirm your intention to log out, so it's best to turn off the log-out confirmation dialog box by going to System->Preferences->Sessions and un-checking the "ask on logout" option.

Please tell me how this works out for you....I plan to add this to the HOWTO

_kk
February 26th, 2006, 11:59 AM
Tichondrius, the x11vnc guide worked flawlessly for me. Easy peasy \\:D/

It's a bit faster than the buildin vnc but still not as fast as FreeNX, that I've tried too.

BTW, how do I change my screen resolution? Right now I get a tiny 640x480 display. If I go to System > Preferences > Screen Resolution I can see my current settings but I can't change them.

It's the same when I use the bulidin vnc. It happend after I unplugged the monitor from the box. I run the box all remotely and thus have no monitor connected.

Tichondrius
February 26th, 2006, 06:25 PM
Your resolution is low because xorg X-server chooses the resolution based on the monitor capabilities which are dynamically communicated to the machine when X starts up. There is a way to override that, in the xorg.conf file but I don't remember exactly how. Just thought I give you a direction to search.

simon0t7
February 26th, 2006, 06:39 PM
That looks good.
Check to see if any files in your home directory have suddenly changed to root ownership. If any have, let us know which ones. If none have, try the following:


sudo /etc/init.d/xinetd stop

sudo killall Xvnc

sudo /etc/init.d/xinetd start

sudo /etc/init.d/gdm restart


That will kill the xinet daemon, kill all Xvnc processes, restart xinet daemon and restart the GDM. See if that lets you login again.

When I screwed up with the root password, after I reclaimed ownership of the file, I had to do the above steps before I could login on the console GDM.

I have had a few quirks since then, but luckily I have ssh access for remote logins setup. Even if the console goes kerblewey, I can still use the SSH login... And yes, it happened that the keyboard was not accessable due to a motherboard port failure. SSH allowed me to get in and shut it down cleanly so I could changed the motherboard.

See if that helps.


I'll have to try that. I just moved my /home to a different hard dirve but it doesn't auto-mount in fstab so i gotta see what's up with that first. No home = no X :)
I'll keep you posted

_kk
February 26th, 2006, 07:37 PM
Your resolution is low because xorg X-server chooses the resolution based on the monitor capabilities which are dynamically communicated to the machine when X starts up. There is a way to override that, in the xorg.conf file but I don't remember exactly how. Just thought I give you a direction to search.

Thank you for letting me know. Actually I have already been looking in the xorg.conf but I wasn't sure if that was the way to go. Now i'll just have to dig deeper.

Update: I got it to work nicely after some xorg.conf editing. Disabling the loading of 'dcc' and making a modeline for my screen did the trick.

dermotti
February 28th, 2006, 03:33 AM
You guys really should give FreeNX a try, its wayyyyy better than vnc, Much faster and works out the box...

Tichondrius
February 28th, 2006, 05:04 AM
You guys really should give FreeNX a try, its wayyyyy better than vnc, Much faster and works out the box...

well, I did set up FreeNX as well, but I couldn't get resuming sessions to work - that is, I had to start a new session every time. Also sometimes it would go nuts and spawn many processes on the server, occupying the CPU 100%. So in my experience it wasn't as reliable and flexible as VNC, but I agree it was faster.

_kk
February 28th, 2006, 07:16 AM
You guys really should give FreeNX a try, its wayyyyy better than vnc, Much faster and works out the box...

It's installed and running but have the same problem as Tichondrius. I can't resume sessions properly from windows... :-? I googled the problem and found that apparently it's a know bug when connecting from a win client. Such a shame because as you say it's very nice and fast.

Tichondrius
February 28th, 2006, 07:42 AM
Well not being able to resume sessions from windows pretty much ruins it for me as a possible alternative to VNC. And btw I wouldn't call this a "known bug", I'd call this a crippling problem which undermines the usefulness of the whole app.

_kk
February 28th, 2006, 09:31 AM
There's no problem in a linux => linux setup but using a win client makes this flaw appear. And I totally agree, it renders the app useless. Sadly, that is the same conclusion many others are making on the freenx mailing list: http://mail.kde.org/pipermail/freenx-knx/

t_ras
February 28th, 2006, 11:15 AM
AMD 64
ubuntu 5.10
installed as stated in 1st post this thread.

(though is seems I had vnc server installed before)

diplay :0 (remote desktop) works fine.
diplay :1 get restted by peer
diplay :2-... connection refused.
no firewall running (at least not from ISPconfig and I had installed no other)

manual connection given at thread for diplay 2 works fine.

any Ideas?

Coogan
March 4th, 2006, 02:35 AM
Thanks for the guide; mine's working perfectly. With one exception: my VNC session is a completely grey screen. No icons, no toolbars, just zilch. Kinda makes it tough to do anything :)

I'd managed to get VNC working a while back by editing my xstartup to fix it, but the method described here apparently doesn't use any of the xstartup scripts. Where's the remote desktop login scripts stored at?

Coogan

Brent Nesbitt
March 4th, 2006, 04:21 PM
Hi there I'm having a problem resuming an old session.

What I do is login via GDM then quit the vncviewer program and then try to reconnect. Instead of letting me resume, it gives me the GDM login again.

The following is the args I'm passing Xvnc. I had to remove the -fp option as it refused to connect saying that I did not have a fixed font.

service vnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/Xvnc
server_args = -inetd :1 -query localhost -geometry 1280x1024 -depth 16 -DisconnectClients=0 -IdleTimeout=0 -NeverShared -SecurityTypes=none
port = 5901
}

Update:

Ok I'm stumped. It seems to behave as expect when run from the commandline. Multiple tests to localhost:2 confirms it.

Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -DisconnectClients=0 -IdleTimeout=0 -NeverShared -SecurityTypes=none

The only thing it seems to be choking on is launching from xinetd which makes it want to login via GDM each and every time...
I am having this same problem (sessions always restart with GDM login).
I'm pretty sure it has to do with "wait = no" in the xinetd conf, but "wait = yes" doesn't seem to work, as my sessions just die.

x0inx
March 9th, 2006, 05:48 AM
Tichondrius, thank you for this great tutorial on vnc. People like you are making my switch to linux much easier and enjoyable. My only problem with x11vnc is that when I connect to :0, it does not prompt for a password like :1 does; it just goes straight to what is on my monitor. I am running Breezy AMD64.

Thank you.

biloyp
March 9th, 2006, 11:15 PM
Ok, to resume a session you started on your physical display (display :0) all you really need is to turn on Ubuntu's remote desktop feature using the Remote Desktop Preferences dialog box accessible from System->Preferences->Remote Desktop menu item. Just check the first two options there (allow other users to view your desktop and allow other users to control your desktop) and set the password in the bottom of the dialog box (check the REuqire password option), and you're done !
The above uses the built in VNC capability that Ubuntu comes installed with, but the drawback is that it's a little slow, and you need to enable it for each user which wants to allow his desktop to be view or controlled remotely. Also this doesn't allow remote VNC clients to log in to GDM, only to view a GDM session that was started by someone actually using the physical display. So if currently no one is logged in, a remote user cannot connect to display :0 and start a new session.
But don't worry - there is a better way which allows you to view the phyical display remotely and also log-in to a new session from GDM (using a remote VNC client) ! And it works faster (as fast as the regular VNC server), and works for all users. Here's how to do that :

1. Install x11vnc package


sudo apt-get install x11vnc

2. Add x11vnc service to xinetd:


sudo gedit /etc/xinetd.d/x11vnc

Enter this into the new file:



service x11vnc
{
port = 5900
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/x11vnc
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg
disable = no
}


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


sudo /etc/init.d/xinetd stop
sudo killall Xvnc
sudo killall x11vnc
sudo /etc/init.d/xinetd start

4. From a remote machine use your VNC client to connect to display :0


vncviewer vnchost:0

Note that after loggging from GDM and also after logging out from the X-session back and going back to GDM, the VNC client gets disconnected for some reason. So you just need to re-connect and you will get back into the session you logged into. When logging out, the disconnect happens when gnome asks you to confirm your intention to log out, so it's best to turn off the log-out confirmation dialog box by going to System->Preferences->Sessions and un-checking the "ask on logout" option.

Please tell me how this works out for you....I plan to add this to the HOWTO
Fantatstic How-To. VNC did not work for me at first but the logfile told me I had a } missing on line 11 of Xvnc, I fixed it and everything worked.

I can't get display 0 to come up, I will try on the local machine tomorrow.

I found this How-To so I will give it a try and see what happens. Thanks for your help.

biloyp
March 10th, 2006, 06:06 PM
Worked the very first time I set this up. I can log into a remote desktop (physical) and then log into a virtual desktop on the same machine.

Thanks for this excellent How-To!!

LivnLarge
March 14th, 2006, 09:07 AM
hello, I did steps 1 thru 6 however when i complete step 6 i get a i guess you can say a pixel screen because the resolution seems low but no GDM login, attached in the pastebin link below, is the pixel screen that appears once i type in 'vncviewer localhost:1'
http://www.imagestation.com/picture/sraid202/pda165827443509368eb032a32c2b417f/efd7b145.jpg

In the terminal this is displayed while you see the screen -

http://www.imagestation.com/picture/sraid202/pdd7fb65b36cb55d0bd34e958f98c2e04/efd7b13f.jpg

can someone tell me if this is normal and i assume that it didnt work right. also when i enter vncviewer localhost:0 i get to see my own desktop. so i dont know if that helps you guys figure out what wrong or not just thought iwould tell you. also on page 7 Tichondrius gives a how to login remotely to an existing session using vncviewer vnchost:0
am i able to try this and log in using the physical computer the one im using that is... to see if itll work. and what is the difference between his how to on page 1 and his how to on page2 i noticed one you instal vnc4server and the other x11vnc. and that you edit different files with gedit like vnc and the other is x11vnc. i just like to now what im doing when im following these threads. one thing is copying and solving a problem the other is knowing what you are doing. :)

Also Im only at this thread in the first place because someone in #ubuntu channel on irc pointed me here when i had a problem with my ext harddrive.. which i still have.. accessing it.. and then setting up samba to share it with a win box that is the host computer on my wireless network. so i then mentioned how i also wanted to share the ext hd on my wireless network for my bro to access but also for me to access if im somewhere else like a friends house. and to be able to use their computer to read and write to the shared ext hd on my network home. so thats how i got here \\:D/

thanks in advance

Linux 4 ever.

LivnLarge
March 14th, 2006, 09:08 AM
whoops noticed the terminal pic was blurry. here is what it displayed-

christopher@ubuntu:~$ 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.
VNC server supports protocol version 3.8 (viewer 3.3)
Password:
VNC authentication succeeded
Desktop name "x11"
Connected to VNC server, using protocol version 3.3
VNC server default format:
16 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 31 green 63 blue 31, shift red 11 green 5 blue 0
Warning: Cannot convert string "-*-helvetica-bold-r-*-*-16-*-*-*-*-*-*-*" to type FontStruct
Using default colormap and visual, TrueColor, depth 24.
Got 256 exact BGR233 colours out of 256
Using BGR233 pixel format:
8 bits per pixel.
True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
christopher@ubuntu:~$

sopo_dan
March 16th, 2006, 02:56 AM
when trying to install vnc4server package i get this:

vnc4server:
Depends: xserver-common but it is not installable
tried getting xserver-common from somewhere else, but i can't find one matching my X.org ver (7.0.0)

what else can i do?
or will this how-to also work with vncserver_3.3.7?

kmi
March 19th, 2006, 01:27 PM
Hello !
Thanks a lot for this how-to and the follow-up !

In my case it worked flawlessly at the first try... but not the second : every time I logged out after a successful login I could not manage to get the display back again. I had to reboot to be able to do it again... :evil:

I installed vnc4-common and xvnc4viewer (I guess xvnc4viewer has nothing to do with the trick but installing it seemed quite logical :) ) and removed vnc-common & xvncviewer.
Now everything is ok... I can log in/out/in/out/etc... :D

Do you also need to have these packages installed ? Are they installed during a step in the how-to that I haven't seen or that got messed up for some reason ?

cowmix
March 20th, 2006, 09:18 PM
I am running Breezy 64bit and I am having the same issue where I get the 'startup' X screen but no login prompt.


hello, I did steps 1 thru 6 however when i complete step 6 i get a i guess you can say a pixel screen because the resolution seems low but no GDM login, attached in the pastebin link below, is the pixel screen that appears once i type in 'vncviewer localhost:1'
http://www.imagestation.com/picture/sraid202/pda165827443509368eb032a32c2b417f/efd7b145.jpg

In the terminal this is displayed while you see the screen -

http://www.imagestation.com/picture/sraid202/pdd7fb65b36cb55d0bd34e958f98c2e04/efd7b13f.jpg

can someone tell me if this is normal and i assume that it didnt work right. also when i enter vncviewer localhost:0 i get to see my own desktop. so i dont know if that helps you guys figure out what wrong or not just thought iwould tell you. also on page 7 Tichondrius gives a how to login remotely to an existing session using vncviewer vnchost:0
am i able to try this and log in using the physical computer the one im using that is... to see if itll work. and what is the difference between his how to on page 1 and his how to on page2 i noticed one you instal vnc4server and the other x11vnc. and that you edit different files with gedit like vnc and the other is x11vnc. i just like to now what im doing when im following these threads. one thing is copying and solving a problem the other is knowing what you are doing. :)

Also Im only at this thread in the first place because someone in #ubuntu channel on irc pointed me here when i had a problem with my ext harddrive.. which i still have.. accessing it.. and then setting up samba to share it with a win box that is the host computer on my wireless network. so i then mentioned how i also wanted to share the ext hd on my wireless network for my bro to access but also for me to access if im somewhere else like a friends house. and to be able to use their computer to read and write to the shared ext hd on my network home. so thats how i got here \\:D/

thanks in advance

Linux 4 ever.

cowmix
March 20th, 2006, 10:23 PM
Ok.. I found the answer.. I have to run 'gdmsetup' to allow XDMCP...

BTW.. the solution was contained in this (http://www.realvnc.com/pipermail/vnc-list/2005-June/051059.html) post.


I am running Breezy 64bit and I am having the same issue where I get the 'startup' X screen but no login prompt.

kmi
March 23rd, 2006, 12:22 PM
Hello !
Thanks a lot for this how-to and the follow-up !

In my case it worked flawlessly at the first try... but not the second : every time I logged out after a successful login I could not manage to get the display back again. I had to reboot to be able to do it again... :evil:

I installed vnc4-common and xvnc4viewer (I guess xvnc4viewer has nothing to do with the trick but installing it seemed quite logical :) ) and removed vnc-common & xvncviewer.
Now everything is ok... I can log in/out/in/out/etc... :D

Do you also need to have these packages installed ? Are they installed during a step in the how-to that I haven't seen or that got messed up for some reason ?

Well... It appears it still does not work perfectly at all : if I log out, I can log in back... BUT the simple fact to log out drives Xvnc to get crazy : it takes 99% CPU usage (controlled after I log out via ssh then 'top') !

Please have you got an idea/tip/solution ? Or maybe a good joke that would make me forget it still does not work after so much PITA ?

MANY thanks in advance ! :)

m0ps
April 3rd, 2006, 08:26 AM
when trying to install vnc4server package i get this:

vnc4server:
Depends: xserver-common but it is not installable
tried getting xserver-common from somewhere else, but i can't find one matching my X.org ver (7.0.0)

what else can i do?
or will this how-to also work with vncserver_3.3.7?

Hello,

I have the same problem :( and I can`t find resolution :(

iMick
April 9th, 2006, 01:03 PM
I am having an intermittant problem VNC'ing to my ubuntu box. Sometimes I cannot connect, my VNC viewers just don't show anything without errors.

I run top on the box locally, the xvnc process is running at 100% CPU which seems to be blocking the connections.

Running:
sudo /etc/init.d/xinetd stop
sudo killall Xvnc
sudo /etc/init.d/xinetd start
is my work around at the moment as is a reboot.

Is there anyway to prevent this from happening?

galesteven
April 21st, 2006, 10:19 AM
Here's a cool one. Tichondrius' HOWTO works if in /etc/xinetd.d/Xvnc I change the port to 5902 and the display to :2 . If I use the instructions as-is (port 5901, display :1) then the following strange things happen:

1.
$ sudo netstat -tap | grep xinetd gives the expected LISTENing results. So all is ok, right? Not so fast!

2.
$ vncviewer localhost:1 gives the error message
ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104)

3.
grep xinetd /var/log/syslog shows lots of errors like this:

Apr 21 11:40:33 localhost xinetd[11941]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[11942]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[11943]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[11944]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[11945]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[10218]: Deactivating service Xvnc due to excessive incoming connections. Restarting in 10 seconds.
Apr 21 11:40:43 localhost xinetd[10218]: Activating service Xvnc


I can use VNC on display :2, but that is just a work-around. Why can't I use display :1?

Reboots do not help.

Thanks,
Steve

Nordoelum
April 21st, 2006, 03:33 PM
Thank you for the guide :D

One prob though. After I had installed and configed it. I tryed to run the command
$ sudo vncviewer localhost:1
I got this:

nordoelum@ubuntu-server:~$ vncviewer localhost:1
bash: vncviewer: command not found
To fix this I needed to install xtightvncviewer. It might have something with that I am using XFCE on my testing server.

If so, please add it to the main post, that you need xtightviewer to get to work in XFCE.

But anything else worked well.

Nordoelum
April 22nd, 2006, 01:15 PM
Ed1t: It does :P

Morphius
April 25th, 2006, 01:23 AM
vnc4server:
Depends: xserver-common but it is not installable


This is an error which results on dapper. This is because the name of the xserver-common package has changed. Furthermore, due to a problem in the program this cannot be easily remedied. This bug has been documented. You should be able to subsitute vnc4server with Xvnc or vncserver. I am working on this problem now but have run up against this error:



Apr 21 11:40:33 localhost xinetd[11941]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[11942]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[11943]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[11944]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[11945]: warning: can't get client address: Transport endpoint is not connected
Apr 21 11:40:33 localhost xinetd[10218]: Deactivating service Xvnc due to excessive incoming connections. Restarting in 10 seconds.
Apr 21 11:40:43 localhost xinetd[10218]: Activating service Xvnc


I'll update everyone if there's more that you need to know on dapper.

zasf
April 29th, 2006, 01:16 PM
Thanks for the howto, it works on my Ubuntu Dapper box as client and Xubuntu Dapper as server just a few notes:

http://ubuntuforums.org/gallery/files/5/7/5/0/6/Screenshot-vnc_thumb.png (http://ubuntuforums.org/gallery/files/5/7/5/0/6/Screenshot-vnc_original.png)

1. Enable XDMCP
On Xubuntu, run 'sudo gdmsetup'

2. Install required packages (vncserver and xinetd)
On Xubuntu, run 'sudo apt-get install vncserver'

3. Set the VNC passwd

sudo vncpasswd /root/.vncpasswd

4. Start the VNC server

sudo /usr/bin/Xvnc :2 -query localhost -geometry 800x600 -depth 16 -once -fp /usr/share/X11/fonts/misc -dontdisconnect -nevershared -rfbauth /root/.vncpasswd

5. Connect the client

xvncviewer <ip.ad.re.ss>:2

don't ask me why xvncviewer instead of vncviewer, but the former one didn't work ending up with a grey screen.

It works beautifully under win as well

http://ubuntuforums.org/gallery/files/5/7/5/0/6/Screenshot-vnc-win_thumb.png (http://ubuntuforums.org/gallery/files/5/7/5/0/6/Screenshot-vnc-win_original.png)

I used tightvnc as client

Now I only miss how to configure xinted.

fantagol
April 30th, 2006, 03:42 PM
Update: I got it to work nicely after some xorg.conf editing. Disabling the loading of 'dcc' and making a modeline for my screen did the trick.

How u have edited xorg.conf ???
>>Disabling the loading of 'dcc'<< where is ???

>>and making a modeline for my screen did the trick<< :-k please explain me !!!

tks a lot

eentonig
May 1st, 2006, 11:15 AM
Zaraf, if you got it Xinet.d config working, can you give us an update.

You're post just got it working on my machine as well.

zenobia
May 4th, 2006, 02:32 PM
I am having an intermittant problem VNC'ing to my ubuntu box. Sometimes I cannot connect, my VNC viewers just don't show anything without errors.

I run top on the box locally, the xvnc process is running at 100% CPU which seems to be blocking the connections.

Is there anyway to prevent this from happening?

I think I might be having the same problem as you, and I am clueless as to why it is happening. I have gone through the how-to several times, and posted the same problem in the other thread about using Hamachi together with resumable VNC sessions for remote controlling PC's.

Intermittently, I will simply be unable to connect with VNC to the PC that has been setup with it. There are no errors being displayed in VNC, and this happens either by running vncviewer locally on the box, or remotely from another PC. I can't seem to find any errors elsewhere that would give some clue as to what is going on. I have tried reconfiguring Xvnc to listen on another port, and to use display :2 instead :1, all to no avail.

Notably, this problem seems to happen on both of my Ubuntu boxes.

Does anyone have any clue as to what might be happening in these situations, or what I can look for? The problem is completely intermittent, one day I can start up the PC and it would be fine, the next day I fire up the PC and it doesn't work. Furthermore, I can even login one day to the PC, use the PC for a while, log out, and when attempting to login again, VNC will fail with no errors.

Help! ] (*,)

vik4
May 7th, 2006, 02:28 PM
I've been trying this on a dodgy old server, and I don't want to install GDM (or the rest of gnome). Instead, I'm trying to use xdm, so far with little success. the vnc session starts fine, but leaves me with a window with an empty X session (grey background, X mouse pointer). I've tried a few things to make sure xdm is allowing xdmcp connections, but nothing so far. Any ideas?

vik4
May 7th, 2006, 03:12 PM
So I've bit the bullet and installed gdm, and it worked. Once. I logged out, and now I get the same problem as before - a blank X session. Any ideas?

encompass
May 8th, 2006, 02:07 AM
So I've bit the bullet and installed gdm, and it worked. Once. I logged out, and now I get the same problem as before - a blank X session. Any ideas?
Have you checked your firewall? I had that grey screen and when I shutdown my firwall it all worked again.

Indiana Red
May 9th, 2006, 03:07 AM
So I've bit the bullet and installed gdm, and it worked. Once. I logged out, and now I get the same problem as before - a blank X session. Any ideas?


I am a brand new user and this sounds exactly like what I get. I followed the several step procedure spelled out at the beginning of this thread and my VNC client can connect from my XP box in the other room (on the same subnet) and prompts for the pwd and then I get the full grey screen with the "x" as the mouse pointer.
No firewalls are between the ubuntu box and this XP machine, just a switch and 2 WAPs.
Hmmm what did I do wrong?

sguart
May 9th, 2006, 04:13 AM
hmm... i seem to have a different issue... i can't lock the screen. if i lock the screen on display 1, i don't see the lock dialog box asking for password. i can use mouse to interact but i no longer sees drop down menu. keyboard events are not registering. if i ssh in and kill gnome-screensaver then i am back in business. on display 0, i can lock the screen and all.

also sometimes when logging out, the Xvnc process is not terminated. so next time, the vnc won't connect until i restart the xinetd and kill the Xvnc.

otherwise, it's working...

thanks

sg

Jose Catre-Vandis
May 13th, 2006, 01:24 AM
I am a brand new user and this sounds exactly like what I get. I followed the several step procedure spelled out at the beginning of this thread and my VNC client can connect from my XP box in the other room (on the same subnet) and prompts for the pwd and then I get the full grey screen with the "x" as the mouse pointer.
No firewalls are between the ubuntu box and this XP machine, just a switch and 2 WAPs.
Hmmm what did I do wrong?

I have just got to the bottom of this one myself.

gdm needs to be running, and xdmcp also needs to be enabled.

To start gdm use the following command on the machine you are trying to remote to ( this assumes you can either physically access it, or you have already "ssh"ed in Terminal)

sudo /etc/init.d/gdm start (you might then need to wait a minute, depending on the speed on your machine)

Next ensure that XDMCP is enabled

sudo gedit /etc/X11/gdm/gdm.conf
or
sudo nano /etc/X11/gdm/gdm.conf (if doing this through Terminal)

and find the [xdmcp] section at the end of the file
change

Enabled=False

to

Enabled=True

Then save and then best to reboot. of course if gdm is not loaded on boot, you will have to start it again

tigerdyr
May 14th, 2006, 04:16 PM
I have a little problem with this

I have set up the Ubuntu box as posted here and try to log in using TightVNC from a Windows XP box.

If I try to connect immediately after starting the Ubunto box it all works fine - I can connect through TightVNC and all is well.

However if I start the Ubuntu box and do not log in immediately but wait 10-15 minutes before trying to connect from the Windows box, I get nothing - the TightVNC viewer just does not "find" anything and hangs around in the task manager without doing anything (not even an error, that it can't find a the server...)

I can log in through SSH to restart gdm, but this does not change anything - I stil can't get TightVNC to connect. Do any of you have any suggestions as to what might cause this and how to solve this problem?

encompass
May 15th, 2006, 03:47 AM
I am a brand new user and this sounds exactly like what I get. I followed the several step procedure spelled out at the beginning of this thread and my VNC client can connect from my XP box in the other room (on the same subnet) and prompts for the pwd and then I get the full grey screen with the "x" as the mouse pointer.
No firewalls are between the ubuntu box and this XP machine, just a switch and 2 WAPs.
Hmmm what did I do wrong?
YUP, I think I have got it down to this:
Firewall is restricting us..
I allow 5901 and now it lets me log in to the system... with IP:1... if I wanted more I could add them
If you don't like firewall and are not used to them... try friestarter, thats what I did...

sudo apt-get install firestarter

kacheng
May 16th, 2006, 09:44 PM
Tichondrius,

Now that vnc4server is fixed, I've had no problem installing XDMCP for both display 1 using vnc4server (original post) and for display 0 using x11vnc.
[I'm on a Dapper amd64 kernel.]
Thanks for that - you were way ahead of your time.

Is there a way to add more displays? If I wanted to utilize display 2, display 3, etc, what must I do to the xinetd configuration? I tried adding and duplicating things here and there, but it did not work. Sometimes i would get display 2, but lose display 1, etc.

What's the proper way to implement this?

Thanks.

Morphius
May 16th, 2006, 11:24 PM
Tichondrius,

Now that vnc4server is fixed, I've had no problem installing XDMCP for both display 1 using vnc4server (original post) and for display 0 using x11vnc.
[I'm on a Dapper amd64 kernel.]
Thanks for that - you were way ahead of your time.

Is there a way to add more displays? If I wanted to utilize display 2, display 3, etc, what must I do to the xinetd configuration? I tried adding and duplicating things here and there, but it did not work. Sometimes i would get display 2, but lose display 1, etc.

What's the proper way to implement this?

Thanks.

Adding additional displays should be as easy as creating a second Xvnc file (say xvnc2) and changing the port and display information for each desired display session. Cheers.

kacheng
May 17th, 2006, 01:50 PM
That does not quite seem to be the case.

I copied /etc/xinetd.d/Xvnc to /etc/xinetd.d/Xvnc2 and change the display to :2 and port to 5902.

This gets me closer - I now have an independent display :1 as before, but display:2 gives me the display:0 connection.

So, if I open three sessions, :0 is the physical display, :1 is an XDMCP session, and :2 is the physical display again.

Do I have a missed configuration setting somewhere? I set the XDMCP settings to allow 5 displays per host.

jorge.maravi
May 25th, 2006, 11:03 PM
I am sorry to bottle you folks,but i have a problem like this, i have already followed every step pointed here, i am using ubuntu 5.10 and when i tried to test vncviewer in the same computer where i installed the vncserver package (required here) i got this error message:

jmaravi@j-maravi1:~$ vncviewer j-maravi1:0
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.
vncviewer: ConnectToTcpAddr: connect: Connection timed out
Unable to connect to VNC server

I can ping the name j-maravi1, i have set up all the configuration on the vino-preferences.....

The xinitd service is running, i don't know what else to do....

Thanks

Jorge

jadba
May 30th, 2006, 07:22 AM
This is an excellent HOW-TO. Helped to relieve me of the restrictions imposed by the Gnome Remote Desktop i.e. limited screen resolution. Thanks Tichondrius.

lvivier
June 1st, 2006, 05:17 AM
I have followed the instructions in the tutorial without much success.

Initially, I was able to connect locally to the vnc server, but all I got was a window with the infamous grey background and "X" cursor. I then edited my gdm configuration to enable XDMCP, and also changed my router settings to forward port 5901 (which I thought would be unnecessary for local connection) and rebooted.

After that reboot. when attempting to connect on localhost using vncviewer, I am prompted for the password, and after entering it vncviewer exits with:

ReadFromRFBServer: rdr::EndOfStream

which is not very helpful. Subsequent reboots have not affected anything. I have tried changing the password with "sudo vncpasswd /root/.vncpasswd" but it has had no effect.

Has anyone experienced anything like this, or does anyone know what this message means? Please let me know if I should provide any more information, and thanks in advance.

lime4x4
June 4th, 2006, 05:10 PM
okay i got this up and running for the most part..I can log in but the screen is all grey and wavy...i have a 21 inch widescreen lcd panel that runs at 1680x1050 would i have to edit the geometry line to something else?

dmizer
June 4th, 2006, 11:33 PM
1. Enable XDMCP
System->Administration->Login Screen Setup
Tab Security->Enable XDMCP
Tab XDMCP--> You can disable "Honor Indirect Requests"
is there any way to perform this step with no gui interface? i'm trying to get this done via ssh.

L4mp
June 5th, 2006, 03:20 PM
Enable XDMCP
System->Administration->Login Screen Setup
Tab Security->Enable XDMCP
Tab XDMCP--> You can disable "Honor Indirect Requests"

How do you do this in dapper? I can't find these settings in dapper, my vnc worked perfectly in breezy but since i updated i get those dot screens.
This normally is because of the XDMCP setting.

Cirrocco
June 5th, 2006, 03:58 PM
this HOW-To needs to be rewritten for Dapper.

of all VNC options - THIS ONE was my preferred option. and now it no longer applies due to XDMCP.

Someone please write a new 'resumable session vnc4server how to' for dapper.
[-o<

ABeakyboy
June 6th, 2006, 07:36 PM
How do you do this in dapper? I can't find these settings in dapper, my vnc worked perfectly in breezy but since i updated i get those dot screens.
This normally is because of the XDMCP setting.

Ok, this is what I did. I'm rather new at this so I can't be sure if this will work for you....or anyone for that matter. I'm running Ubuntu 6.06.

Please note, these steps are only what you want to do if you had your VNC setup working under 5.10 and then you upgraded to 6.06 and it doesn't work anymore.

1. Log in to GNOME.
2. Click "System" -> "Administration" -> "Login Window"
3. Enter your password if necessary.
4. Click the "Remote" tab.
5. Under the "Style:" drop down box, choose "Same as Local".
6. Click the "Configure XDMCP" button and make sure "Honor Indirect Requests" is set to what you want it to be set to.
7. Click "close" twice.

See if this does it for you. Good luck!

Edit: Forgot to add that my VNC session doesn't seem to be resumable. I don't know if it's due to the Dapper upgrade or if I messed up somewhere else.

Cirrocco
June 6th, 2006, 08:09 PM
well I got xdmcp setup
followed the tutorial
it asks for a vnc password
and won't take the one I defined.

/poop

L4mp
June 6th, 2006, 11:35 PM
Ok, this is what I did. I'm rather new at this so I can't be sure if this will work for you....or anyone for that matter. I'm running Ubuntu 6.06.

Please note, these steps are only what you want to do if you had your VNC setup working under 5.10 and then you upgraded to 6.06 and it doesn't work anymore.

1. Log in to GNOME.
2. Click "System" -> "Administration" -> "Login Window"
3. Enter your password if necessary.
4. Click the "Remote" tab.
5. Under the "Style:" drop down box, choose "Same as Local".
6. Click the "Configure XDMCP" button and make sure "Honor Indirect Requests" is set to what you want it to be set to.
7. Click "close" twice.

See if this does it for you. Good luck!

Edit: Forgot to add that my VNC session doesn't seem to be resumable. I don't know if it's due to the Dapper upgrade or if I messed up somewhere else.


thanks alot for your reply!

but i'm sorry to say that it didn't worked :???:

still get the "pixelscreen" when i make the connection

jer2eydevil88
June 7th, 2006, 06:50 PM
Okay I am totally lost from all the posts in this topic.

Can someone tell me how to enable resumeable sessions in 6.06 with the commands to get the software (if any) through apt-get?

I would like to be able to VNC into my new ubuntu server as its the last peice of the puzzle for me.

elemental666
June 7th, 2006, 08:41 PM
I haven't read all 12 pages of this thread, but... I did the howto in post 1, and did the stuff listed here: https://wiki.ubuntu.com/VNC?highlight=%28VNC%29

if I do vncviewer <ip>:0 I can take control of my desktop...
if I do vncviewer <ip>:1 I get a dead x screen (grey backgroud with x cursor)...

maybe GDM is the problem?

EDIT: Bingo! enabled xdmcp in gdm.conf, rebooted and I'm in, at least locally

L4mp
June 7th, 2006, 10:44 PM
Set up VNC server with resumable sessions on dapper (6.06)


1. Enable XDMCP


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/gdm/gdmlogin

remove the '#' in the last line so there should 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/gdm/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:


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:


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


4. Add vnc service to xinetd:
Code:


sudo gedit /etc/xinetd.d/Xvnc


Enter this into the new file:

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:


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 up the VNC server on):

Code:


vncviewer localhost:1


You should be prompted for the VNC password, and then see the GDM 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 favorite VNC client (remember to first close the local vncviewer we started above). Remember to use the VNC server machine'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: 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.




ps. This was copy/pasted from a few posts made by other ppl, I simply putted them together and tested everything! It works here for me now.

If questions just post :)

p_alexander
June 8th, 2006, 12:30 AM
Can you delete these? I took out the question I had because I resolved it. Sometimes talking to yourself works. See below.

p_alexander
June 8th, 2006, 03:55 AM
I added a bunch of stuff that I had to do in order to make this work on my amd64 box. This box was originally installed under 5.10 and upgraded to 6.06. Everything pretty much out of the box. YMMV.

Oh yeah, this also made Vino work as well, not sure why. Perhaps the xdmcp stuff. So, vino is on display 0, vnc4 on display 1.

This is copied from L4mp's post above with my changes added to the amd64 section.

PS - Ignore the "HTML" comment in the "HTML Code" boxes. I couldn't get regular code boxes to include line breaks. Noob at work.

1. Enable XDMCP


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/gdm/gdmlogin

remove the '#' in the last line so there should 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/gdm/gdmlogin

Note: I had to also change another part of the gdm.conf file. Also, a restart was required so gdm could read the new configuration.

Look for the following piece of text in /etc/gdm/gdm.conf


[xdmcp]
# Distributions: Ship with this off. It is never a safe thing to leave out on
# the net. Setting up /etc/hosts.allow and /etc/hosts.deny to only allow local
# access is another alternative but not the safest. Firewalling port 177 is
# the safest if you wish to have xdmcp on. Read the manual for more notes on
# the security of XDMCP.
Enable=false

Change the Enable=false to Enable=true

Note: Before doing the next step, you need to make sure the extra repositories (e.g. universe) are enabled:
http://easylinux.info/wiki/Ubuntu_dapper#How_to_add_extra_repositories

2. Install required packages (vncserver and xinetd)

Code:


sudo apt-get install vnc4server xinetd
i386 users can skip to step 3, AMD64 users continue to 2a.

2a. 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:


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

Some people may have unmet depencies in these packages and will need to install additional packages.

Code:


sudo apt-get install gcc-3.3-base
sudo apt-get install libstdc++5

There is one dependent package that cannot be installed as it has been deprecated in the new 6.06. Therefore, we have to force the vnc4server packages to install.

Code:


sudo dpkg -i --force-all vnc4server_4.0-7.3_amd64.deb
sudo dpkg -i --force-all xvnc4server_4.0-7.3_amd64.deb

I am loathe to force package installs BUT it seems to work in this case. An updated, working AMD64 vnc4server package would be preferable.

3. Set the VNC passwd

Code:

sudo vncpasswd /root/.vncpasswd

4. Add vnc service to xinetd:

Code:


sudo gedit /etc/xinetd.d/Xvnc

Enter this into the new file:

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:


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 up the VNC server on):

Code:


vncviewer localhost:1


You should be prompted for the VNC password, and then see the GDM 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 favorite VNC client (remember to first close the local vncviewer we started above). Remember to use the VNC server machine'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: 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.

L4mp
June 8th, 2006, 12:55 PM
ok perfect dude!
i'll make a new thread with the tag of dapper 6.06 so other ppl will find it easy!

JeyKey
June 10th, 2006, 10:17 PM
It doesn't work here, this is what happens:
http://80.203.31.175/ubuntuforums/english/vnc.png

I haven't read through the whole thread, so perhaps someone has posted this before. And if it matters, I'm running Ubuntu 6.06 with GNOME

rockmanac
June 11th, 2006, 07:56 PM
This is where I'm at... I've read through the whole document and still can't get VNC Working.

-A

mjfarina
June 12th, 2006, 04:31 AM
OK, so is there a way to configure VNC entirely from remote?? I want to log in over SSH terminal and configure VNC to accept my connection. Anyone know how to do this??

p_alexander
June 12th, 2006, 04:44 AM
OK, so is there a way to configure VNC entirely from remote?? I want to log in over SSH terminal and configure VNC to accept my connection. Anyone know how to do this??

Check out the instructions on page 12 of this thread and replace the command gedit with nano or whatever text editor you like to use from the command line.

mjfarina
June 13th, 2006, 05:30 AM
Check out the instructions on page 12 of this thread and replace the command gedit with nano or whatever text editor you like to use from the command line.
ya, I did that...I keep getting this "markfarina@UBN600:~$ vncpasswd: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory" when trying to set a password??

Of course, it tells me it can't start the vnc server without a password.

p_alexander
June 13th, 2006, 05:46 AM
ya, I did that...I keep getting this "markfarina@UBN600:~$ vncpasswd: error while loading shared libraries: libstdc++-libc6.2-2.so.3: cannot open shared object file: No such file or directory" when trying to set a password??

I did an apt-file search to see which package that file is associated with. You can try installing the one that it returned: libstdc++2.10-glibc2.2

Type:


sudo apt-get install libstdc++2.10-glibc2.2


But I don't have that package installed and I didn't need the file you mentioned. Anyway, it's worth a shot.

iMick
June 13th, 2006, 09:43 AM
I think I might be having the same problem as you, and I am clueless as to why it is happening. I have gone through the how-to several times, and posted the same problem in the other thread about using Hamachi together with resumable VNC sessions for remote controlling PC's. (*,)


Glad I'm not the only one. My problem is also intermittant, killing the xvnc process and restarting xinetd will allways fix the problem for a while.

Anyone think of a solution yet? I don't want to update to Dapper untill I get this problem sorted.

Cheers

Go Socceroos! First world cup win ever!

davidfdr
June 20th, 2006, 02:33 AM
It doesn't work here, this is what happens:


I haven't read through the whole thread, so perhaps someone has posted this before. And if it matters, I'm running Ubuntu 6.06 with GNOME

I'm using the same version of ubuntu and I'm having the same problem...

Anybody could help us with this problem?

Daiver
July 1st, 2006, 03:33 PM
Thank you very much for this. It worked perfectly on the first try using Ubuntu 5.10! :D

unixping
July 2nd, 2006, 04:59 AM
When I connect to myself i just see a checkered screen? What did I do wrong?

Test33
July 6th, 2006, 05:36 AM
When I connect to myself i just see a checkered screen? What did I do wrong?

Same thing here. Any ideas?

krazykirk
July 10th, 2006, 04:37 AM
hmm... it's not quite working for me...


kirk@kirk-desktop:~$ vncviewer localhost:1
VNC viewer version 3.3.7 - built Feb 20 2006 12:04:05
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)

thats what happens when i try to test it.

Anyone know a solution?

gurgle
July 12th, 2006, 06:49 PM
i set my password like in the guide, but it wont authenticate for me. weird.....

Zoltok
July 13th, 2006, 03:31 PM
I'm having a weird problem connecting. I've followed the instructions exactly and it seems to be working, but occasionally I will lose the ability to connect from my viewer. I can ping the machine, but I am never asked for a password and the process keeps running; it simply looks like nothing happens. If I restart the server it begins to work again, and if I log in and check the processes VNC is always running, but that may just be starting when I log in.

The worst part is that this is a machine in a locked server room, which means I generally won't have physical access to it. If I try telnetting in, I just get a blank unresponsive window and I am still never prompted for my VNC password. What gives?

AsYouWish
July 13th, 2006, 09:58 PM
Hi

I followed these instrucions and have VNC working great... with one exception. Many things which should not be black are showing up black when I am logged in through VNC. A list:
Big chunks of the taskbar in Gnome (top and bottom)
All drop down menus (gnome and xfce)
parts of the syaptic background (gnome)
the background of the message box in gaim

For stuff like the drop down menus, if i scroll over the entries the text changes colors and I can read it, but its just annoying not to see all the options. The icons are visible though.

Im using vnc4server on the ubuntu machine and RealVNC client on my winXP laptop. Is this a fixable problem, or just an interent vnc issue? Will a different client help? Suggestions?

Thanks

omegasoul
July 30th, 2006, 06:49 PM
Just wanted to say thank you for the how-to.

James_N
July 31st, 2006, 10:34 PM
Ive set it all up in dapper and it works fine internally. Externally i get this: RFB 003.008 when i type in the external IP and port (5901)

Ive port forwarded 5901 and it works fine internally but not externally. Anyone know why? :)

Thanks

James_N
August 1st, 2006, 09:41 AM
Ive set it all up in dapper and it works fine internally. Externally i get this: RFB 003.008 when i type in the external IP and port (5901)

Ive port forwarded 5901 and it works fine internally but not externally. Anyone know why? :)

Thanks

anyone? :)

Thanks

James_N
August 1st, 2006, 03:57 PM
Im trying to use firefox to access this. Can i use a web browser or do i have to use a VNC viewer (on windows systems)?

trmentry
August 1st, 2006, 05:30 PM
Same thing here. Any ideas?

I just followed the instructions as well and when I connect to localhost or from another machine on the lan, I get challeneged for the vnc passwd. I enter it. It pops up the 1024x768 window with an X mouse cursor, but that's it. No logon afterwards.

Running fresh install of Dapper.

dodob
August 2nd, 2006, 11:50 AM
I just followed the instructions as well and when I connect to localhost or from another machine on the lan, I get challeneged for the vnc passwd. I enter it. It pops up the 1024x768 window with an X mouse cursor, but that's it. No logon afterwards.

Running fresh install of Dapper.

I think this happens because twm is not installed by default.

~/.vnc/xstartup is run when a VNC client is connected. It opens vncconfig, an xterm, and then tries to run twm.

What I did was comment out the two lines in ~/.vnc/xstartup "for a normal desktop", AND 'sudo chmod +x /etc/X11/xinit/xinitrc'. If I didn't make xinitrc executable, the second line that exec's xinitrc fails and I only get a checkered screen.

xinitrc goes on to source /etc/X11/Xsession, which starts a normal desktop. The session is resumable.

(It is worth noting that the above applies only to Ubuntu package 'vnc4server'. Package 'vncserver' is version 3.3.x and doesn't look for ~/.vnc/xstartup. Instead, it fires up /etc/X11/Xsession directly. I guess one can also edit xstartup to exec Xsession instead of xinitrc, leaving xinitrc non-executable.)

I did not enable XDMCP in /etc/gdm/gdm.conf-custom or use xinetd. I start the vncserver manually through SSH, limited to localhost connections, and tunnel the VNC port.

My questions:

What are the vulnerabilities to having to +x /etc/xinit/xinitrc?
Why twm and not a normal desktop by default? Is it purely a bandwidth concern or is there something more serious (security issues), or just nicer/sensible from an implementation perspective (normal desktop startup scripts doing desktop-y things that are unnecessary for remote login--like startup sounds)?
Are there shortcomings to not using xinetd for VNC? I'm running the server on a semi-dedicated machine, so saving resources is not much of a problem. But even on personal machines, is VNC traffic heavy enough to warrant skipping over xinetd altogether?
Does XDMCP provide a remote greeter/login screen upon connect?
What connects opening an Xvnc session to XDMCP? What I mean is this: I tried enabling xdmcp in /etc/gdm/gdm.conf-custom, then started my vncserver as usual. But I saw no difference logging in through a VNC client (i.e.: no login screen). How do I tell that XDMCP is working?

Peatey
August 14th, 2006, 06:56 AM
Why twm and not a normal desktop by default? Is it purely a bandwidth concern or is there something more serious (security issues), or just nicer/sensible from an implementation perspective (normal desktop startup scripts doing desktop-y things that are unnecessary for remote login--like startup sounds)?

From the RealVNC FAQ (http://www.realvnc.com/faq.html#grey) (my emphasis added):



Why do I just get a grey desktop in my Unix VNC Server?
You should run the vncserver script to start a VNC server, rather than the Xvnc program directly. vncserver runs Xvnc with appropriate options and starts some X applications to be displayed in the VNC desktop. The applications it tries to start are specified in $HOME/.vnc/xstartup, which can be tailored to your requirements. The default setup is to run the 'twm' window manager and a single 'xterm' window. If these applications fail to run, then you will see a grey 'rootweave' desktop. The most likely reason applications fail to run is that they are not in your path. Any error messages from this startup should appear in $HOME/.vnc/host:display#.log. For further information see the vncserver manual page.

From the FAQ, it appears that it's none of your reasonable speculations. Looks like the RealVNC folks just started a bare-bones window manager with xterm in case the server was running without any graphical desktop environment. HTH.

turath
August 16th, 2006, 02:38 AM
Well Guys

I ave been trying to follow some of the advice you have given

From my windows box and on the ubuntubox when I

vncviewer localhost:1

The windows opens up I can see the X cursor

but the whole damm thing is grey???


so Umm what did I do wrong :)

-TY

detyabozhye
August 16th, 2006, 03:29 AM
Awesome Howtos man! Page one and page 7.

detyabozhye
August 16th, 2006, 05:02 AM
Tichondrius, thank you for this great tutorial on vnc. People like you are making my switch to linux much easier and enjoyable. My only problem with x11vnc is that when I connect to :0, it does not prompt for a password like :1 does; it just goes straight to what is on my monitor. I am running Breezy AMD64.

Thank you.

Yeah, same problem here, anybody figured this out yet?

detyabozhye
August 16th, 2006, 05:30 AM
Never mind I figured it out:

sudo gedit /etc/xinetd.d/x11vnc

add this:
-rfbauth /root/.vncpasswd

at the end of this line:
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg

turath
August 17th, 2006, 02:15 AM
Awesome Howtos man! Page one and page 7.

Howdy

Ok so far ...I am not sure how it happened...

somewhere between doin work and playing around with this and
this forums support It's working.

Wow you guys are Magical Even

Unfortunately

I have /usr/bin/x11vnc that I need to start up.

How do I have that automatically started up with boot?

I tried it myself by making a

/init.d/xvnc1start

did chmod 700 a+x

update-rc.d xvnc1start

and it did not work.

So Where do I go now?

kingmob
August 26th, 2006, 09:19 PM
Ok, i've been using this for a while now, but i actually want back to the situation where i basicly control screen 0. This so that i can remote control my computer from a handheld device. How do i revert back to the old situation and then make it work in xfce?

kb5won
September 13th, 2006, 04:08 AM
Thanks Tichondrius!

This worked for me using Xubuntu 6.06


Ok, to resume a session you started on your physical display (display :0) all you really need is to turn on Ubuntu's remote desktop feature using the Remote Desktop Preferences dialog box accessible from System->Preferences->Remote Desktop menu item. Just check the first two options there (allow other users to view your desktop and allow other users to control your desktop) and set the password in the bottom of the dialog box (check the REuqire password option), and you're done !
The above uses the built in VNC capability that Ubuntu comes installed with, but the drawback is that it's a little slow, and you need to enable it for each user which wants to allow his desktop to be view or controlled remotely. Also this doesn't allow remote VNC clients to log in to GDM, only to view a GDM session that was started by someone actually using the physical display. So if currently no one is logged in, a remote user cannot connect to display :0 and start a new session.
But don't worry - there is a better way which allows you to view the phyical display remotely and also log-in to a new session from GDM (using a remote VNC client) ! And it works faster (as fast as the regular VNC server), and works for all users. Here's how to do that :

1. Install x11vnc package


sudo apt-get install x11vnc

2. Add x11vnc service to xinetd:


sudo gedit /etc/xinetd.d/x11vnc

Enter this into the new file:



service x11vnc
{
port = 5900
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/x11vnc
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg
disable = no
}


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


sudo /etc/init.d/xinetd stop
sudo killall Xvnc
sudo killall x11vnc
sudo /etc/init.d/xinetd start

4. From a remote machine use your VNC client to connect to display :0


vncviewer vnchost:0

Note that after loggging from GDM and also after logging out from the X-session back and going back to GDM, the VNC client gets disconnected for some reason. So you just need to re-connect and you will get back into the session you logged into. When logging out, the disconnect happens when gnome asks you to confirm your intention to log out, so it's best to turn off the log-out confirmation dialog box by going to System->Preferences->Sessions and un-checking the "ask on logout" option.

Please tell me how this works out for you....I plan to add this to the HOWTO

madubuntuer
September 14th, 2006, 07:43 PM
How come I cant install the package
vnc4server depends on xserver-common; however:
Package xserver-common is not installed.
I am using Dapper

paperdiesel
September 16th, 2006, 06:34 AM
Has anyone been able to get this working using kubuntu 6.06? I followed the guide verbatim, but I get this message:



ti@ti-kubuntu:~$ vncviewer localhost:1
VNC viewer version 3.3.7 - built Feb 20 2006 12:04:05
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)
ti@ti-kubuntu:~$

I even edited my /etc/kde3/kdm/kdmrc and /etc/kde3/kdm/Xaccess files to enable XDMCP, rebooted, and I still get the same error.

Also, if I just run vncserver from the command line, I can then run xvncviewer and connect with no problems. Why can't I connect the normal way? Has anyone got this to work on kubuntu?

rmurphy440m
September 16th, 2006, 08:05 AM
I attempted the install of VNC following the instructions at the beginning of this thread. I try to connect locally but I dont get a login screen in X. I've installed VNC on a windows box and it just ran after opening the port on the firewall...no configuration tweaks and I didnt have to touch the command line..it just installed and ran. Look at how BIG this thread is just to get a simple remote desktop application to work...this is nuts.

paperdiesel
September 17th, 2006, 07:42 AM
FIXED!!!

I found out why I was getting this error:

ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104)

When I had initially installed the packages using apt-get, I did it like this:

wrong way:

sudo apt-get install vncserver xinetd

Apparently, vncserver is NOT the same as vnc4server. So to fix it, I ran:


sudo apt-get remove vncserver

Then I started completely over, this time doing it the right way:

right way:

sudo apt-get install vnc4server

I followed the rest of the steps and it's working perfectly on kubuntu 6.06!

Thanks!

ianma99
September 20th, 2006, 12:33 AM
I'm using 6.06LTS on a non-AMD64 system. After following the instructions at the beginning of this thread verbatim I was having the same problems with Connection reset (104) as many other people. After much frustration I now have a working solution. It seems the problem is that vnc4server will work (partially at least) with the vnccommon package. Hence it works when started from the command line but not from xinetd.

There are two possible options:
1) modify the Xvnc conf file to 'wait = no'. This seems to fix the disconnect problem but then the vnc session is not resumable.

2) make sure that you have the vnc4common package installed - ('apt-get install vnc4server' didn't automatically also get the vnc4common package for me). This now works perfectly for resumable session if you followed the original howto from page 1 of the thread.

Hope this helps somebody else.

shizow
September 20th, 2006, 02:17 PM
i use Kubuntu, how do i have to change the line with gdm?


Ok, to resume a session you started on your physical display (display :0) all you really need is to turn on Ubuntu's remote desktop feature using the Remote Desktop Preferences dialog box accessible from System->Preferences->Remote Desktop menu item. Just check the first two options there (allow other users to view your desktop and allow other users to control your desktop) and set the password in the bottom of the dialog box (check the REuqire password option), and you're done !
The above uses the built in VNC capability that Ubuntu comes installed with, but the drawback is that it's a little slow, and you need to enable it for each user which wants to allow his desktop to be view or controlled remotely. Also this doesn't allow remote VNC clients to log in to GDM, only to view a GDM session that was started by someone actually using the physical display. So if currently no one is logged in, a remote user cannot connect to display :0 and start a new session.
But don't worry - there is a better way which allows you to view the phyical display remotely and also log-in to a new session from GDM (using a remote VNC client) ! And it works faster (as fast as the regular VNC server), and works for all users. Here's how to do that :

1. Install x11vnc package


sudo apt-get install x11vnc

2. Add x11vnc service to xinetd:


sudo gedit /etc/xinetd.d/x11vnc

Enter this into the new file:



service x11vnc
{
port = 5900
type = UNLISTED
socket_type = stream
protocol = tcp
wait = no
user = root
server = /usr/bin/x11vnc
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg
disable = no
}


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


sudo /etc/init.d/xinetd stop
sudo killall Xvnc
sudo killall x11vnc
sudo /etc/init.d/xinetd start

4. From a remote machine use your VNC client to connect to display :0


vncviewer vnchost:0

Note that after loggging from GDM and also after logging out from the X-session back and going back to GDM, the VNC client gets disconnected for some reason. So you just need to re-connect and you will get back into the session you logged into. When logging out, the disconnect happens when gnome asks you to confirm your intention to log out, so it's best to turn off the log-out confirmation dialog box by going to System->Preferences->Sessions and un-checking the "ask on logout" option.

Please tell me how this works out for you....I plan to add this to the HOWTO

GoBieN
September 20th, 2006, 02:34 PM
I had the famous checkboard screen after following all these steps on Ubuntu 6.06 server.
Solution for me:
Log in as normal user in gnome, go to "system menu -> preferences -> remote desktop: Enable the checkboxes at allow to view and allow to control. Furthermore i also changed the settings in System -> Management -> logon window -> tab remote: to "style=same as local" and click on "Configure XDCMP" remove the checkbox at honor indirect requests.

ps: I to have vnc4server with session and the normal vncserver running side by side, altough I only installed the normal vncserver like 5 minutes ago, the seem to work side by side perfectly and automatically use a higer desktop number (:2) beacuse :1 is taken by vnc4server trough xinetd

charles.g.moore
September 23rd, 2006, 08:06 AM
I followed the steps in the how-to perfectly but am still getting the grey pixillated screen when i type: vncviewer localhost:1
My mouse works but the screen just stays grey ???
This is what the output is:

charles@charles-desktop:~$ vncviewer localhost:1
VNC viewer version 3.3.7 - built Feb 20 2006 12:04:05
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See http://www.realvnc.com for information on VNC.
VNC server supports protocol version 3.8 (viewer 3.3)
Password:
VNC authentication succeeded
Desktop name "x11"
Connected to VNC server, using protocol version 3.3
VNC server default format:
16 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 31 green 63 blue 31, shift red 11 green 5 blue 0
Using default colormap and visual, TrueColor, depth 24.
Got 256 exact BGR233 colours out of 256
Using BGR233 pixel format:
8 bits per pixel.
True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6

Could the fact that I am running a dual mointor setup on my desktop be an issue?

Im totally at a loss, I know I probably have not given you guys the info you need to diagnose the prob. but I truthfully don't know what type of info you need. Any help would be appreciated.

btw im running the vnc4server package, on dapper 6.06lts, if you know of a better VNC server please tell me, and maybe a hint at how I would uninstall the vnc4server before adding the other (or do i really even have to uninstall?)

Here is my /etc/xinetd.d/Xvnc:
charles@charles-desktop:~$ sudo cat /etc/xinetd.d/Xvnc
Password:
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
}

detyabozhye
September 23rd, 2006, 04:43 PM
I had the same thing until I restarted (I know ur not supposed to restart on Linux, but hey, it fixed it).

charles.g.moore
September 24th, 2006, 05:48 PM
I had the same thing until I restarted (I know ur not supposed to restart on Linux, but hey, it fixed it).
Restarted and it worked perfectly!!!
Thanks for the reply...

charles.g.moore
September 25th, 2006, 06:51 AM
I logged into my ubuntu box for the first time today and the login was successful but...

I have a dual monitor setup using twinview normally my login prompt shows up on the left screen.

When I logged in for the first time using my wife's windows laptop there was no main panel on the remote view screen and my Gdesklets starterbar did not show up.

I guess I can understand the starter bar not being there and i dont mind putting the icons on my desktop. but the main panel did not show up on the remote screen and when I went back to my original ubuntu box the main panel was now on the right side rather than the left.

even worse when I tried to move it back to the left side it kept going back to the right, the only way it would stay is if i restarted then moved it.

Now on top of that the login box shows up on the right screen instead of the left like before now...?

Any help would be appreciated.

i used the login_name.server_name.com:1 to get into my home box. should I have used two or something???

What does this mean too. I quit the remote VNC connection by closing the box and restarted my ubuntu box but I get this:

charles@charles-desktop:~$ who
charles :0 2006-09-24 22:50
charles pts/0 2006-09-24 22:59 (:0.0)
charles@charles-desktop:~$

Is that connection still open?

dissdigg
October 2nd, 2006, 07:29 AM
Never mind I figured it out:

sudo gedit /etc/xinetd.d/x11vnc

add this:
-rfbauth /root/.vncpasswd

at the end of this line:
server_args = -inetd -o /var/log/x11vnc.log -display :0 -auth /var/lib/gdm/:0.Xauth -many -bg


Thank you for this.

Just did a fresh install of 6.06 and didn't have luck with Xvnc, but x11vnc is working.

Anyone happen to know the server_args to customize the resolution?

justincataldo
October 4th, 2006, 06:26 AM
Woohoo it works!

I had to add:
gnome-session & ...to my ~/.vnc/xstartup file (instead of):
twm &

magquatre
October 7th, 2006, 03:58 AM
I had the famous checkboard screen after following all these steps on Ubuntu 6.06 server.
Solution for me:
Log in as normal user in gnome, go to "system menu -> preferences -> remote desktop: Enable the checkboxes at allow to view and allow to control. Furthermore i also changed the settings in System -> Management -> logon window -> tab remote: to "style=same as local" and click on "Configure XDCMP" remove the checkbox at honor indirect requests.

ps: I to have vnc4server with session and the normal vncserver running side by side, altough I only installed the normal vncserver like 5 minutes ago, the seem to work side by side perfectly and automatically use a higer desktop number (:2) beacuse :1 is taken by vnc4server trough xinetd


thanks a bunch, that fixed my grey screen problem too. of course after i rebooted.

magquatre
October 7th, 2006, 04:02 AM
Thank you for this.

Just did a fresh install of 6.06 and didn't have luck with Xvnc, but x11vnc is working.

Anyone happen to know the server_args to customize the resolution?


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 -o$
port = 5901
}

-geometry flag will do the trick. that is if you are using xvnc. not sure about the x11vnc

try the man page.
http://manpages.debian.net/cgi-bin/display_man.cgi?id=6bc299cad023497ac2424006adba379 2&format=html

thanathos
October 15th, 2006, 02:18 AM
Hi Guys

I'm a total noob when it comes to linux....but i want to try and learn....
So , I got Unbuntu on one of my machines...about 2 hours ago
I tried to setup a VNC server ... followed all the instructions in the first post...
Well...i ran out of luck about here :

sudo gedit /etc/xinetd.d/Xvnc

I got the wondow opened but after I paste the suggested text...i can't save it.:-| It just gives me an error : could not save the file /etc/xinetd.d/Xvnc

a small kick in the a$$ for a big step forward anyone?
thanks

MBaran
October 18th, 2006, 07:16 AM
I just wanted to post and update to this thread for anyone experiencing problems with Edgy (and maybe Beryl? not sure if thats what hosed me) setting this up.


In the /etc/xinetd.d/Xvnc file

change -fp /usr/share/X11/fonts/misc

TO

-fp /usr/share/fonts/X11/misc

This was my findings after ~2 hours of working away between x11vnc and vnc4server.

Thx.!

lovepolo
October 26th, 2006, 10:42 PM
Hi All,

I followed OP's instruction and am able to run flawless. But I recently found some hacker got into my machine with vnc viewer. My password is reasonably long.

Can anybody confirm with me this method will have security issue?

detyabozhye
October 27th, 2006, 01:44 AM
Thank you for this.

Just did a fresh install of 6.06 and didn't have luck with Xvnc, but x11vnc is working.

Anyone happen to know the server_args to customize the resolution?

I don't think you can set the resolution there, because it's forwarding your physical display.

reVox
October 27th, 2006, 01:21 PM
I just wanted to post and update to this thread for anyone experiencing problems with Edgy (and maybe Beryl? not sure if thats what hosed me) setting this up.


In the /etc/xinetd.d/Xvnc file

change -fp /usr/share/X11/fonts/misc

TO

-fp /usr/share/fonts/X11/misc

This was my findings after ~2 hours of working away between x11vnc and vnc4server.

Thx.!

Hey a big thanks MBaran - I just upgraded to Edgy and my vncviewer wasn't authenticating (i was not being prompted for password). I had to reestablish my System/Administration/login window/remote/style to 'same as user' in addition to your fix above. finally, was getting the grey screen after manual stop and start, so restarted system, and it worked first go. many thanks again! you saved me a good deal of ](*,) time.

fm1234
October 29th, 2006, 12:36 AM
Hi

after updrading from 606 to 6.10 my vnc setup stopped working. After trying it out in the command line I found out there was a problem with the fixed font. The font path is different: /usr/share/fonts/X11/misc (fonts and X11 are swapped).

I am now able to run Xvnc from the command line and connect to it. However, I'm not able to have it running from xinetd. It listens to the port but Xvnc is not running. The xinetd.log file is not useful: "... 1 service running". I've also tried to set a logfile for the Xvnc service but the file stays empty. If I try to connect to Xvnc I get the error "...too many connections...".

I'm stuck here. Suggestions?

TIA,
Fernando

Footer
October 30th, 2006, 10:26 PM
Fernando,

Could you explain a little further exactly where you switched around fonts and X11? My vncviewer quit working as well when I went from Dapper to Edgy and it's not clear to me how I fix this. Even after reading all of these posts! It worked just fine under Dapper!

Here's the error I get:

vncviewer media_machine:2
VNC viewer version 3.3.7 - built Jul 4 2006 10:04:48
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See http://www.realvnc.com for information on VNC.
VNC server supports protocol version 3.3 (viewer 3.3)
Password:
VNC authentication succeeded
Desktop name "media_machine:2"
Connected to VNC server, using protocol version 3.3
VNC server default format:
32 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Warning: Cannot convert string "-*-helvetica-bold-r-*-*-16-*-*-*-*-*-*-*" to type FontStruct
Warning: Unable to load any usable ISO8859 font
Warning: Unable to load any usable ISO8859 font
Error: Aborting: no font found

Thanks in advance!

iansyngin
November 5th, 2006, 02:23 PM
Tried the following


sudo Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswdNow, from another terminal try to connect:


vncviewer localhost:2tell me if that works......[/quote]

I receive the following after

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


Sun Nov 5 13:20:56 2006
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5902
vncext: created VNC server for screen 0

Fatal server error:
could not open default font 'fixed'

Footer
November 5th, 2006, 02:39 PM
I answered my own question and fixed my vncviewer font problem. See reply #8 in this thread:

http://www.ubuntuforums.org/showthread.php?t=288963

Not sure about the HOWTO subject of this thread however.

pjman
November 8th, 2006, 03:53 AM
I just wanted to post and update to this thread for anyone experiencing problems with Edgy (and maybe Beryl? not sure if thats what hosed me) setting this up.


In the /etc/xinetd.d/Xvnc file

change -fp /usr/share/X11/fonts/misc

TO

-fp /usr/share/fonts/X11/misc

This was my findings after ~2 hours of working away between x11vnc and vnc4server.

Thx.!



Hey a big thanks MBaran - I just upgraded to Edgy and my vncviewer wasn't authenticating (i was not being prompted for password). I had to reestablish my System/Administration/login window/remote/style to 'same as user' in addition to your fix above. finally, was getting the grey screen after manual stop and start, so restarted system, and it worked first go. many thanks again! you saved me a good deal of ](*,) time.

Thank you both!

grahams
November 9th, 2006, 06:38 PM
I also have problems getting vncviewer to work on Edgy.

I get "ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104)" errors.

I tried the solution of swapping fonts <-> X11 in /etc/xinitd.d/Xvnc and it allowed me to start vncviewer, however I found out later that it appears to screw up my networking after a reboot (I could not ping even my local router). Editing /etc/xinitd.d/Xvnc back to the edgy default and rebooting cures the networking, but of course stops vncviewer.

Has anyone got a fully working solutions? i.e. tried rebooting with this change and still have networking.

jehosephat
November 9th, 2006, 09:49 PM
Am I missing something obvious here? I'm running a fresh install of 6.06.1 on amd64 (Pentium D Smithfield, Dell 9150) ... as far as I can tell this is the latest and greatest on the VNC over SSH issue, and Tichondrius has addressed the known bug for vnc, tightvnc, and vnc4 on amd64 systems (can't find 'fixed' font, graphical applications crash while opening over VNC connection). However, I can't seem to find resolutions here to the following two problems:

(1) Out of the box, under 6.06.1, the first step in the HOWTO is inaccurate: ther is no XDMCP option under the Security tab under Login Window Preferences. While I believe I've verified that it's enabled (by looking in gdm.conf, I believe), this makes me nervous that something's not right.

(2) MOST IMPORTANT: when installing the "fixed" vnc4server and xvnc4viewer (fixed for amd64 systems) there's a missing dependency: xerver-common. While someone posted and said he had success just forcing the install (dpkg -i --force-all or --force-depends), I still have the amd64 bug behavior, so I suspect this is a problem as well. From what I've googled, it seems that xserver-common has become xorg-common, but that doesn't tell me what to do about that dependency.

Thanks for all the great help so far ...
Can anyone advise on these issues?

jehosephat
November 9th, 2006, 09:51 PM
... I should have said - after forcing the install of the "fixed" .deb packages, I still have the amd64 bug ...

dmizer
November 10th, 2006, 01:32 AM
Am I missing something obvious here?
like ... you're working with a howto that was written for breezy?


(1) Out of the box, under 6.06.1, the first step in the HOWTO is inaccurate: ther is no XDMCP option under the Security tab under Login Window Preferences.
see above. in breezy, this was indeed an option.


(2) MOST IMPORTANT: when installing the "fixed" vnc4server and xvnc4viewer (fixed for amd64 systems) there's a missing dependency: xerver-common. While someone posted and said he had success just forcing the install (dpkg -i --force-all or --force-depends), I still have the amd64 bug behavior, so I suspect this is a problem as well. From what I've googled, it seems that xserver-common has become xorg-common, but that doesn't tell me what to do about that dependency.
welcome to the world of the 64bit kernel :p . again, your issue here is that you're working with dated material. when i used this howto back in breezy, it worked fantastic. after my update to dapper, it stopped working, and i haven't been able to make it work since. but i have since become comfortable using the terminal so i haven't tried to make it work again.

anyway ... point is, don't complain about the howto because it worked well when it was written. you'll need to take the howto and adapt it to your situation now. i'm not trying to be antagonistic, i'm just hoping that, by realizing this, you'll be able to find your solution more easily.

jehosephat
November 10th, 2006, 02:01 AM
I figured it was written for pre-dapper ... (but, er ... where is that noted in the HOWTO? again, I'm probably missing something obvious).

Well, at one point I tried patching the vncserver source with a patch from a bugzilla ... it didn't work, but since that was the first time I'd ever built software from source I may well have made a boo-boo! I'll definitely post again if I can sort it out ... that is, if I don't get lazy with the partial solution of using x11vnc.

Thanks.

dmizer
November 10th, 2006, 12:55 PM
I figured it was written for pre-dapper ... (but, er ... where is that noted in the HOWTO? again, I'm probably missing something obvious).
the date of the post and most recent edit date are pre dapper ;)

i do highly suggest wading through the entire thread though ... maybe working your way backwards. someone else may have found and fixed your problem already.

Yako
November 10th, 2006, 01:31 PM
I just wanted to post and update to this thread for anyone experiencing problems with Edgy (and maybe Beryl? not sure if thats what hosed me) setting this up.


In the /etc/xinetd.d/Xvnc file

change -fp /usr/share/X11/fonts/misc

TO

-fp /usr/share/fonts/X11/misc

This was my findings after ~2 hours of working away between x11vnc and vnc4server.

Thx.!

I had the same experience. I couldnt figure out why xinetd kept restarting and crashing Xvnc.
Thanks for the help!

grahams
November 10th, 2006, 10:48 PM
I also have problems getting vncviewer to work on Edgy.

I get "ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104)" errors.

I tried the solution of swapping fonts <-> X11 in /etc/xinitd.d/Xvnc and it allowed me to start vncviewer, however I found out later that it appears to screw up my networking after a reboot (I could not ping even my local router). Editing /etc/xinitd.d/Xvnc back to the edgy default and rebooting cures the networking, but of course stops vncviewer.

Has anyone got a fully working solutions? i.e. tried rebooting with this change and still have networking.

I set up vnc on a separate Edgy system and the Xvnc works fine and doesn't effect networking. So the problem I report above are local to my setup.

If anyone has clues as to where I should look to fix this, I'd be very grateful

jay73
November 16th, 2006, 07:41 AM
My vnc ubuntu desktop session log's out and "kills" all running programs when i disconnect my vcn client (session)... Why does it do that? ](*,) ](*,) :evil: :-k

breuerp
December 1st, 2006, 04:00 PM
I also have problems getting vncviewer to work on Edgy.

I get "ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104)" errors.

I tried the solution of swapping fonts <-> X11 in /etc/xinitd.d/Xvnc and it allowed me to start vncviewer, however I found out later that it appears to screw up my networking after a reboot (I could not ping even my local router). Editing /etc/xinitd.d/Xvnc back to the edgy default and rebooting cures the networking, but of course stops vncviewer.

Has anyone got a fully working solutions? i.e. tried rebooting with this change and still have networking.

Can someone explain to me what broke? The solution "works" but I'm not following how someone got from the error message to the solution.

](*,)

johnnymac
December 7th, 2006, 03:23 PM
The answer may be here and I'm not seeing it but...


I do this tutorial and it's all working except I'm not getting a GDM, I'm getting this screen - almost like the login manager won't run. Is this some sort of font or RGB setting issue? [See Screenshot]

Any help is appreciated....

hxx4
December 10th, 2006, 11:29 PM
I originally had the problem
ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104) when I typed
xvncviewer localhost:1 and then I tried to manually create the server with
sudo /usr/bin/Xvnc :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/X11/fonts/misc -nevershared -rfbauth /root/.vncpasswd but got an error
Fatal server error:
could not open default font 'fixed'I then found this (http://www.fifi.org/doc/vnc-common/faq.html) FAQ and looked at the question for the error "Could not open default font 'fixed'. ". I typed
xset qand copied the font path to the file /etc/xinetd.d/Xvnc. Then I restarted my computer and typed
xvncviewer localhost:1again and it worked!

pkbarber
December 11th, 2006, 11:54 PM
Ive got that same "grey" screen problem. Im sure its something ridiculously simple somewhere but currently its beyond me.

pkbarber
December 12th, 2006, 12:10 AM
Ok that grey screen thing is REAL easy fix... I was just careless! You need to go System>Administration>Login Window>Remote and select Same as Local. That works for me!

eku
December 28th, 2006, 01:32 PM
Ok, I don't know what I'm doing wrong, but I just can't get it working. All I get is X and grey/black checkerboard.

I don't have any monitor or keyboard or nothing connected to the box right now.

I belive I've tried everything in this topic. It's just not fair. :(

Footer
December 28th, 2006, 01:42 PM
http://www.realvnc.com/faq.html#grey

Does that solve your problem?

:)

eku
December 28th, 2006, 03:03 PM
http://www.realvnc.com/faq.html#grey

Does that solve your problem?

:)


You should run the vncserver script to start a VNC server, rather than the Xvnc program directly.

How do I do that?

Footer
December 28th, 2006, 03:11 PM
How do I do that?

From a term window:


vncserver

or if you want root to start the process:


sudo vncserver

eku
December 28th, 2006, 04:39 PM
Footer, thanks, it helped, a bit, I think. But I still don't get any desktop with icons or stuff. Only a term running.

What do I need to put in to the xstartup file? tdw? gdw? Something else?

Why Allah hates me? :(

Footer
December 28th, 2006, 05:18 PM
Here's a pretty good tutorial:

http://www.skullbox.net/vncserver.php

Near the end you'll see what needs to be in the xstartup file, basically:


startx &

or


startkde & (for KDE desktop)

You may need to provide the specific path if startx or startkde aren't in your path.

Good luck!

:)

eku
December 28th, 2006, 08:00 PM
Okay, seems like the problem is in X.org config. Tells me that there's no screens found. What to do next?

Footer
December 28th, 2006, 10:56 PM
Could you post your exact error message? Are you sure it's not "no fonts found"?

What version of U(K)ubuntu are you running? I had problems with VNC when I upgraded to Edgy from Dapper. See my posts #171 & #173 in this thread for how I solved that problem.

In either case, please post your exact error message so we can continue troubleshooting.

Thanks!

eku
December 29th, 2006, 12:04 AM
Could you post your exact error message? Are you sure it's not "no fonts found"?

What version of U(K)ubuntu are you running? I had problems with VNC when I upgraded to Edgy from Dapper. See my posts #171 & #173 in this thread for how I solved that problem.

In either case, please post your exact error message so we can continue troubleshooting.

Thanks!

Seems like I'm running 6.06. Should I upgrade and then try again?
This is what ~/.vnc/laeski:2.log contains:

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


Thu Dec 28 22:04:47 2006
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5902
vncext: created VNC server for screen 0
Could not init font path element /usr/share/X11/fonts/TTF/, removing from list!
Could not init font path element /usr/share/X11/fonts/OTF, removing from list!
Could not init font path element /usr/share/X11/fonts/CID/, removing from list!
Option --login is no longer supported in this version of gnome-terminal; you might want to create a profile with the desired setting, and use the new --wind$
xauth: creating new authority file /home/lauri/.serverauth.14946


X Window System Version 7.0.0
Release Date: 21 December 2005
X Protocol Version 11, Revision 0, Release 7.0
Build Operating System:Linux 2.6.15.7 i686
Current Operating System: Linux laeski 2.6.15-23-686 #1 SMP PREEMPT Tue May 23 14:03:07 UTC 2006 i686
Build Date: 16 March 2006
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Module Loader present
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Thu Dec 28 22:04:51 2006
(==) Using config file: "/etc/X11/xorg.conf"
(EE) No devices detected.

Fatal server error:
no screens found

Thu Dec 28 22:04:54 2006
Connections: accepted: 87.94.xxx.xxx::51119
SConnection: Client needs protocol version 3.4
SConnection: Client uses unofficial protocol version 3.4
SConnection: Assuming compatibility with version 3.3
XIO: fatal IO error 104 (Connection reset by peer) on X server ":0.0"
after 0 requests (0 known processed) with 0 events remaining.
Couldnt get a file descriptor referring to the console

Thu Dec 28 22:05:00 2006
VNCSConnST: Server default pixel format depth 16 (16bpp) little-endian rgb565
VNCSConnST: Client pixel format depth 16 (16bpp) little-endian rgb565

Thu Dec 28 22:22:56 2006
Connections: closed: 87.94.xxx.xxx::51119 (Clean disconnection)
SMsgWriter: framebuffer updates 20
SMsgWriter: ZRLE rects 17, bytes 3441
SMsgWriter: raw bytes equivalent 1601676, compression ratio 465.468178

For some reason :1 shows the checkerboard (or whatever) screen, and to get just grey background with Gnome terminal to :2, I have to run 'vnc4server'. (Seems like I confused these two before.)

Footer
December 29th, 2006, 02:24 PM
I'm sort of confused. What system are you running vncserver on (or vnc4server as you indicated?) and what system are you running vncviewer on? Are they both Ubuntu boxes? And no, you shouldn't need to upgrade to Edgy, Dapper should work fine.

Maybe you should remove the programs from both boxes (vncserver/vncviewer) and start over following that tutorial I sent a link for earlier. Then fire up vncserver on the box you want you want to vnc to, go back to the box you want to vnc from and fire up vncviewer:


vncviewer 192.168.1.xxx:1

and see if it works. I know you're close but perhaps this might clear out some of the bugs? I was hoping to see a log of your vncviewer session but it looks like there might be a problem on the vncserver end as well.

Tricky stuff. Keep trying and remember, Google is your friend!

:)

eku
December 30th, 2006, 12:29 PM
Horay for me!

I just needed to run 'x-session-manager' to get it up and running. But would someone tell me why it worked that way?

Footer
December 30th, 2006, 04:03 PM
WHOOHOO!!! Congrats for figuring it out! I've never had to use that as installing the server and viewer have always worked for me ... Aside from the font problem when I went to Edgy.

Well, good job! I'm glad you finally figured it out. Hopefully others will benefit from your success if they run in to the same problems!

:)

Rob_H
December 30th, 2006, 07:50 PM
Tichondrius, thanks for a great HOWTO!

KDE users: I've taken the liberty of adapting this to Kubuntu Edgy. The process is a bit different for KDM. If anyone's interested, I've posted the revised HOWTO (http://kubuntuforums.net/forums/index.php?topic=12376.0) in the Kubuntu forums.

bhamail
December 31st, 2006, 09:01 PM
Maybe a note could be added to the first HowTo page:

On edgy the font path is wrong in "server_args =..." in /etc/xinetd.d/Xvnc:

howto shows:


-fp /usr/share/X11/fonts/misc

but I had to change it (as per another post in this thread) to:


-fp /usr/share/fonts/X11/misc

The symptom was vnc errors like:
ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104)
when trying to connect.

Also, when manually executing the vncserver command with the bad font path, I saw errors like: "Fatal Error" ... couldn't find font 'fixed'

billycub
January 6th, 2007, 02:39 AM
I finally got this working on Edgy AMD64 -- yay! Here are the steps that worked for me, slightly different than the original howto above:

1. Install xinetd, vnc4server, xvncviewer. The regular vncserver package does not work which is why you need to install vnc4 (from universe).

2. Create the file /etc/xinetd.d/Xvnc and paste the following in:


Note that the snippet below has a few differences from the original howto: (1) the fontpath entry is specific to Edgy; (2) the server directive needs to be /usr/bin/Xvnc4, not Xvnc; (3) I used no security but you can use the password file from the original howto if you like. For my use case I didn't need it.


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


3. System - Admin - Login Window: On "Remote" tab, change Style: to something other than 'disabled'.

4. Reboot.

Now I can VNC in using hostname:1 and it works like a charm. Good luck!

-Billy

Marzocchi
January 8th, 2007, 10:12 PM
I've done everything in the guide, but for some reason I get the following when I try to connect

ReadFromRFBSServer: rdr::EndOfStream

Any ideas what this is about?

perlappuntu
January 9th, 2007, 12:15 AM
I had the same problem yesterday then I reverted the vncserver package back to the previous version and the problem went away. In may case the problem happened after updating the package to the latest version, that's why I tried to go back...

biggunks
January 9th, 2007, 12:33 AM
Has anyone seen this problem before?

I've had X and VNC working before. I don't know what's happening. I'm sure it's something simple.

Marzocchi
January 9th, 2007, 03:56 PM
Now I get

ReadFromRFBServer: rdr::SystemException: read: Connection reset by peer (104)

instead. Even though I have changed the from /X11/fonts/ to fonts/X11/

coulier
January 10th, 2007, 03:03 PM
Hi!

I had the "ReadFromRFBSServer: rdr::EndOfStream" error message. Removing "-query localhost" from the server_args line in /etc/xinetd.d/Xvnc file solved this problem.

Now, I can connect to the vnv4server, but I get that grey screen.

I don't know how to get the login screen back!
I have only ssh access to this machine now, so I cannot go to System>Administration>Login Window>Remote and select Same as Local as suggested by pkbarber in post #188
Is there a way to modify this setting from a config file?

Everything was working fine on my edgy box, untill I made some update from uate_manager. I did'nt write down which packages were being updated, though.

Any help will be appreciated....

François

gregwill
January 10th, 2007, 07:45 PM
I have a reasonably fresh install of 6.10 on AMD64 and the Xvnc4 setup recommended by billycub isn't working for me either - if the latest vnc4server package is broken, is there any way for me to get the previous one?

It's clearly listening on the right port:

tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 4814/xinetd

But if I try to connect using a VNC client locally or remotely, they all seem to connect (and initially start drawing a gray screen) and then quickly get dropped, e.g.:

---------------
$ vncviewer localhost:1

VNC Viewer Free Edition 4.1.1 for X - built Jan 6 2007 09:47:04
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Wed Jan 10 18:30:12 2007
CConn: connected to host localhost port 5901
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
TXImage: Using default colormap and visual, TrueColor, depth 24.
CConn: Using pixel format depth 6 (8bpp) rgb222
CConn: Using ZRLE encoding

Wed Jan 10 18:30:16 2007
main: write: Broken pipe (32)
------------

Does Xvnc4 have any logs anywhere?

perlappuntu
January 10th, 2007, 07:47 PM
To confirm the what reported in the previous message (from coulier) I restate what I reported before: my problems with vnc and resumable sessions (vncserver instanciated by xinetd) started Saturday when I updated vnc4server to the lastest version, once I reversed it back to the previous release the problem went away. Overall I still have problems using vnc though, few days ago I wrote a message (http://www.ubuntuforums.org/showthread.php?t=333738&highlight=vnc) in the forum to explain the issues but I didn't get any feedback so far. :-( Briefly when I start a vnc session from ssh I get a gray screen on the vncviewer window, in my case the cause seems to be the fact that gnome fails to start. I do not know how to fix it, if someone has any suggestion...

perlappuntu
January 10th, 2007, 07:54 PM
You can select the version of the package you want to use. Unfortunately I do not have the desktop in front of me to give you all the precise steps to do it but you can use the graphical package manager to uninstall the version of vnc4server you use then install it again, there is an option to select the version, pick the previous one. If I remember properly you can access the available version list clicking on the object (vnc4server) properties. I can give you the exact procedure later today if you will still need it.


I have a reasonably fresh install of 6.10 on AMD64 and the Xvnc4 setup recommended by billycub isn't working for me either - if the latest vnc4server package is broken, is there any way for me to get the previous one?

It's clearly listening on the right port:

tcp 0 0 0.0.0.0:5901 0.0.0.0:* LISTEN 4814/xinetd

But if I try to connect using a VNC client locally or remotely, they all seem to connect (and initially start drawing a gray screen) and then quickly get dropped, e.g.:

---------------
$ vncviewer localhost:1

VNC Viewer Free Edition 4.1.1 for X - built Jan 6 2007 09:47:04
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Wed Jan 10 18:30:12 2007
CConn: connected to host localhost port 5901
CConnection: Server supports RFB protocol version 3.8
CConnection: Using RFB protocol version 3.8
TXImage: Using default colormap and visual, TrueColor, depth 24.
CConn: Using pixel format depth 6 (8bpp) rgb222
CConn: Using ZRLE encoding

Wed Jan 10 18:30:16 2007
main: write: Broken pipe (32)
------------

Does Xvnc4 have any logs anywhere?

gregwill
January 10th, 2007, 08:11 PM
Yes, you are right - downgrading vnc4server package from 6.10.1 to the previous version fixes it for me - thanks!

chrigri
January 10th, 2007, 10:30 PM
Yes, I can confirm that downgrading fixes the problem.

--
Christer

coulier
January 11th, 2007, 11:16 AM
hI!

I don't have an easy physical access to the machine. Is there away to downgrade using an ssh connexion?

François

bhamail
January 12th, 2007, 04:10 AM
coulier,

I was able to "downgrade" via an ssh connection and apt-get using:


$ sudo apt-get install vnc4server/edgy

This will get the vnc4server from the "edgy" repo (instead of the latest from the "edgy-security").

The stuff below is just for info: Here's what I found in the man pages for apt-get:

A specific version of a package can be selected for installation by following the package name with an equals and the version of the package to select. This will cause that version to be located and selected for install. Alternatively a specific distribution can be selected by following the package name with a slash and the version of the distribution or the Archive name (stable, testing, unstable).

I found the exact version of what I have installed by trying to install from "edgy-security":


$sudo apt-get install vnc4server/edgy-security
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version 4.1.1+xorg1.0.2-0ubuntu1.6.10.1 (Ubuntu:6.10/edgy-security) for vnc4server
vnc4server is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

I then did the "downgrade" from "edgy":


$ sudo apt-get install vnc4server/edgy
Reading package lists... Done
Building dependency tree
Reading state information... Done
Selected version 4.1.1+xorg1.0.2-0ubuntu1 (Ubuntu:6.10/edgy) for vnc4server
Suggested packages:
vnc-java
The following packages will be DOWNGRADED:
vnc4server
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 1011kB of archives.
After unpacking 81.9kB disk space will be freed.
Do you want to continue [Y/n]? y

Hope this helps.
Dan

PS: I'm just a little worried that the security patch broke things, and wondering if anyone knows how to make it all work with the latest "security" patched version???

coulier
January 12th, 2007, 10:20 AM
Thanks so much for the tip!
I will test it ASAP (right now, and for unknown reason, I can't get through to fr.archive.ubuntu.com: 80 (194.2.0.36) .

François

SVWander
January 12th, 2007, 06:44 PM
At one time I had vnc server on two computers both with Ubuntu 6.10. I had to reinstall Ubuntu on this machine and have set up the wireless connection without too much trouble. But now when I run: vncviewer localhost:0

a dialog comes up asking:

Question
Another user is trying to view your desktop
A user on computer '127.x.x.x' is trying to remotely view or control your desktop.
Do you want to allow them to do so?

When I click allow the screen switches to a view of my other desktop . . . then to hundreds of views cascading down. Actually the other screen has an open desktop . . . with nothing on it.

The terminal reports these settings:

tim@tim-desktop:~$ vncviewer localhost:0
VNC viewer version 3.3.7 - built Jul 4 2006 10:04:48
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See http://www.realvnc.com for information on VNC.
VNC server supports protocol version 3.7 (viewer 3.3)
No authentication needed
Desktop name "LibVNCServer"
Connected to VNC server, using protocol version 3.3
VNC server default format:
32 bits per pixel.
Least significant byte first in each pixel.
True colour: max red 255 green 255 blue 255, shift red 16 green 8 blue 0
Using default colormap and visual, TrueColor, depth 24.
Got 256 exact BGR233 colours out of 256
Using BGR233 pixel format:
8 bits per pixel.
True colour: max red 7 green 7 blue 3, shift red 0 green 3 blue 6
Using shared memory PutImage
ShmCleanup called

Before when I used the command I would be prompted for my password (I did use the howto this time to set up my password whereas before I didn't but it still worked). Does anyone know how I messed this up?

Tm

breuerp
January 13th, 2007, 05:14 PM
I seem to keep fighting this thing. I have VNC running by forcing install the amd64 packages:


sudo dpkg -i --force-all xvnc4server_4.0-7.3_amd64.deb
sudo dpkg -i --force-all vnc4server_4.0-7.3_amd64.deb

The problems are:
a) This is not the latest version (by a long shot) so I'm concerned about vulnerabilities
b) *MORE* importantly, apt-get/synaptic report the application as broken (since it's not the latest version) and won't let me update/upgrade any other packages until I "fix" it. Of course "fixing" it means that I upgrade to the latest version which appears to not have the AMD64 bug corrected on it.

Does anyone know where I can get a newer version of a vnc server package that will run on AMD64? FreeNX is not an option because resumable sessions are an absolute requirement.

Thanks.

Hubris2
January 16th, 2007, 04:21 PM
Thanks for both the original guide and the subsequent posts. I'm still having a couple issues and I was hoping someone might catch something I'm missing.

I remote my Edgy 6.10 box via SSH; using Vino I can connect to session 0 with no problems, other than it being slow and a much larger screen than my remote terminal.

I've followed the original guide and installed vnc4server and configured it for session 1. I too had to change the font path as has been mentioned by a couple folks. I've set the VNC password, and confirmed that port 5901 is being listened.

From a local terminal, if I execute vncviewer localhost:1 I'm prompted for a password, and after entering it I get
ReadFromRFBServer: rdr::EndOfStream


When I try connect from remote (I know...local should be working first....) with a tunnel connected to port 5901, VNC reports an immediate disconnect - before even asking for the password.

When I check the syslog, I find
xinetd[6043]: warning: can't get client address: Transport endpoint is not connected
Does anyone have any ideas why I can connect to vino on session 0, but can't connect to the separate vnc server on session 1?

Thanks!

cdt24
January 17th, 2007, 12:20 AM
I successfully got a single vnc server up and running just like the original HOWTO described. Howver, I would like to not be limited to just one server running like this. Ideally, what I'd like to do is enable anybody to login remotely via ssh, fire up a vncserver session with their own geometry, color depth, etc. and let them then connect to that server through the ssh tunnel. Seems like I need something more dynamic, but I have no idea how to go about doing that. Help!

Hubris2
January 17th, 2007, 01:42 AM
Related to my error message (VNC server failing to connect) I've located the following notice of a bug. This states that the Dapper install is fine, but the Edgy install has a problem.

Anyone?

https://launchpad.net/ubuntu/+source/vnc4/+bug/78282

I found a solution to my problem....downgrade to the older version of vnc4server. One version back I am able to connect with no problems and no crashes.

grahams
January 17th, 2007, 06:09 AM
Hi

I've been using this setup for months on edgy, but recently it just stopped working and I need help.

This is the output I get from vncviewer, which has been working for months and now stopped on 2 systems and I can't think of any common thread. I think the error is coming from vncserver.

$ vncviewer :1
VNC viewer version 3.3.7 - built Jul 4 2006 10:04:48
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See http://www.realvnc.com for information on VNC.
VNC server supports protocol version 3.8 (viewer 3.3)
Password:
ReadFromRFBServer: rdr::EndOfStream
Edit/Delete Message
Looks like Xvnc stopped running.

ps -ef |grep vnc
grahams1 7400 5040 0 09:18 pts/0 00:00:00 grep vnc

If I start Xvnc manually I get "error opening security policy file /etc/X11/xserver/SecurityPolicy"

coulier
January 17th, 2007, 05:59 PM
Hi,

I moved a little bit up.
Now,
sudo Xvnc4 :2 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared -PasswordFile=/root/.vncpasswd works (although the server complains:
error opening security policy file /etc/X11/xserver/SecurityPolicy, and hang when I disconnect from the display.

However, I still get that grey screen with X-like pointer when connecting to :1
Xvnc is as follows:

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

Any help?

François

perlappuntu
January 17th, 2007, 09:20 PM
I'm still struggling with the vncserver but I was able to fix the problem related to /etc/X11/xserver/SecurityPolicy creating a software link to the new location. Once I fixed it my problem moved to start gnome within the VNC session, I wrote about it in the forum (message #1 (http://www.ubuntuforums.org/showthread.php?t=333738&highlight=vnc)) but it looks nobody knows how to fix it...


...
error opening security policy file /etc/X11/xserver/SecurityPolicy
...

grahams
January 18th, 2007, 03:03 AM
There is an issue with the latest vnc4server see bug https://bugs.launchpad.net/ubuntu/+source/vnc4/+bug/78282

Downgrading vnc4server cures the issue until the bug is fixed.

neoflight
January 19th, 2007, 02:01 AM
all i get is

vncviewer xxx.xxx.xxx.xxx:1
VNC viewer version 3.3.7 - built Jul 4 2006 10:04:48
Copyright (C) 2002-2003 RealVNC Ltd.
Copyright (C) 1994-2000 AT&T Laboratories Cambridge.
See http://www.realvnc.com for information on VNC.
vncviewer: ConnectToTcpAddr: connect: Connection refused
Unable to connect to VNC server


i can start the xwindow by vncviewer localhost:0 no problem here....

i am using ubuntu with uni wireless & vpn to connect to a ubuntu pc in the uni lan..

any ideas? is the vpn causing the problem...?
i dont know a thing about port forwarding and all....

what is a port](*,) and how to tell it to use one? :-k

thanks

Hubris2
January 19th, 2007, 03:09 PM
If you can connect to port 0 on the remote box, then there isn't an issue with any of the network connectivity between you. On Ubuntu, session 0 is managed by vino (the 'remote desktop') while sessions 1 and above are typically an entirely separate VNC server, with different settings and config.

Is there a firewall on this box? Session 0 connects on port 5900, but session 1 is on 5901.

borland-c
January 19th, 2007, 09:31 PM
Yes, you are right - downgrading vnc4server package from 6.10.1 to the previous version fixes it for me - thanks!please explain howto downgrade vnc4server package, yes I can remove vnc4server but how to install older verision? where I can find it?

Hubris2
January 19th, 2007, 10:44 PM
Go to system, administration, Synaptic package manager.

Scroll down to the package for the server you installed, click it. Choose 'package' from the drop-down menu, and you have an option of 'force package'. That will give a pull-down with (in my case 2) choices....

After you've selected the older version, you have to apply - and it will make the change.

Crass Spektakel
January 20th, 2007, 07:31 AM
Two things about setting up your VNC like described here:

1. You have to run your Display Manager (most likely gdm) or otherwise you will end up with the default X11 checker board background and nothing else. Run your Display Manager even if you aren't interested in loging into X11 at the system locally. There are ways to disable the local VGA-Display-Output and safe some memory but this is not the time and place to go into details.

2. I had to "chmod 755 /etc/X11/xinit/xinitrc" or otherwise my Xvnc only came up when called from commandline but not from inetd/xinetd. But after chmoding vnc4 also runs with the most recent vnc4server-packet.

josesanders
January 23rd, 2007, 06:07 PM
Initially, it just didn't work, so I did this to fix the font problem:

$ cd /usr/share/X11
$ sudo ln -s /usr/share/fonts/X11 fonts

That seemed to solve one problem, but then I just got the checkerboard background. I downgraded to the older version, but no change. Has anyone solved this problem yet?

I found #199 in this thread, and I don't know what it means but I tried anyway:

$ x-session-manager

and I get the following:

(x-session-manager:4931): Gtk-WARNING **: cannot open display:

I should say that right now I'm trying to get in remotely using an ssh tunnel, but it seems to me that if I can log in and it accepts my password, it's not a networking problem.

Thanks

josesanders
January 23rd, 2007, 08:55 PM
I fixed my own problem. Logged into the server locally and changed the settings:

Login Screen->Remote

Changed to same as local. I know this was here before, and I really thought I already did it, but sorry to post for something so simple.

childs999
January 31st, 2007, 03:15 PM
Feb 1 00:41:40 FS xinetd[5357]: warning: can't get client address: Transport endpoint is not connected

Can someone help me with this error (this is fromv var/log/syslog).
My VNCviewer connections from my windows machine, but then says:
read: Connection reset by peer (10054).

Any suggestions??

Hubris2
January 31st, 2007, 06:59 PM
That sounds like the same message I was getting, that was addressed by downgrading the version of VNC4Server. Have you searched this thread? That is a fairly common error..and it doesn't seem that any single solution always works.

childs999
February 1st, 2007, 07:30 AM
That sounds like the same message I was getting, that was addressed by downgrading the version of VNC4Server. Have you searched this thread? That is a fairly common error..and it doesn't seem that any single solution always works.

I have actually downgraded and still having this problem.

Hubris2
February 5th, 2007, 11:50 PM
My VNC server is generally working as I want...however I occasionally have the putty connection crash while I'm connected to :1 over VNC...which screws up the session. When I try reconnect to :1 I'll get an error about the session being busy and asking if I want to reconnect.

I normally switch back to :0 and kill the session manually but it hasn't worked yet. I just had it happen...I issued 'vnc4server -kill :1'. It was successful, but told me to manually kill the Xvnc process. I did, and I was then able to reconnect to :1 and log in. The screen would not update however....I had a solid color and not my desktop. At this point I reconnected to :0 again but the desktop was 'hung' - I could move the mouse around but couldn't click on anything. Eventually I used the shell from SSH to restart the machine.

How can I properly kill a 'borked' VNC session so it will let me sign back on and start working anew? The 2 times this has happened (over probably 30 days), I've had to resort to a full restart to fix things.

Thanks,

zymorph
February 7th, 2007, 10:54 PM
How can I properly kill a 'borked' VNC session so it will let me sign back on and start working anew? The 2 times this has happened (over probably 30 days), I've had to resort to a full restart to fix things.

Thanks,

Are you running VNC using xinetd for resumable sessions or running it by itself? If you're running it from xinetd, restart that service ("/etc/init.d/xinetd restart") and then issue the command "sudo killall Xvnc" because simply killing off the Xvnc process itself apart from xinetd doesn't work because xinetd kicks up another instance of Xvnc (at least that's been my experience). But if you're running VNC on its own, issue the command "sudo killall Xvnc" and try to start up that process again. Not sure if that helps, but I tried :)

Hubris2
February 7th, 2007, 11:53 PM
I'm running via xinetd as per the guide from this post.

I'm just considering the process here....restarting xinetd will probably halt and restart my SSH via which I'll be attempting the repair. As long as it restarts I'll be able to reconnect and continue.

I don't understand how restarting xinetd.....(so it's running when I kill Xvnc) will work. If I stopped xinetd, killed Xvnc and then restarted xinetd- that would make sense to me.....but if xinetd has been restarted prior to killing Xvnc, would it not create another instance of Xvnc as you stated?


Are you running VNC using xinetd for resumable sessions or running it by itself? If you're running it from xinetd, restart that service ("/etc/init.d/xinetd restart") and then issue the command "sudo killall Xvnc" because simply killing off the Xvnc process itself apart from xinetd doesn't work because xinetd kicks up another instance of Xvnc (at least that's been my experience). But if you're running VNC on its own, issue the command "sudo killall Xvnc" and try to start up that process again. Not sure if that helps, but I tried :)

zymorph
February 8th, 2007, 05:21 PM
Yeah you're right :) , I meant to say "stop" xinetd (not restart), kill your Xvnc sessions, then start xinetd again (which should kick up a Xvnc instance). Whenever I've connected via SSH and restart xinetd, it doesn't drop my SSH connection.


I'm running via xinetd as per the guide from this post.

I'm just considering the process here....restarting xinetd will probably halt and restart my SSH via which I'll be attempting the repair. As long as it restarts I'll be able to reconnect and continue.

I don't understand how restarting xinetd.....(so it's running when I kill Xvnc) will work. If I stopped xinetd, killed Xvnc and then restarted xinetd- that would make sense to me.....but if xinetd has been restarted prior to killing Xvnc, would it not create another instance of Xvnc as you stated?

walix
February 9th, 2007, 06:29 PM
Hi all,

Does anyone have idea while I get this message when trying to connect to the VNC server?

"ReadFromRFBServer: rdr::EndOfStream"

VNC used to work fine till one day when I installed some updates and I can't figure out why.

Thanx a lot

Hubris2
February 9th, 2007, 09:37 PM
Try reverting back to the previous version of the VNC4Server app. I had that problem, and it fixed it for me - I still have a security update for VNC4Server waiting...that I won't install.

bozack
February 16th, 2007, 09:47 PM
Has anyone gotten this working with IPv6?

I can't find any info on whether or not vnc4server supports IPv6 or not.

My attempt at getting it running through xinetd didn't work out, though everything's great on IPv4.

Log files aren't helping.

Thanks in advance!

scarpent
February 17th, 2007, 04:16 AM
This is quite a thread. Thanks to Tichondrius for the writeup and all of the other posters who helped with figuring stuff out.

I think there are some other updated howto's for Edgy out there, but I pretty much used this one to put it all together. I wrote up my own experience in getting this working, which I'm posting here in the hope that it might help others:

HOWTO: Remote Desktop with VNC in Ubuntu Edgy (http://www.movingtofreedom.org/2007/02/16/howto-remote-desktop-with-vnc-in-ubuntu-edgy-gnu-linux/)

SBFC
February 21st, 2007, 04:00 AM
Hello everybody, I'm having an interesting problem. I followed the guide step
by step and actually had everything working. I had connected to my Linbox at home via VNC and was greeted with a gdm login screen.

I logged in and Fluxbox fired up. Could disconnect and it would stay running. However, last time I reconnected I exited fluxbox, thinking it would go back to the login screen. Sadly, that isn't what happened. I was disconnected, and after that was never able to reconnect.

Been messing around with it for quite a while and in /var/log/syslog I was getting the following message:


warning: can't get client address: Transport endpoint is not connected

No idea why it started complaining about that. Through some experimentation I discovered that if I remove the '-once' tag from the server_args line in /etc/xinetd.d/Xvnc file I can connect, but it doesn't load GDM. I just get an empty X server.

I don't know why exiting Fluxbox foobarred everything. Afterwards I even restarted my computer and it still wouldn't work.

I'd also like to point out that I can use vnc4server normally with no problems. I would rather use the process this howto describes though, as it allows people to log into their own sessions rather than using mine (running 'vnc4server' cmd).

Any suggestions would be greatly appreciated.

prescor
February 22nd, 2007, 04:27 PM
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?


Indeed! What does this mean? I've been struggling for two days to get this to work on Edgy. I'm VERY VERY CLOSE, I can SMELL IT! But syslog has all these "can't get client address" messages (above).

???

Pollywoggy
February 23rd, 2007, 02:18 AM
I am using kdm. I would need to use gdm to get this to work?
I don't know if I can install gdm because when I installed it on another Edgy system recently, a bug kept me from logging in and I had to reinstall kdm.

scarpent
February 23rd, 2007, 04:16 PM
I was getting that "endpoint is not connected" message also. I'm not sure what the exact cause of it was since it was one problem among many while getting this to work.

Might it be that xdmcp isn't enabled?

A few comments up I linked to a post where I recapped my own experience getting this running. A lot of it is advice I got in this thread, but I pieced together comments from the whole past year and tried to make it a coherent howto for Edgy. One of the biggest things missing in the original howto that seems necessary in Edgy is to edit gdm.conf.

Pollywoggy
February 23rd, 2007, 06:50 PM
I was getting that "endpoint is not connected" message also. I'm not sure what the exact cause of it was since it was one problem among many while getting this to work.

Might it be that xdmcp isn't enabled?

A few comments up I linked to a post where I recapped my own experience getting this running. A lot of it is advice I got in this thread, but I pieced together comments from the whole past year and tried to make it a coherent howto for Edgy. One of the biggest things missing in the original howto that seems necessary in Edgy is to edit gdm.conf.

I also tried to connect to a machine running Debian Sarge from two machines running kubuntu Edgy and the connection was denied but I am able to telnet to the Sarge machine on port 5901 from the same kubuntu hosts. This means the problem is probably on the Ubuntu machines. I have used VNC with the same machines when all were running Debian and Freespire and the configuration on the Sarge machine is unchanged from then.

walix
February 24th, 2007, 10:46 AM
Try reverting back to the previous version of the VNC4Server app. I had that problem, and it fixed it for me - I still have a security update for VNC4Server waiting...that I won't install.

Thanks Hubris2, your suggestion helped me. VNC works again.
Sorry for the delay, I was not able to try it before.

Tadhg
February 24th, 2007, 04:22 PM
im having a little trouble with this.

I'm trying to tunnel the VNC connection through another machine, so I set up a SSH session:

ssh -L 5901:192.168.0.5:5901 username@host.co -p 993

but when i start vncviewer on 127.0.0.1:5901 i get the following



VNC Viewer Free Edition 4.1.1 for X - built Jan 6 2007 09:49:08
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Sat Feb 24 15:18:13 2007
CConn: connected to host 127.0.0.1 port 5901
main: End of stream


and this in the syslog:



.
.
.

Feb 24 15:42:36 timmypc xinetd[7528]: warning: can't get client address: Transport endpoint is not connected
Feb 24 15:42:36 timmypc xinetd[7528]: warning: can't get client address: Transport endpoint is not connected
Feb 24 15:42:36 timmypc xinetd[7528]: warning: can't get client address: Transport endpoint is not connected
Feb 24 15:42:36 timmypc xinetd[7421]: Deactivating service Xvnc due to excessive incoming connections. Restarting in 10 seconds.


I've downgraded the server and still no luck.Any ideas?

[EDIT], Ok, I've gotten somewhere. While i was unable to even get to the password screen before, I now have an X server booting up. This post i (http://ubuntuforums.org/showpost.php?p=1951958&postcount=202) fixed it for me, the
-fp /usr/share/X11/fonts/misc needs to be changed to -fp /usr/share/fonts/X11/misc in your /etc/xinetd.d/Xvnc. Thanks bhamail!