PDA

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


Pages : 1 2 [3]

jamesrfla
August 5th, 2008, 10:20 AM
I think when you do localhost:1 it uses the same port which is 5900. It kinda seems like it is not posible but when you think about web servers they are sending a whole bunch of info on one port.

Kahran
August 8th, 2008, 03:49 PM
Running Hardy, and followed the instructions in the initial post.

Here is my issue: I am trying to VNC into my Ubuntu box at home from work, which blocks a lot of ports. But that's okay, I setup OpenSSH so that I can tunnel in. SSH tunnel works fine because I used it in some other programs successfully.

VNC server is listening on port 5900 as it should but when I try to connect I get a "server closed unexpectedly" error.

Now... I am setting this all up remotely via SSH. I was never able to test of things worked locally because X11 obviously could not display. So right now I am using PuTTY+xming to open X11 applications. Of course I do not intend to run X this way but I just wanted to see if it could connect. When I try "vncviewer localhost:0" (or if I change the listen port to 5901 like the original instructions in the main post and do localhost:1) it shows me that it connected but I get a "read: Connection reset by peer (104)" error.

Am I missing a step here?

Edit: No firewall or NAT, just a direct connection.

jamesrfla
August 8th, 2008, 03:55 PM
If you want to login to the console of the computer you have to login and then you can remote from your work place.

Kahran
August 8th, 2008, 04:50 PM
If you want to login to the console of the computer you have to login and then you can remote from your work place.

I have been doing that. As I said, I can tunnel no problem. I launch PuTTY on Windows with all my tunnels configured, login and leave that tunnel up. Then I launch VNC viewer and connect, and it does seem to be communicating, just quits and I am not sure why.

Kahran
August 8th, 2008, 05:49 PM
Update: After scouring this thread some more I changed to :02/5902 and things seem to be actually working now.

Jose Catre-Vandis
August 12th, 2008, 07:59 PM
Thanks, this works fine on Hardy 8.04.01 after a fresh install :)

Here are the instructions I use, and they work in v8.04.

VNC Server w/Resumable Sessions on Ubuntu
Works in Ubuntu 7.04, 7.10, 8.04, and Mint 4 (Daryna)


Make these changes while logged into gnome:


Go to System -> Administration -> Login Window (General tab) and uncheck "Disable multiple logins for a single user."
Now go to the Remote tab. Change Style: to "Same as Local"
Still on the Remote tab, click "Configure XDMCP," then uncheck "Honor indirect requests."
Enable Universe repositories in Synaptic. (this wasn't necessary in Ubuntu 8.04)


The remaining changes can be made while SSH'd into the system, or in a terminal window:


Edit /etc/gdm/gdm.conf-custom

sudo nano /etc/gdm/gdm.conf-custom

add the following two lines to the existing [security] and [xdmcp] sections:

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


Install packages:

sudo apt-get install vnc4server xinetd

Set the VNC password

sudo vncpasswd /root/.vncpasswd

Create a new file Xvnc to add the vnc service to xinetd:

sudo nano /etc/xinetd.d/Xvnc
Paste these contents into the 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/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5901
}


Reboot


That's it. I've used these exact instructions on three Ubuntu 8.04 installs without a hitch, as well as 7.04, 7.10, and Mint 4. Good luck.

Thanks, this works fine on Hardy 8.04.01 after a fresh install :)

antm88
August 13th, 2008, 07:07 AM
Two questions:

Is there anyway to make it restart the session automatically on reboot??
and why does nm-applet not load up / how can I make nm-applet load up automatically?

Thanks, Ant

jamesrfla
August 13th, 2008, 12:07 PM
When you are done with the session click the power button on the top right corner of the desktop. Then click log out and that’s all you need to do but if you want it to do it automatically when you shut down that is a good question.

dasmith
August 13th, 2008, 01:29 PM
If you go to System >>> Sessions >>> Select the Session Option tab, Check the box next to Automatically remember running applicatiopn when logging out.

Jose Catre-Vandis
August 13th, 2008, 04:09 PM
For Hardy 8.04.*

VNC Speedfix reported here

http://ubuntuforums.org/showpost.php?p=5252422&postcount=5

also if your theme keeps changing when running a vnc session, on your remote machine, run

gconf-editor

and disable apps > gnome-settings-daemon > plugins > keyboard

then reboot

EDIT

Hardy is still "jaggy" with slow refresh rates compared to previous versions, even with these fixes

berryrag
August 19th, 2008, 07:48 PM
Everytime I try to connection, I get an error connection reset by peer.

Any help please? :)

kamkos
August 23rd, 2008, 12:44 PM
hey,

I have a Xvnc running on Ubuntu server with GNOME as for GUI.

my Xvnc file started with xinetd:

service vnc2
{
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/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5903
}
service vnc1
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc
server_args = -inetd :2 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5902
}
service vnc3
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc
server_args = -inetd :3 -query localhost -geometry 1280x1024 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5904
}

I have also added the following lines to /etc/services

vnc1 5902/tcp
vnc2 5903/tcp
vnc3 5904/tcp

The deal is that I can make two connections to the server but not three at the same time. For example, if vnc1 and vnc2 are on then vnc3 cannot be made with the given error:

read: Connection reset by peer (10054)

Any help will be appreciated.

kamkos

ziogionni
August 24th, 2008, 01:56 PM
Here are the instructions I use, and they work in v8.04.

VNC Server w/Resumable Sessions on Ubuntu
Works in Ubuntu 7.04, 7.10, 8.04, and Mint 4 (Daryna)


Hello.

I am trying to remote control an Ubuntu Desktop 8.04LTS installation.
The "standard" remote desktop that you can configure into gnome did work fine, but everytime you reboot you have to login manually, and even if you setup automatic login the X server on :0 won't start with no monitors turned on and connected into the VGA port. Basically X server won't start on an headless computer.

So I have followed this guide to run resumable sessions over :1

But I have some problems, basically the "desktop theme" (i don't know how else call the style of the windows, scroll bars, etc, hope you understood, English is not my first language) keeps changing every seconds o_O' ... and I am getting a bunch of error.

It seems like some widgets (network one?) are not authorized to run on :1 or something like that. I don't even know how to remove it from the bar now that I haven't got the monitor plugged in.

This is a sample of errors I get in .xsession-errors
** (nm-applet:5447): WARNING **: <WARN> nma_dbus_init(): could not acquire its service. dbus_bus_acquire_service() says: 'Connection ":1.24" is not allowed to own the service "org.freedesktop.NetworkManagerInfo" due to security policies in the configuration file'


** (gnome-session:5322): WARNING **: Failed to authenticate with GDM
Avviso del window manager: CurrentTime used to choose focus window; focus window may not be correct.
Avviso del window manager: Got a request to focus the no_focus_window with a timestamp of 0. This shouldn't happen!
seahorse nautilus module shutdown
The program 'gnome-settings-daemon' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 3152 error_code 3 request_code 20 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
** Message: Got disconnected from the session message bus; retrying to reconnect every 10 seconds
DBus connection has been lost, trackerd will now shutdown


I am very frustrated. There has to be a simple way to control an Ubuntu 8.04 LTS desktop headless installation without having to keep the VGA port connected to a monitor, or having themes changing every seconds with gnome slowing down and so on the :1 display ...

FJA
August 26th, 2008, 04:36 PM
... There has to be a simple way to control an Ubuntu 8.04 LTS desktop headless installation without having to keep the VGA port connected to a monitor, or having themes changing every seconds with gnome slowing down and so on the :1 display ...

I have sam problem - that is settings changes. Seems to be triggered when I launch a program after logon, and continues til at get a settings-server error. Tried cure mentioned in post below - but with no result. http://ubuntu-virginia.ubuntuforums.org/showpost.php?p=5582731&postcount=510

ALSO: I can't do certain changes using Xvnc - like adding new user. There is not prompt for SUDOer password... Why is that ??

mediajunkie
August 26th, 2008, 07:25 PM
VNC on hardy has been a real pain in the neck for me.

my laptop (hardy) can perfectly do vnc to any realvnc winxp machine,
also tsclient to xppro works, but can't get vnc (also not vinagre) to work to another Ubuntu hardy machine.

I get either connection closed or with vnc Connection reset by peer (104)


Note ssh works perfect.


grrrrr at the end of my knowledge here.
Any help appreciated

jon.breakdesign
August 27th, 2008, 07:38 PM
Hi Guys

Finally got vnc working nicely in hardy.

I also had the theme change errors.

When i looked in ~/.xsession-errors i see....

** (nm-applet:15671): WARNING **: <WARN> nma_dbus_init(): could not acquire its service. dbus_bus_acquire_service() says: 'Connection ":1.314" is not allowed to own the service "org.freedesktop.NetworkManagerInfo" due to security policies in the configuration file'


Now I'm not sure if I'm talking rubbish here but authorizations [system->administration->auhorizations] generally isn't set up to allow certain stuff to happen when you are not logged in on a local terminal....which you don't have when you are logged in via Xvnc....its remote...so..

anyway to cut a long story short I messed around in the authorizations tab [system->administration->auhorizations] (you are going to need to do this for stuff like HAL too otherwise you won't be able to mount usb drives in gnome over vnc) and also under the gnome tab in there..you should change the settings to change system settings to allow anyone with admin authentication if you want the policykit unlock boxes not to be grayed out over vnc

and then i also installed the .debs for vnc4server from this url as mentioned on the previous page..

http://www.francescosantini.com/index.php?page=linux&lang=en


and that was it..everything worked from there....so for me changing authorization policies and installing those debs sorted out performance and also that theme and usb mount problems...


Notes: My /etc/xinetd.d/Xvnc file has the following lines to it:

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/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5901
}

@mediajunkie I know this is a really n00b silly question but on hardy you are allowing the port your vnc service is to run on through your firewall?

oh lastly if you don't feel like plugging the monitor back in and logging in on the local console again, and want to change a bunch of stuff under authorizations that you are not authorized to change under your account on a non local terminal (even if you are an admin) then very briefly enable the root account log in as root over vnc change what you have to and disable the account again.

mediajunkie
August 28th, 2008, 12:34 AM
Yep, even turned off firewall. // it does work from laptop to xp machines, running realvnc.

jocko_johnson
August 30th, 2008, 02:29 AM
[QUOTE=Jose Catre-Vandis;5577387]Thanks, this works fine on Hardy 8.04.01 after a fresh install :)


I'm wondering is there a way that I can resume my current "at home" session when I connect remotely? i.e, when I VNC to home from work, can I see the session I have open at home?

I find it annoying to have to login via the main ubuntu login screen and then I have a blank desktop - while at home my screen shows the apps I have running.

does it have anything to do with the "-NeverShared" part in "service Xvnc"??
if so, what is the option to allow me to resume my current "home" session?

Thanks

Jose Catre-Vandis
August 30th, 2008, 05:30 PM
[QUOTE=Jose Catre-Vandis;5577387]Thanks, this works fine on Hardy 8.04.01 after a fresh install :)


I'm wondering is there a way that I can resume my current "at home" session when I connect remotely? i.e, when I VNC to home from work, can I see the session I have open at home?

I find it annoying to have to login via the main ubuntu login screen and then I have a blank desktop - while at home my screen shows the apps I have running.

does it have anything to do with the "-NeverShared" part in "service Xvnc"??
if so, what is the option to allow me to resume my current "home" session?

Thanks

My experience is that you should be able to do this. If I leave my session logged in at home and then access via vnc at work I get the same session either via vnc (Linux) or putty (Windows). I can also login at work and then vnc from home to the same desktop.

jocko_johnson
August 30th, 2008, 05:55 PM
[QUOTE=jocko_johnson;5692329]

My experience is that you should be able to do this. If I leave my session logged in at home and then access via vnc at work I get the same session either via vnc (Linux) or putty (Windows). I can also login at work and then vnc from home to the same desktop.

any idea how I alter my settings to allow this?
every time I "PuTTY" from my work windows machine, or my wifes laptop I get a ubuntu signin screen and then a totally new session which I dont want.

when I login using Vino server I resume the session, but I prefer xvnc server because of the existence of more options ( better password options - vino is 8 char max, I can tell xvnc to only allow connections from my user, etc... )

unless Vino offers these options too? the GUI for vino offers very little in terms of options.

anyway, for Jose Catre-Vandis, your post detailing the instructions to get xvnc server running were great. thank you for that very much.

thenuge26
September 1st, 2008, 04:57 PM
i am trying to set up ubuntu as a headless server, and i am having trouble accessing it remotely via vnc. i remember before i ran through the setup, vnc would work through vino, however, without a monitor plugged in, i could not change the resolution. anyways, i ran though the guide here, and when i try to access the server from my windows box, i get this error.

connection failed - error reading protocol version

possible causes:

- you've forgotten to select a DSMPlugin and the server uses a DSMPlugin
- Viewer and server are not compatible (they use different RFB protocoles)
- bad connection

if it is indeed that my viewer (ultraVNC) is not compatible, do you guys know of a windows viewer that is compatible?

thanks in advance for any help

sefs
September 2nd, 2008, 12:51 PM
How do you enable the loopback for vnc4server? It's needed when connecting over ssh.

Thanks.

sefs
September 3rd, 2008, 12:34 AM
Hi,

following some advice earlier to test this thing I am getting this error


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


Wed Sep 3 00:24:12 2008
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/misc, removing from list!

Fatal server error:
could not open default font 'fixed'
pokeymon@pokeymon:~$



This is the command I run


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


I am also getting lots of those errors in syslog

Sep 3 00:02:23 pokeymon xinetd[12445]: warning: can't get client address: Transport endpoint is not connected
Sep 3 00:02:23 pokeymon xinetd[12446]: warning: can't get client address: Transport endpoint is not connected
Sep 3 00:02:23 pokeymon xinetd[12447]: warning: can't get client address: Transport endpoint is not connected
Sep 3 00:02:23 pokeymon xinetd[12448]: warning: can't get client address: Transport endpoint is not connected
Sep 3 00:02:23 pokeymon xinetd[12449]: warning: can't get client address: Transport endpoint is not connected


How can i solve this.


Edit:

following this link http://www.movingtofreedom.org/2007/02/16/howto-remote-desktop-with-vnc-in-ubuntu-edgy-gnu-linux/

in /etc/xinetd.d/Xvnc

I changed this line...


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


to this


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


NB: the -extension XFIXES at the end... i could not get it to work without that.
As well as the font path...there is a subtle change there as well.

popie
September 3rd, 2008, 01:03 AM
Your fonts path is incorrect. See post #458 in this thread for updated setup instructions.

The font path should be: /usr/share/fonts/X11/misc

kacheng
September 4th, 2008, 09:11 AM
@jon.breakdesign

Thanks for your post. I had the same error messages. I tried a series of policy changes, but could not get it working.

However, I found this easy solution:
sudo adduser USER netdev
sudo /etc/init.d/dbus restart
http://www.mail-archive.com/debian-bugs-closed@lists.debian.org/msg102963.html

Which I think essentially has the same effect (setting the user's policies correctly).

Thanks

Hi Guys

Finally got vnc working nicely in hardy.

I also had the theme change errors.

When i looked in ~/.xsession-errors i see....

** (nm-applet:15671): WARNING **: <WARN> nma_dbus_init(): could not acquire its service. dbus_bus_acquire_service() says: 'Connection ":1.314" is not allowed to own the service "org.freedesktop.NetworkManagerInfo" due to security policies in the configuration file'


Now I'm not sure if I'm talking rubbish here but authorizations [system->administration->auhorizations] generally isn't set up to allow certain stuff to happen when you are not logged in on a local terminal....which you don't have when you are logged in via Xvnc....its remote...so..

anyway to cut a long story short I messed around in the authorizations tab [system->administration->auhorizations] (you are going to need to do this for stuff like HAL too otherwise you won't be able to mount usb drives in gnome over vnc) and also under the gnome tab in there..you should change the settings to change system settings to allow anyone with admin authentication if you want the policykit unlock boxes not to be grayed out over vnc

and then i also installed the .debs for vnc4server from this url as mentioned on the previous page..

http://www.francescosantini.com/index.php?page=linux&lang=en


and that was it..everything worked from there....so for me changing authorization policies and installing those debs sorted out performance and also that theme and usb mount problems...


Notes: My /etc/xinetd.d/Xvnc file has the following lines to it:

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/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5901
}

@mediajunkie I know this is a really n00b silly question but on hardy you are allowing the port your vnc service is to run on through your firewall?

oh lastly if you don't feel like plugging the monitor back in and logging in on the local console again, and want to change a bunch of stuff under authorizations that you are not authorized to change under your account on a non local terminal (even if you are an admin) then very briefly enable the root account log in as root over vnc change what you have to and disable the account again.

DasNiche
September 6th, 2008, 04:23 AM
I am getting the common problem, when I enter

vncviewer localhost:1

I get the output:

"VNC Viewer Free Edition 4.1.1 for X - built Apr 16 2008 13:02:40
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Sat Sep 6 03:18:07 2008
CConn: connected to host localhost port 5901
main: read: Connection reset by peer (104)"

And get a pop up error message saying "read: Connection reset by peer (104)".

I followed the instructions exactly and I'm getting really frustrated because I can't figured this out. Also I am running 8.04 Hardy Heron if that helps. Any help is GREATLY appreciated, thanks!

Dethecus
September 9th, 2008, 08:45 AM
Same problem as above, have followed this guide to the letter and the box is just refusing connections. I can VNC to it just fine when it's logged in but not to GDM :(

I've tried several different things from around the net with no success, I also noticed that when you enable XDMCP through the menu's it is still set as "enabled = false" in /etc/gdm/gdm.conf

Any help would be greatly appreciated, this is basically a fresh install and it's the last thing I need to get working!

popie
September 9th, 2008, 01:43 PM
@Dethecus, If you followed the first post in this thread, it won't work. Many things have changed since this thread began.

I listed the entire process, step by step, that works for me (every time) in the following post in this thread:

http://ubuntuforums.org/showpost.php?p=5229232&postcount=458

Dethecus
September 10th, 2008, 03:00 AM
@Dethecus, If you followed the first post in this thread, it won't work. Many things have changed since this thread began.

I listed the entire process, step by step, that works for me (every time) in the following post in this thread:

http://ubuntuforums.org/showpost.php?p=5229232&postcount=458

Well I just tried those steps of yours exactly on both my Ubuntu computers and it didn't work on either =\

Still getting connection refused.

jiji2k
September 10th, 2008, 06:07 AM
@popie - thank you so much for the tutorial, it works like a charm!

however is there a way to have concurrent VNC connections? like multiple connections with the same username so people share the desktop without having to log off, right now when i try to login again with the same username it says "VNC authentication faild!"
thank you!

Hobgoblin
September 18th, 2008, 09:10 AM
Your fonts path is incorrect. See post #458 in this thread for updated setup instructions.


Worked for me. :KS

BTW, to save people some clicks, the post is here (http://ubuntuforums.org/showpost.php?p=5229232&postcount=458).

DasNiche
September 19th, 2008, 11:16 PM
The localhost:1 works now poppi! As for the remote desktop VNC... all goes well for a split second and then the windows begin to pop up infinitely. Here's a screenshot to explain.

http://img443.imageshack.us/my.php?image=vncerrorcq8.jpg
http://img443.imageshack.us/my.php?image=vncerrorcq8.jpg

What the heck is going on!?
Any help is MUCH appreciated, thanks!

nexxteh
October 4th, 2008, 04:44 AM
I listed the entire process, step by step, that works for me (every time) in the following post in this thread:

http://ubuntuforums.org/showpost.php?p=5229232&postcount=458

First of all Dethecus, thank you for this!

I do have problems though. If I do vncviewer localhost:1 I dont get a GDM login window, just a blank screen with some checkboxes.

EDIT: FIXED. Followed the instructions here (http://ubuntuforums.org/showpost.php?p=4497342&postcount=403).

killdeer
October 6th, 2008, 05:49 PM
When I do the last command in part 2 of the tutorial "vncviewer localhost:1" I didnt have vncviewer. So I managed to figure that out and got it. After that when I type in the command I get...


VNC Viewer Free Edition 4.1.1 for X - built Apr 16 2008 13:02:40
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Mon Oct 6 17:48:14 2008
CConn: connected to host localhost port 5901
main: read: Connection reset by peer (104)

conorgriffin
October 12th, 2008, 07:16 PM
Hi guys, I'm getting the same issue, I followed the newer guide in post 458 (http://ubuntuforums.org/showpost.php?p=5229232&postcount=458) but I'm still getting this

VNC Viewer Free Edition 4.1.1 for X - built Apr 16 2008 13:02:40
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Mon Oct 13 00:11:29 2008
CConn: connected to host localhost port 5901

Mon Oct 13 00:11:43 2008
main: read: Connection reset by peer (104)
conor@linux:~$



Then when I look in the syslog for messages I see the following

Oct 13 00:51:00 linux xinetd[9156]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9157]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9158]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9159]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9160]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9161]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9162]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9163]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9164]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[9170]: warning: can't get client address: Transport endpoint is not connected
Oct 13 00:51:00 linux xinetd[6687]: Deactivating service Xvnc due to excessive incoming connections. Restarting in 10 seconds.
Oct 13 00:51:10 linux xinetd[6687]: Activating service Xvnc
Oct 13 00:55:39 linux xinetd[6687]: Exiting...


:confused:

alenis
October 14th, 2008, 02:49 PM
I followed popie's instructions and it seems to work, However, when I try to connect from my laptop I get this error message from VNC viewer: "Error: couldn't find suitable pixmap format". How can I solve the problem?

kr3w
October 15th, 2008, 12:30 AM
I followed popie's instructions, everything went well until i rebooted and nothing had changed. I still can't vnc unless i log in the physical desktop, and then it only controls the physical desktop... Am I connecting wrong?

johanang
October 15th, 2008, 08:48 PM
I really hate this side of Ubuntu.. So far i am unsuccessful at installing a vnc server.. This definitely needs to be address by the ubuntu admins in their documentation.

kr3w
October 15th, 2008, 11:22 PM
I really hate this side of Ubuntu.. So far i am unsuccessful at installing a vnc server.. This definitely needs to be address by the ubuntu admins in their documentation.

As far as getting the VNC server running, that is as simple as clicking in GNOME System>Preferences>Remote Desktop, then clicking Allow users to view your desktop, and Allow users to control your desktop under General Tab subsection Sharing.

Getting VNC to work independently of sessions on the physical display, is another issue, apparently.

havok1977
November 11th, 2008, 06:16 AM
Hello everyone, i am trying to get my laptop to run the vnc4server on Kubuntu 8.10; which as you may know uses KDE 4.1.3.

I followed the instructions exactly as described on post #458 of this thread and Im having the same type of problem as many other people have posted in this thread and in other forums:


diego@raziel:~$ vncviewer localhost:1
Connected to RFB server, using protocol version 3.8
vncviewer: read: Connection reset by peer


To which my /var/log/syslog says:


Nov 11 21:09:35 raziel xinetd[15191]: warning: can't get client address: Transport endpoint is not connected


I made the following configurations in /etc/kde4/kdm/kdmrc:


[Xdmcp]
Enable=true
Port=177
Xaccess=/etc/kde4/kdm/Xaccess
Willing=/etc/kde4/kdm/Xwilling


Is there anything new that i should take into account for 8.10? Did the vnc4server get any significant changes between last release and now?

Thanks in advance.


Edit: Fixed the problem, had to edit /etc/kde4/kdm/Xaccess like this:


* #any host can get a login window
* CHOOSER BROADCAST #any indirect host can get a chooser


Now it works great! Thanks to the howto posters....

Eviltechie
November 11th, 2008, 09:08 PM
I'm using Ubuntu 8.10 and I get...
ivan@ivan-ubuntu:~$ vncviewer localhost:1

VNC Viewer Free Edition 4.1.1 for X - built Apr 16 2008 13:02:40
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Tue Nov 11 20:07:28 2008
CConn: connected to host localhost port 5901
main: read: Connection reset by peer (104)
I followed the directions in 458, but it didn't work.

v_dragon
December 2nd, 2008, 09:57 PM
I'm using Ubuntu 8.10 and I get...
ivan@ivan-ubuntu:~$ vncviewer localhost:1

VNC Viewer Free Edition 4.1.1 for X - built Apr 16 2008 13:02:40
Copyright (C) 2002-2005 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.

Tue Nov 11 20:07:28 2008
CConn: connected to host localhost port 5901
main: read: Connection reset by peer (104)
I followed the directions in 458, but it didn't work.

I also am having the same issue - been web searching for days, no luck!!!
its really disappointing to have such issues with my Linux boxes - i kinda wish i had not made the switch from windows. I can get VNC to work to my CentOS5 machine either!

karlson
December 4th, 2008, 05:25 PM
Hi,

I have set up the sessions in Hardy Heron (8.04.1). I have a problem with getting a login screen.

I am able to connect and launch Xvnc through xinetd but I cannot get the login prompt the gdmlogin to launch. When I try to launch X with -query localhost I am able to come up with the login prompt no problem, but Xvnc seem to have an issue.

Has anyone seen the issue? Or resolve one like this or similar?

chiefchief
December 4th, 2008, 05:31 PM
I found a guide that enables VNC in 8.10, now it's a little more integrated. You can find it here (http://www.ubuntugeek.com/how-to-use-remote-desktop-in-ubuntu-810-intrepid-ibex.html).

It'd be nice if Ubuntu could get VNCing down as nice as OpenSuse does.

chelrob
December 4th, 2008, 11:46 PM
^^^^ Does that give you resumable sessions or does it just give you desktop control?

veiloctane
December 8th, 2008, 11:27 AM
Here are the instructions I use, and they work in v8.04.

VNC Server w/Resumable Sessions on Ubuntu
Works in Ubuntu 7.04, 7.10, 8.04, and Mint 4 (Daryna)


Make these changes while logged into gnome:


Go to System -> Administration -> Login Window (General tab) and uncheck "Disable multiple logins for a single user."
Now go to the Remote tab. Change Style: to "Same as Local"
Still on the Remote tab, click "Configure XDMCP," then uncheck "Honor indirect requests."
Enable Universe repositories in Synaptic. (this wasn't necessary in Ubuntu 8.04)


The remaining changes can be made while SSH'd into the system, or in a terminal window:


Edit /etc/gdm/gdm.conf-custom

sudo nano /etc/gdm/gdm.conf-custom

add the following two lines to the existing [security] and [xdmcp] sections:

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


Install packages:

sudo apt-get install vnc4server xinetd

Set the VNC password

sudo vncpasswd /root/.vncpasswd

Create a new file Xvnc to add the vnc service to xinetd:

sudo nano /etc/xinetd.d/Xvnc
Paste these contents into the 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/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5901
}


Reboot


That's it. I've used these exact instructions on three Ubuntu 8.04 installs without a hitch, as well as 7.04, 7.10, and Mint 4. Good luck.



thankyou so much this worked for me with ubuntu studio 8.10

RomanIvanov
December 12th, 2008, 07:36 PM
Does anybody succeed in connecting to vncserver with resolution "-geometry 1280x800 " ?

Is there any way to connect to current session(with all applications running) instead of new session?

chelrob
December 12th, 2008, 11:38 PM
The answer to your second question is yes... don't log out of the current session. Close VNC without logging out. When you reconnect the session will still be open, hence resumable sessions.

cphan
December 13th, 2008, 07:50 PM
Thanks, This updated code fixed my 104 error, I believe it was due to a bad font path.

Fixed in Xbuntu 8.04


* Create a new file Xvnc to add the vnc service to xinetd:

Code:


sudo nano /etc/xinetd.d/Xvnc


Paste these contents into the 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/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5901
}

popie
December 13th, 2008, 08:52 PM
Thanks, This updated code fixed my 104 error, I believe it was due to a bad font path.



Yup, the font path in the original post worked when it was posted, but the font path changed at some specific version of Ubuntu (forgot which one). Its easy to overlook.

Also, XFIXES wasn't in the original post, and wasn't previously required. But somewhere along the way, things broke, and it became necessary as a workaround.

RomanIvanov
December 14th, 2008, 08:14 AM
Hi ,chelrob, thanks for answer, but I am interesting in the following case:

I have Desktop and Laptop, and need to connect from Laptop to Desktop:
1. Turn On Laptop and Desktop
2. Run In Desktop few UI applications (firefox, thunderbird)
3. Run VNCViewer on Laptop and connect to Desktop

Now, we have a warning that session exists, and can only connect to new session of the same user on the Desktop. Yes, for this new session - the session is resumable.

Is there way to connect to the session that I run on Desktop with few application that already exists (point 2)?

RomanIvanov
December 14th, 2008, 08:19 AM
Also problem with 1280x800 resolution was resolved after restart. Now it works.

bushwakko
December 14th, 2008, 01:09 PM
font path needs to be : /usr/share/fonts/X11/misc in newer versions of X, that is why a lot of people cannot connect.

RomanIvanov
December 15th, 2008, 04:52 PM
Good point to use x11vnc instead: http://ubuntuforums.org/showthread.php?t=1002240

To be brief:
On server:

sudo apt-get install x11vnc

/usr/bin/x11vnc -display :0 -24to32 -usepw -forever -ncache 10

you can add "-allow [YOUR_IP]" to make it a bit secure.

On client:
vncviewer 192.168.0.100:0
to scroll - use right and left button click on scroller

cu_
December 21st, 2008, 11:53 PM
Having issues after upgrade to Intrepid. This tutorial is great and I really was using the display:1 thru my nokia 770 for a long time. The mistake I did is to upgrade to Intrepid and now my vnc session shows a blank X-Window. Screen shot attached.
I did google all kinds of stuff and tried reinstalling vnc4server, xinetd etc., Could it be some issue with XDMCP on Intrepid?

cu_
December 22nd, 2008, 12:10 AM
Having issues after upgrade to Intrepid. This tutorial is great and I really was using the display:1 thru my nokia 770 for a long time. The mistake I did is to upgrade to Intrepid and now my vnc session shows a blank X-Window. Screen shot attached.
I did google all kinds of stuff and tried reinstalling vnc4server, xinetd etc., Could it be some issue with XDMCP on Intrepid?

Just wanted to add, that I get the same results even when I run Xvnc from commandline for display :2 i.e. even this window does not show the XDMCP login dialog, but a basic X-Window.

Xvnc :2 -query localhost -geometry 800x480 -depth 16 -once -fp /usr/share/fonts/X11/misc -rfbauth /root/.vncpasswd

cu_
December 22nd, 2008, 12:26 PM
Just wanted to add, that I get the same results even when I run Xvnc from commandline for display :2 i.e. even this window does not show the XDMCP login dialog, but a basic X-Window.

Xvnc :2 -query localhost -geometry 800x480 -depth 16 -once -fp /usr/share/fonts/X11/misc -rfbauth /root/.vncpasswd

To give the gurus more information:
When I try to see if there is anything on port 177 or port 6000, nothing is listening. Could it be a gdm issue?

cu_
December 22nd, 2008, 08:14 PM
Here is my syslog:

Dec 22 17:06:18 server gdm[5366]: DEBUG: gdm_xdmcp_host_allow: client->hostname is 127.0.0.1
Dec 22 17:06:18 server gdm[5366]: DEBUG: Attempting to parse key string: debug/Enable=false
Dec 22 17:06:18 server gdm[5366]: DEBUG: gdm_xdmcp-handle_manage: Got display=1, SessionID=1181938353 Class=MIT-unspecified from MIT-unspecified1
Dec 22 17:06:18 server gdm[5366]: DEBUG: gdm_xdmcp_handle_manage: Failed to look up session id 1181938353
Dec 22 17:06:18 server gdm[5366]: DEBUG: XDMCP: Sending REFUSE to 1181938353
Dec 22 17:06:18 server gdm[5366]: DEBUG: gdm_forward_query_lookup: Host ::ffff:127.0.0.1 not found
Dec 22 17:06:18 server gdm[5366]: DEBUG: decode_packet: GIOCondition 1
Dec 22 17:06:18 server gdm[5366]: DEBUG: XDMCP: Received opcode QUERY from client ::ffff:127.0.1.1 : 60899
Dec 22 17:06:18 server gdm[5366]: DEBUG: gdm_xdmcp_host_allow: client->hostname is 127.0.1.1
Dec 22 17:06:18 server gdm[5366]: DEBUG: XDMCP: Sending WILLING to ::ffff:127.0.1.1

amp88
December 31st, 2008, 09:23 PM
Thanks, this works fine on Hardy 8.04.01 after a fresh install :)

...

Thanks, this works fine on Hardy 8.04.01 after a fresh install :)

Thank you so much. This works perfectly and is very well laid out for a Linux newb, like myself :)

I have a questions though. Is there an easy way to restrict IPs who can connect to this server? I want to run a VNC server on my file server but I only want IPs from within my network to be able to connect to it. That way I can do away with the password.

amp88
January 1st, 2009, 04:55 PM
Thank you so much. This works perfectly and is very well laid out for a Linux newb, like myself :)

I have a questions though. Is there an easy way to restrict IPs who can connect to this server? I want to run a VNC server on my file server but I only want IPs from within my network to be able to connect to it. That way I can do away with the password.

I found out about the firewall "gufw", so I've now been able to use that to enforce the IP to connect to the server.

shizow
January 9th, 2009, 08:25 AM
I have the same problem like cu_.
I updated to Intrepid, and since that i only get a grey screen when i try to login.
I am using KDE, so this doesnt seem to be a Gnome problem.

cu_
January 9th, 2009, 12:09 PM
I have the same problem like cu_.
I updated to Intrepid, and since that i only get a grey screen when i try to login.
I am using KDE, so this doesnt seem to be a Gnome problem.

Hi,
My problem got resolved. I did two things at the same time, upgrade of ubuntu and replacing my router. The problem turned out to be with the new router. Here is my guess at why... for the vnc to query for an existing xdmcp, it uses port 177. For some reason, the new router took it upon itself to block it.
I found this accidentally... when I removed the nextwork cable and tried the vnc session, it showed the login screen instead of the the grey. That is when I realized it is the router.
Please try "vncviewer localhost:1" with your network cable removed... to see if your problem is due to the same reason.

Hope this helps
cu_

ottotk
January 9th, 2009, 03:57 PM
Hi,
My problem got resolved. I did two things at the same time, upgrade of ubuntu and replacing my router. The problem turned out to be with the new router. Here is my guess at why... for the vnc to query for an existing xdmcp, it uses port 177. For some reason, the new router took it upon itself to block it.
I found this accidentally... when I removed the nextwork cable and tried the vnc session, it showed the login screen instead of the the grey. That is when I realized it is the router.
Please try "vncviewer localhost:1" with your network cable removed... to see if your problem is due to the same reason.

Hope this helps
cu_

Hi!
I think is has something to do with ipv6 (My network is ipv4)

On file /etc/modprobe.d/aliases find the line containing

alias net-pf-10 ipv6

and replace „ipv6“ with „off“. After reboot everything should work!

cherry316316
January 19th, 2009, 04:45 AM
i got this link 1st and i followed the commands with ssh option
and everything worked fine.

On my remote machine, i have a primary user (which using sudo su becomes the root of the computer) and I am ordinary/desktop user.

when I followed your post,
and tried to connect vncviewer to my desktop user,

i got something like

CConn: connected to host localhost port 5901
main: End of stream


in the end, i decided to uninstall xinetd
and then as a desktop user, i run the command
vncserver :1 -extension XFIXES

and then every thing start working fine.

do u , or any one know what went wrong ?

dmizer
January 19th, 2009, 07:50 AM
do u , or any one know what went wrong ?

The howto was last updated on February 21st, 2006. Ubuntu has gone through several generations since then. It's a little like trying to make a Windows 95 howto work in XP. :)

shizow
March 2nd, 2009, 10:03 AM
I have the same problem like cu_.
I updated to Intrepid, and since that i only get a grey screen when i try to login.
I am using KDE, so this doesnt seem to be a Gnome problem.

I am still having the problem!
After i enter the password i get a grey screen
i tried to connect from the server machine itself with vncviewer localhost:1, but there i get the same grey screen.
Is it possible that vnc is not starting kdm?

please anyone can help me?

Cerin
March 2nd, 2009, 10:41 AM
It's a bit dated, but I've had some success following this howto:

http://www.movingtofreedom.org/2007/02/16/howto-remote-desktop-with-vnc-in-ubuntu-edgy-gnu-linux/

With this, I was ablet to VNC into my machine, and be prompted by the standard Gnome login screen, which then started a new session.

It's really surprising that this setup isn't a bit more standardized. Separate resumable sessions are standard functionality in the windows world, but few distros directly support this.

cherry316316
March 4th, 2009, 11:32 PM
I am still having the problem!
After i enter the password i get a grey screen
i tried to connect from the server machine itself with vncviewer localhost:1, but there i get the same grey screen.
Is it possible that vnc is not starting kdm?

please anyone can help me?

this may be of some help to you.
it worked for me

http://www.techotopia.com/index.php/Remote_Access_to_the_Ubuntu_Linux_Desktop

shizow
March 10th, 2009, 10:37 AM
this may be of some help to you.
it worked for me

http://www.techotopia.com/index.php/Remote_Access_to_the_Ubuntu_Linux_Desktop

is this surely a How-To for a RESUMABLE session?

shizow
March 10th, 2009, 11:31 AM
I am still having the problem!
After i enter the password i get a grey screen
i tried to connect from the server machine itself with vncviewer localhost:1, but there i get the same grey screen.
Is it possible that vnc is not starting kdm?

please anyone can help me?

I solved with this How-To for KDE http://kubuntuforums.net/forums/index.php?topic=12376.0

The problem was i just updated from Kde3 to Kde4, so i had to edit /etc/kde4/kdm/kdmrc and /etc/kde4/kdm/Xaccess.

Crixi
March 15th, 2009, 03:47 PM
i have followed all the information in this thread.
i login into my server (hosting the vnc server and ssh server)

runnung Ubuntu 8.10 on both systems.

if i hav the followin setup in the Xvnc file.
service Xvnc
{ type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = no
user = root
only_from = localhost
server = /usr/bin/Xvnc
server_args = -inetd :1 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5950
}

when i login using first
user@clieent> ssh IP -L 5900:localhost:5950
then
user@client> vinagre localhost
i get the password prompt. then the ligin screen. i can log in to a user and start apps like utorrent and so on.

Now to the problem! I cant figure out how to close vnc and still have the session going on the server, so i can reconnect to it later on.

do i have to do something to get this functionality?

another problem.. i cant login via vnc if i have "wait = yes". any ideas ?

dmizer
March 15th, 2009, 10:41 PM
The information in this howto is old and extremely out of date. It's extremely easy to get remote desktop working now: http://www.ubuntugeek.com/share-your-ubuntu-desktop-using-remote-desktop.html

AncientPC
March 31st, 2009, 02:37 AM
I'm trying this set up on an 8.04.2 machine.

I followed the directions in the original post but it only got me so far before Xvnc crashed looking for the fixed font. One problem was that the font path was pointing in the wrong direction.

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

However there was a second problem:
Fatal server error:
could not open default font 'fixed'

To solve this problem I ran:
cd /usr/share/fonts/X11/misc/
sudo ln -s ../100dpi
sudo ln -s ../75dpi
sudo ln -s ../Type1
sudo ln -s ../util

Then I ran into this problem that I can't solve:
root@Punk:/usr/share/fonts/X11/misc# Xvnc :2 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc/ -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpaswd -IdleTimeout 900

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


Tue Mar 31 01:36:14 2009
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5902
vncext: created VNC server for screen 0
FreeFontPath: FPE "/usr/share/fonts/X11/misc/" refcount is 2, should be 1; fixing.
root@Punk:/usr/share/fonts/X11/misc#

NefariousPrior
April 2nd, 2009, 07:14 AM
This should be called "HOWTO: Set up VNC server with 1 resumable session" as in the single vnc session it allows.


Do you know of any way to allow multiple resumable sessions the way that windows terminal service does on a single port?

Eviltechie
April 2nd, 2009, 03:39 PM
XRDP sort of works like that, it is terminal services over RDP. Unfortunately, the package is broken.

Wolfpup
April 22nd, 2009, 11:50 PM
The information in this howto is old and extremely out of date. It's extremely easy to get remote desktop working now: http://www.ubuntugeek.com/share-your-ubuntu-desktop-using-remote-desktop.html

i have been trying eveything in this thread and i even checked out the link to the "new" way to do it but none of talks about how to set your router and i have a a new linksys wrt54g2 router and when i start the vnc viewer on my winxp system i get an error the erro reads connection reset by perr(10054) do you wish to attempt to reconnect to <ubuntu ip> when i click yes i get unable to connect also when i try to connect in the treminal on the ubuntu system get bacily the same error and in the syslog i see the spam about the connection error and reseting if any of you can help me it would be welcomed also the system is only going to be acessable by local network only and would rather use the remote desktop feature of my winxp systems as i have to use that for loging in ay my work.

theDaveTheRave
May 7th, 2009, 06:46 AM
Hi all.

VNC on the terminal I am attempting to remote log in to simply refuses to play ball!

I have followed the instructions for installation and set up in the OP's original post.

when I try to log onto the ubuntu box from the windows machine I get a

failed to connect to server (ip.address)

I can ssh into the box, which is how I'm doing all the set up. but now I want to be able to log into a graphical desktop also (or rather my colleagues do - I'm happy with command line!).

I have a suspicion it may be to do with the location of the fonts?

I'll change the /etc/inetd.d/Xvnc file and... back in a moment

David

yes that did the trick... I also need to ensure I am logged into the correct display!

theDaveTheRave
May 7th, 2009, 10:30 AM
Hello again.

This has now broken again after a reboot!

I'm trying to run tightvnc (rather than just "normal" vnc. looking at the tightvnc web site I get the impression that the protocols are the same / very similar?

any ideas or advice would be greatfully received.

Thanks in advance

David

cherry316316
May 7th, 2009, 01:59 PM
Hello again.

This has now broken again after a reboot!

I'm trying to run tightvnc (rather than just "normal" vnc. looking at the tightvnc web site I get the impression that the protocols are the same / very similar?

any ideas or advice would be greatfully received.

Thanks in advance

David

this may be of some help
http://www.techotopia.com/index.php/Remote_Access_to_the_Ubuntu_Linux_Desktop

theDaveTheRave
May 9th, 2009, 05:41 PM
Cherry316316

Thanks for the link, reading that sounds like it should solve my problem, but it will be a couple of weeks before I can test it out properly... Although I will set this up on my personal system so as I don't need to take my laptop to work with me all the time!

However, it hasn't cleared up one of my main queries regarding the tightvnc (what the whole teams uses for the connecting to various remote pc's and Mac's) and "normal" vncviewer?

I notice when I downloaded tightvncserver / viewer via synaptic that the dependencies were titles vncviewer / vncserver (no "tight" in the name!), hence my assumption that they are using a similar method and are cross compatible. I just want to have someone tell me that I am correct or not in this regard... or someone point me to the correct place on the net that will tell me.

thanks again for your link, as I'm more certain now that it will solve my problem.

Cheers.

David

piyushj
May 15th, 2009, 10:29 AM
i don't know if it will help any1--i got it working in 8.04.2 ubuntu with latest updates.

install vnc4server
make .vnc/xstartup file as
---
unset SESSION_MANAGER
exec sh /etc/X11/xinit/xinitrc
---
note the additional 'sh' above
------
run this
sudo mkdir /usr/X11R6/lib/X11
sudo mkdir /usr/X11R6/lib/X11/lib
sudo ln -s /usr/share/fonts/X11 /usr/X11R6/lib/X11/fonts
-----
u are done !!
set vncpasswd first and u r done !!

mikhmv
July 13th, 2009, 04:02 PM
Does anybody know how to add vnc-java for resumable sessions?

cu_
July 13th, 2009, 04:34 PM
Does anybody know how to add vnc-java for resumable sessions?
Are you talking a bout using a java client? Should be the same process. Let me explain. "Resumability" of a session is a property you set on the vnc server (parameter passed to Xvnc on the server side). It should be resumable based on this property no matter which client you use. So, whatever page you found for setting up vnc java applet and follow this thread to set up resumable session and it should work. This is how I am set up.

Let me know if you are running into issues.

mikhmv
July 13th, 2009, 07:14 PM
CU_:
No, I meant of equivalent of using next line:
vnc4server :5 -httpport 6505 -httpd /usr/share/vnc-java
this command create listener for http request on port 6505. It is allow to connect to server by command http://xx.xx.xx.xx:6505
vnc-java client will be downloaded automatically and client will connect to port 5905.

I tried to use this code for xinetd:

service Xvnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc
server_args = -inetd :5 -httpport 6505 -httpd /usr/share/vnc-java -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vnc/passwd -extension XFIXES
port = 6505
}

But it don't work.

mikhmv
July 13th, 2009, 07:19 PM
Just for info. How to install it on ubuntu server without any X.
All operation was made under root account. If you are using another account you should modify
passwordFile=/your_user_name/.vnc/passwd


apt-get install screen xfce4 mousepad thunar-archive-plugin vnc4server vnc-java xserver-xorg-core xdm xinetd

vnc4server :55
inter password for vnc
vnc4server -kill :55

------------------------------------------

edit xdm parameters:
---------------------------------------------------------------------
xdm

These changes are only required, if your display manager is XDM. If you use GDM or KDM, see the next sections.

Open /etc/X11/xdm/xdm-config with your favorite editor.

Look at the last line : "DisplayManager.requestPort: 0"

Comment it out by inserting a ! at the beginning of the line. File: /etc/X11/xdm/xdm-config

!DisplayManager.requestPort: 0

Edit /etc/X11/xdm/Xaccess and uncomment the line " '* #any host can get a login window" by removing the single quote. You could also change it to 192.168.0.* for some security
(from: http://en.gentoo-wiki.com/wiki/XVNC_Server#xdm )
--------------------------------------------------------------------

edit services for xinetd:

nano /etc/xinetd.d/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 16 -once -fp /usr/share/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vnc/passwd -extension XFIXES
port = 5901
}

chelrob
July 14th, 2009, 04:46 PM
I switched to NoMachine NX.

Install SSH, NX client, NX node and NX server on the Ubuntu box you want to remote into and install NX client on the other PCs.

I have NX client intalled on XP, Vista and Ubuntu Jaunty desktop. They can all remote to the Ubuntu box running NX server flawlessly.

It's faster than VNC and is more secure because it uses SSH to authenticate users.

NX is free, it works out of the box with the default configuration and you also have the ability to resume sessions with NX.

cherry316316
July 15th, 2009, 03:16 AM
this works for me


http://www.techotopia.com/index.php/Remote_Access_to_the_Ubuntu_Linux_Desktop

d3ngar
July 26th, 2009, 09:07 PM
Hi, my problem is that the host machine has got me logged in, so when I try to connect it shows a message asking for permission.

Any solution?

Thanks,

Chris

puzzler
August 2nd, 2009, 08:25 PM
Hi,
Has anyone managed to get this working in 9.04 jaunty?

I followed the guide which worked for me on previous versions, but I cant get it to run any longer, I cant connect at all.

dmizer
August 3rd, 2009, 12:04 AM
Hi,
Has anyone managed to get this working in 9.04 jaunty?

I followed the guide which worked for me on previous versions, but I cant get it to run any longer, I cant connect at all.

The default tools that have come with Ubuntu since Feisty have allowed you to configure resumable remote desktop sessions simply by going to system > preference > remote desktop. That's why this tutorial is in the "Outdated tutorials and tips" section. :)

Have you tried to configure remote desktop via this method and failed?

Syntax.
August 28th, 2009, 09:59 PM
Here are the instructions I use, and they work in v8.04.

VNC Server w/Resumable Sessions on Ubuntu
Works in Ubuntu 7.04, 7.10, 8.04, and Mint 4 (Daryna)


Make these changes while logged into gnome:


Go to System -> Administration -> Login Window (General tab) and uncheck "Disable multiple logins for a single user."
Now go to the Remote tab. Change Style: to "Same as Local"
Still on the Remote tab, click "Configure XDMCP," then uncheck "Honor indirect requests."
Enable Universe repositories in Synaptic. (this wasn't necessary in Ubuntu 8.04)


The remaining changes can be made while SSH'd into the system, or in a terminal window:


Edit /etc/gdm/gdm.conf-custom

sudo nano /etc/gdm/gdm.conf-custom

add the following two lines to the existing [security] and [xdmcp] sections:

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


Install packages:

sudo apt-get install vnc4server xinetd

Set the VNC password

sudo vncpasswd /root/.vncpasswd

Create a new file Xvnc to add the vnc service to xinetd:

sudo nano /etc/xinetd.d/Xvnc
Paste these contents into the 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/fonts/X11/misc -DisconnectClients=0 -NeverShared passwordFile=/root/.vncpasswd -extension XFIXES
port = 5901
}


Reboot


That's it. I've used these exact instructions on three Ubuntu 8.04 installs without a hitch, as well as 7.04, 7.10, and Mint 4. Good luck.

I followed those instructions, on 64 bit 9.04. Whenever I try to VNC in I get a black dotted grey screen with a black x mouse. Google didn't really help me :( Any ideas?

Syntax.
August 28th, 2009, 10:06 PM
Strange.. I just restarted the computer. SSH'd into it and started vnc4server. It came up with still the black mouse and grey dotted background but now a little terminal box popped up and I was able to type in it. No GUI though..

Edit - And I'm doing this because It's a headless server and FTP + SSH are nice.. But I like having the GUI.

goffa72
September 18th, 2009, 06:00 AM
I followed those instructions, on 64 bit 9.04. Whenever I try to VNC in I get a black dotted grey screen with a black x mouse. Google didn't really help me :( Any ideas?


I'm using Mythbuntu 8.10 and had the grey screen. After following the additional info from post #563 all works well.

Hi!
I think is has something to do with ipv6 (My network is ipv4)

On file /etc/modprobe.d/aliases find the line containing

and replace „ipv6“ with „off“. After reboot everything should work!

Nephiel
September 18th, 2009, 03:12 PM
I just got Xvnc + xdm working on 9.04, but every time I try to open a GUI app from a xterm through a VNC connection I get this on the xterm:

Xlib: extension "RANDR" missing on display "mymachine:1.0".
Xlib: extension "Generic Event Extension" missing on display "mymachine:1.0".
Xlib: extension "Generic Event Extension" missing on display "mymachine:1.0".
Xlib: extension "Generic Event Extension" missing on display "mymachine:1.0".

The apps still work but the error messages are pretty annoying. I don't get them when logged on directly on my machine. Any ideas?

jearenas87
September 21st, 2009, 08:09 PM
Warning!
This howto is old, unsupported, and relies on a broken package. This should be used as reference only.

So here's the complete list of steps that are required to set the VNC server that any user can login into and start a session. It is also persistent, meanning that even if you disconnect the VNC client your X session will not end (unless you explicitly log out) and you can reconnect to the same session again. The VNC server uses a separate display (:1) than your regular X server, which works with your physical display (:0). So two sessions can be active at the same time (one person sitting at the physical display and another remotely connecting using VNC).

1. Enable XDMCP
System->Administration->Login Screen Setup
Tab Security->Enable XDMCP
Tab XDMCP--> You can disable "Honor Indirect Requests"

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

2. Install required packages (vncserver and xinetd)

sudo apt-get install vnc4server xinetdNote 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/XvncEnter 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:1You 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.

when i do sudo killall Xvnc it gives me the below.

root@worldstream-desktop:~# sudo killall Xvnc
Xvnc: no process killed

jearenas87
September 21st, 2009, 08:13 PM
vncviewer localhost:1

When i put that in, it gives me this message


root@worldstream-desktop:~# vncviewer localhost:1

VNC viewer for X version 4.0 - built Oct 19 2005 20:19:45
Copyright (C) 2002-2004 RealVNC Ltd.
See http://www.realvnc.com for information on VNC.
vncviewer: unable to open display ""


What could be wrong?

mmoo9154
October 2nd, 2009, 08:24 PM
The default tools that have come with Ubuntu since Feisty have allowed you to configure resumable remote desktop sessions simply by going to system > preference > remote desktop. That's why this tutorial is in the "Outdated tutorials and tips" section. :)

Have you tried to configure remote desktop via this method and failed?

I have tried this, and it failed. I use TightVNC client on a Windows 7 (Win7) platform, and the Ubuntu is Hardy, Ubuntu 8.04.3 LTS.

The VNC session starts and then fails. If I uninstall vino and install vnc4server, it works fine.

I'm going to try Xvnc next to see if that works better.

-Mark

backtolinux
November 5th, 2009, 09:03 PM
Here's a way to get it set up on Ubuntu 9.04 jaunty:

http://saraiya.com/blog/2009/11/06/how-to-get-vnc-working-with-a-hidden-desktop-on-ubuntu-9-04-jaunty/

SBKch
November 8th, 2009, 08:53 PM
After upgrade to Ubuntu 9.10 i have non-stop gdm errors, so i must "service gdm stop" it, right after server start (load). /var/log/syslog:

Nov 9 01:28:23 nexem gdm-binary[17829]: WARNING: GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors
Nov 9 01:28:23 nexem kernel: [24091.516477] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:23 nexem init: gdm main process (17829) terminated with status 1
Nov 9 01:28:23 nexem init: gdm main process ended, respawning
Nov 9 01:28:23 nexem gdm-binary[17871]: WARNING: Unable to find users: no seat-id found
Nov 9 01:28:23 nexem kernel: [24091.700349] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:23 nexem gdm-binary[17871]: WARNING: GdmDisplay: display lasted 0,116247 seconds
Nov 9 01:28:23 nexem kernel: [24091.745531] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:23 nexem kernel: [24091.813181] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:23 nexem gdm-binary[17871]: WARNING: GdmDisplay: display lasted 0,110766 seconds
Nov 9 01:28:23 nexem kernel: [24091.856681] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:23 nexem kernel: [24091.924367] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:24 nexem gdm-binary[17871]: WARNING: GdmDisplay: display lasted 0,109573 seconds
Nov 9 01:28:24 nexem kernel: [24091.966587] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:24 nexem kernel: [24092.035196] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:24 nexem gdm-binary[17871]: WARNING: GdmDisplay: display lasted 0,110129 seconds
Nov 9 01:28:24 nexem kernel: [24092.077081] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:24 nexem kernel: [24092.149128] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:24 nexem gdm-binary[17871]: WARNING: GdmDisplay: display lasted 0,109363 seconds
Nov 9 01:28:24 nexem kernel: [24092.186805] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:24 nexem kernel: [24092.253891] [drm:intelfb_restore] *ERROR* Failed to restore crtc configuration: -22
Nov 9 01:28:24 nexem gdm-binary[17871]: WARNING: GdmDisplay: display lasted 0,109566 seconds
Nov 9 01:28:24 nexem gdm-binary[17871]: WARNING: GdmLocalDisplayFactory: maximum number of X display failures reached: check X server log for errors

In attachment there is log after "vncserver :1 -geometry 1440x898 -depth 32" command

I use Ubuntu server (2.6.31-14-server #48-Ubuntu SMP x86_64 GNU/Linux) on non-monitor/keyboard/mouse machine.
What the heck went wrong?

covert
November 23rd, 2009, 01:37 AM
I have got a virtual second screen running and it works great, now.. How do I enabled VNC to the normal screen at the same time ?

pbreddy
November 25th, 2009, 05:08 AM
change this line from '/usr/share/X11/fonts/misc' to '/usr/share/fonts
/X11/misc'.

Repeat step 5. then execute below(at terminal):

'vncserver'

It worked for me. Please, let me know comments.

vishnu.patel
December 3rd, 2009, 12:35 AM
[quote=Tichondrius;688683]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 XvncThis should show something like this:



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):

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


I tried above command but i have


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 3 10:04:42 2009
vncext: VNC extension running!
vncext: Listening for VNC connections on port 5902
vncext: created VNC server for screen 0
error opening security policy file /etc/X11/xserver/SecurityPolicy
Could not init font path element /usr/share/X11/fonts/misc, removing from list!

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



I could not understand what could be the problem ?

auraithx
January 22nd, 2010, 05:15 AM
Okay, after trials and tribulations I think I've got it setup right.

root@hostname:~# sudo netstat -tap | grep xinetd
tcp 0 0 *:5901 *:* LISTEN 7047/xinetd
root@hostname:~# vncserver

New 'hostname:5 (root)' desktop is hostname:5

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/hostname:5.log

root@hostname:~# vncviewer localhost:1
Error: Can't open display:


I figure the last error is because I'm accessing my server via SSH?

However, when I open up VNC viewer on windows and try to connect I get a 'Connection Refused' error

liquidonline
May 5th, 2010, 09:35 AM
I had this working fine (with a few tweaks here and there, as noted throughout this thread) on jaunty. I've moved to Lucid and it seems there's no hope of getting a remote desktop connection to my PC unless I've already logged in - quite useless on a headless machine.

I've been trying for some time to get this working on lucid. I didn't upgrade to karmic for this, but I took the plunge to lucid now determined to get this to work. I can't be the only one trying to do this. The one that comes with ubuntu is horrible, lacks any configuration options, and doesn't work if 1: you're running headless, or 2: you're not already logged in. To boot, my desktop has a 22inch and 19inch monitor. A 2000(something)x1050 VNC session with the full colors is hardly responsive.

Isn't there anyone here who is doing this on ubuntu? I mean, if I wanted to have a console-only server, with all due respect, I would be using a bsd, or at least some other form of linux than ubuntu...

At this point, I don't care if I have to login to ssh first, which sucks as I need to ssh to the router before hand (running openbsd, and refreshingly, well documented btw... very frustrated with lack of documentation so far) and run a handful of commands to get a remote desktop. Not ideal, but it would be a start.

Big fail for ubuntu if even jumping through hoops doesn't get you a useable remote desktop.

Crass Spektakel
May 5th, 2010, 05:05 PM
Lucid Lynx: Works out of the box with very little work!

I'll do a sum up of all options required to make VNC over XDMCP managed log in session displaying X11 applications on a perfectly fresh Lucid Lynx.

On Port 5920 you'll get a dynamic login session, that means, several clients can connect to this vnc port, getting a gdm login and a session running as long as the window is open. Closing the window is synonymous for logging out or killing your window manager. Very convenient to allow for "lots of normal users" to log into a computer at once.

On Port 5925 you'll get a static login session, one person can connect and works on a persistant screen which keeps its data between disconnects. Very helpful for administration purposes.

aptitude install vnc4server xinetd
vncpasswd /etc/vncpasswd-semipublic

edit /etc/services and add something like

vnc1024 5920/tcp
SV1024 5925/tcp

create /etc/xinetd.d/Xvnc containing something like:

root@boni:/etc/gdm# cat /etc/xinetd.d/Xvnc
service vnc1024
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/bin/Xvnc4
server_args = -inetd -desktop boni-loginvnc-1024 -query localhost -geometry 1024x768 -once -depth 16 -fp /usr/share/fonts/X11/misc -SecurityTypes=none
}

service SV1024
{
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc4
server_args = -inetd :25 -desktop boni-staticvnc-1024 -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc/ -DisconnectClients=0 -NeverShared passwordFile=/etc/vncpasswd-semipublic
}


next create or edit /etc/gdm/custom.conf:
edit: I insert jocko_johnson settings here, they avoid several problems.

[daemon]
[security]
DisallowTCP=false
[xdmcp]
Enable=true
HonorIndirect=false
#following line fixes a problem with login/logout
DisplaysPerHost=2
MaxSessions=16
[greeter]
[chooser]
[debug]
Enable=true

You might try creating /etc/X11/xserver/SecurityPolicy but I think it might be useless/harmful:

version-1

# $Xorg: SecurityPolicy,v 1.3 2000/08/17 19:47:56 cpqbld Exp $

# The site policy fields are interpreted by the XC-QUERY-SECURITY-1
# authorization protocol. The values are arbitrary and site-specific.
# Refer to the Security Extension Specification for the usage of the policies.
#sitepolicy A
#sitepolicy B
#sitepolicy C

# Property access rules:
# property <property> <window> <permissions>
# <window> ::= any | root | <propertyselector>
# <propertyselector> ::= <property> | <property>=<value>
# <permissions> :== [ <operation> | <action> | <space> ]*
# <operation> :== r | w | d
# r read
# w write
# d delete
# <action> :== a | i | e
# a allow
# i ignore
# e error

# Allow reading of application resources, but not writing.
property RESOURCE_MANAGER root ar iw
property SCREEN_RESOURCES root ar iw

# Ignore attempts to use cut buffers. Giving errors causes apps to crash,
# and allowing access may give away too much information.
property CUT_BUFFER0 root irw
property CUT_BUFFER1 root irw
property CUT_BUFFER2 root irw
property CUT_BUFFER3 root irw
property CUT_BUFFER4 root irw
property CUT_BUFFER5 root irw
property CUT_BUFFER6 root irw
property CUT_BUFFER7 root irw

# If you are using Motif, you probably want these.
property _MOTIF_DEFAULT_BINDINGS root ar iw
property _MOTIF_DRAG_WINDOW root ar iw
property _MOTIF_DRAG_TARGETS any ar iw
property _MOTIF_DRAG_ATOMS any ar iw
property _MOTIF_DRAG_ATOM_PAIRS any ar iw

# If you are running CDE you also need these
property _MOTIF_WM_INFO root arw
property TT_SESSION root irw
property WM_ICON_SIZE root irw
property "SDT Pixel Set" any irw

# The next two rules let xwininfo -tree work when untrusted.
property WM_NAME any ar

# Allow read of WM_CLASS, but only for windows with WM_NAME.
# This might be more restrictive than necessary, but demonstrates
# the <required property> facility, and is also an attempt to
# say "top level windows only."
property WM_CLASS WM_NAME ar

# These next three let xlsclients work untrusted. Think carefully
# before including these; giving away the client machine name and command
# may be exposing too much.
property WM_STATE WM_NAME ar
property WM_CLIENT_MACHINE WM_NAME ar
property WM_COMMAND WM_NAME ar

# To let untrusted clients use the standard colormaps created by
# xstdcmap, include these lines.
property RGB_DEFAULT_MAP root ar
property RGB_BEST_MAP root ar
property RGB_RED_MAP root ar
property RGB_GREEN_MAP root ar
property RGB_BLUE_MAP root ar
property RGB_GRAY_MAP root ar

# To let untrusted clients use the color management database created
# by xcmsdb, include these lines.
property XDCCC_LINEAR_RGB_CORRECTION root ar
property XDCCC_LINEAR_RGB_MATRICES root ar
property XDCCC_GRAY_SCREENWHITEPOINT root ar
property XDCCC_GRAY_CORRECTION root ar

# To let untrusted clients use the overlay visuals that many vendors
# support, include this line.
property SERVER_OVERLAY_VISUALS root ar


additional infos:

-sometimes you have to add "-extension XFIXES" to /etc/xinetd.d/Xvnc at "server_args".
-if telnet <system> 5920 fails with "can't connect" then you xinetd doesn't work
-if telnet <system> 5920 closes fast or your VNC client reports "unknown Plugin/whatever" then your X "-extension XFIXES" must be changed.
-if telnet <system> 5920 hangs completely try restarting your system
-if your vnc session is showing nothing except the default X11 pattern then your gdm isn't listening, see /etc/gdm/custom.conf
-always check /var/log/syslog
-change the resolutions in /etc/xinetd.d/Xvnc with -geometry
-there you'll also find color depth, depth 16 sometimes falls back to depth 8 with a 233 mapping, ugly colors result. Try using depth 8 "flat color" or "color tables" (TODO) or depth 24 which might work better or worse. Your milage may vary.
-play around with vncconfig for copy-and-paste and other nifty stuff.

About me: I think I have been one of the very first users getting a XDM/GDM-Login over VNC, a long time ago, before Xvnc, sometimes around 1999, running SuSE 6.3. Most nowadays FAQs are more or less based on my old FAQ. So if you have a question I might be the best person to ask - though I must admit that a lot of things have changed, a lot more since Ubuntu8.04 than all the time before, lots of configs have totally changed or changed position, patches no longer working and so on. Therefore I would suggest to make this topic a new one.

liquidonline
May 5th, 2010, 11:39 PM
Wow, thanks for the feedback. While your point about starting a new thread is valid, I think many people still come to this thread, and it's worthwhile to update this. Once I have a fully documented process, I'll gladly start up a new thread as a reliable Howto for lucid (and really, gdm > 2.28 ).

Your post motivated me. Likely due to everything I had been tinkering with, and likely why nothing was working anymore when I decided to post this, I couldn't get this to work at first. I figured, it's a 4-day old install, I hadn't even restored backups, so I decided to reinstall ubuntu-server. My experience is summarized below. I'm hoping you can lend a helping hand. I'm a bsd sysadmin by trade, I never really used X for anything, so I know very little of it. I just know enough to know doing it within the confines of what's available ported to BSD is painful ;)

==========

Post reinstall, it still didn't work at first. My needs don't require two vnc server sessions running, I went with one based on my needs. No matter what I did, xfixes there or not, restart gdm, it wouldn't go. Tried matching more closely yours (the second of the two), still didn't work.

So next, I tried using your exact /etc/xinetd.d/Xvnc file (besides obvious necessary changes to reflect my system), only one service would start, the other would (quietly) fail. Consistently, the one setup to run as nobody would not start up. Changing the "wait" to yes and user to root did not help this. Interestingly though, the second one suddenly worked (after putting the two services, prior to any modifications)! I have no explanation for this, but one would be nice, as it would help understand more what's going on. Here is what the /etc/xinetd.d/Xvnc file looks like now (/etc/services reflects screen numbers used). I can access the "service vncbig" using this. Regardless if I used -extension XFIXES or not, the first one would time out on telnet instantly, as you'll see below the snippet from my syslog


service vncsmall
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/bin/Xvnc4
server_args = -inetd -desktop zeus-1024x768 -query localhost -geometry \
1100x800 -once -depth 15 -fp /usr/share/fonts/X11/misc \
-SecurityTypes=none -extension XFIXES
}

service vncbig
{
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc4
server_args = -inetd :5 -desktop zeus-HiQ -query localhost -geometry \
1280x1024 -depth 16 -once -fp /usr/share/fonts/X11/misc/ \
-DisconnectClients=0 -NeverShared -SecurityTypes=none
}


From syslog:

May 5 21:11:15 zeus xinetd[20950]: bind failed (Address already in use (errno = 98)). service = vncbig
May 5 21:11:15 zeus xinetd[20950]: Service vncbig failed to start and is deactivated.
May 5 21:11:15 zeus xinetd[20950]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
May 5 21:11:15 zeus xinetd[20950]: Started working: 1 available service
May 5 21:11:25 zeus xinetd[20953]: warning: can't get client address: Transport endpoint is not connected
May 5 21:12:59 zeus gdm-session-worker[20689]: GLib-GObject-CRITICAL: g_value_get_boolean: assertion `G_VALUE_HOLDS_BOOLEAN (value)' failed
May 5 21:13:03 zeus gnome-session[20978]: WARNING: GSIdleMonitor: IDLETIME counter not found
May 5 21:13:03 zeus rtkit-daemon[21046]: Sucessfully called chroot.
May 5 21:13:03 zeus rtkit-daemon[21046]: Sucessfully dropped privileges.
May 5 21:13:03 zeus rtkit-daemon[21046]: Sucessfully limited resources.
May 5 21:13:03 zeus rtkit-daemon[21046]: Running.
May 5 21:13:03 zeus rtkit-daemon[21046]: Watchdog thread running.
May 5 21:13:03 zeus rtkit-daemon[21046]: Canary thread running.



Not out of the woods yet though. Seems like the fast-user-switching (or something related to it anyway) fails when I login. I only mention this because I wonder if it's related to the following problem: If I log out of the session to close vnc server, I can no longer log back in, until I reboot. restarting gdm or restarting xinetd is of no help. If I simply "X" the window closed, then I can log back into it. Is this something that an Xstartup file would be able to help with by any chance?

Here's what I get on each login:
http://mail.obsecured.net/fusa.png

So. While there's signifcant progress made, the one thing above all that really gets to me is why I need to run two vnc servers, in order to get one to work!?!?!?

update: Upon reboot, now I noticed in syslog that it reports both of them as up and running, though ps shows only the second of the two, and I still get an instant timeout on connect to the first one (running as user nobody)

liquidonline
May 6th, 2010, 12:05 AM
OK, regarding the whole "unable to vnc back in if I logout" thing, it's worth noting that I'm running ubuntu-server on this machine, and I simply installed gnome-desktop-environment instead of the clunkier ubuntu-desktop. Not knowing whether or not this is responsible for that odd behaviour, I'm now in the process of installing ubuntu-deskstop and we'll see if that makes any sort of difference in the morning.


Some other stuff I've noticed:

For clarity: In /etc/xinetd.d/Xvnc, when I went to setting up two services as was shown to us by crass, I named the first one "vncsmall" and the second "vncbig," the latter of which is the one which runs as root. BTW, still not sure how the one running unprivileged as nobody runs exactly. Ok, moving right along...

In syslog, the error msgs indicate the service "vncbig" (see above) couldn't bind to the requested port because it's already in use. However, when I connected to :5, which is the one designated for "vncbig" I was able to connect: Here's what I'm talking about:


May 5 20:58:06 zeus xinetd[20767]: Reading included configuration file: /etc/xinetd.d/Xvnc [file=/etc/xinetd.conf] [line=14]

***SNIP*** (other services)

May 5 20:58:06 zeus xinetd[20767]: bind failed (Address already in use (errno = 98.)). service = vncbig
May 5 20:58:06 zeus xinetd[20767]: Service vncbig failed to start and is deactivated.
May 5 20:58:06 zeus xinetd[20767]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
May 5 20:58:06 zeus xinetd[20767]: Started working: 1 available service
May 5 20:58:21 zeus xinetd[20767]: Exiting...


==============================================

Now, back to my observation that the two VNC's started up according to syslog on reboot. Here's what I mean:

May 5 21:18:30 zeus xinetd[21315]: Reading included configuration file: /etc/xinetd.d/Xvnc [file=/etc/xinetd.conf] [line=14]

**SNIP** same again

May 5 21:18:30 zeus xinetd[21315]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
May 5 21:18:30 zeus xinetd[21315]: Started working: 2 available services
May 5 21:19:23 zeus xinetd[21323]: warning: can't get client address: Transport endpoint is not connected
May 5 21:19:27 zeus xinetd[21325]: warning: can't get client address: Transport endpoint is not connected


Those warning messages are what appears at the same time as I get the connection reset by peer when I try to telnet or vnc to the server.

muhnkee
May 13th, 2010, 04:33 PM
Hey I went through and installed vnc4server, xinetd and set everything up as in this guide on an Ubuntu 10.04 Lucid Lynx machine. Everything worked phenominally.

Then I made what is apparently a huge mistake and did a sudo apt-get upgrade. Now I get the gray screen with the old style x cursor. It even gives me the gray screen when I run the vncserver from the desktop and try to login.

If I try to do it with vnc4server straight from the command line and attempt to connect, I get the additional "Could not acquire name on session bus."

If I use the Xvnc4 command, I get "error opening security policy file /etc/X11/xserver/SecurityPolicy" in the terminal and get the gray screen when I try to VNC to the display.

The ~/.vnc/passwd file is there and being referenced in /etc/xinetd.d/Xvnc file.

Now if I login as root and run through things manually it works like a charm.

I've read through a majority of the 60 pages of this posting, some other ones and still can't find a solution to my problem. Any ideas?

DaleEMoore
May 23rd, 2010, 01:13 PM
These are great instructions and served me well on Ubuntu 8.04. But I just upgraded to 10.04 and Xvnc is not responding to vncviewer.

I would love it if someone had any guidance on how to setup Xvnc for Ubuntu 10.04.

Any suggestions are very much appreciated,
Dale E. Moore
PS: My upgrade method was:

"update-manager -d" from 8.04 to 9.10
"do-release-upgrade" from 9.10 to 10.04

Wolfpup
May 25th, 2010, 07:50 PM
These are great instructions and served me well on Ubuntu 8.04. But I just upgraded to 10.04 and Xvnc is not responding to vncviewer.

I would love it if someone had any guidance on how to setup Xvnc for Ubuntu 10.04.

Any suggestions are very much appreciated,
Dale E. Moore
PS: My upgrade method was:

"update-manager -d" from 8.04 to 9.10
"do-release-upgrade" from 9.10 to 10.04


Actually with the newer versions you can configure a remote desktop from System>Personal>Remote Desktop.

That is how i have done mind and i also have a good Linksys Roughter that lest me set the ip of computer on my network so that the have a static ip in the roughter, I also have a free domain form a place that prodied them and with the new roughter i even have accec to my 'server' that is at home when im at work. as well on my local network by useing VNC viewer on those windows based systems.

PhDLinux
May 27th, 2010, 01:56 AM
Thanks to Crass Spektakel for Post #605 above! I got this working on Lucid Lynx, Ubuntu Studio edition, with some minor changes.

Here is an exact copy of one stanza in my file /etc/xinetd.d/Xvnc. This one serves the netbook:

service vnc1024x600
{
type = UNLISTED
disable = no
port = 5911
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/bin/Xvnc4
server_args = -inetd -once -SecurityTypes None -geometry 1000x600 -depth 24 -fp /usr/share/fonts/X11/misc/ -co /usr/share/X11/rgb -query localhost
log_type = SYSLOG daemon info
log_on_failure = HOST
log_on_success = PID HOST EXIT
}
The added logging commands helped me figure out some changes suggested below.

I inserted one corresponding line in the lengthy file /etc/services, as follows:
vnc1024x600 5911/tcp # VNC 1024x600 @ 24bpp
(Perhaps the "UNLISTED" directive in the Xvnc file makes this redundant, but I want to thoroughly document everything. The port number 5911 shown here must match the port number declared in the Xvnc file shown above.)

Here is my key difference from the cited post (without this my connection attempts would flash a grey X screen for a fraction of a second and then quit). I had to add two extra lines to the end of the suggested gdm configuration file. Here is an exact copy of my complete file /etc/gdm/custom.conf:

[security]
DisallowTCP=false
[xdmcp]
Enable=true
MaxSessions=16
DisplaysPerHost=2

The cited post also mentions a file named /etc/X11/xserver/SecurityPolicy. My system does not even have a directory named /etc/X11/xserver, so I skipped the creation of this file. The setup works anyway.

Every time you change the file /etc/xinetd.d/Xvnc, it is necessary to restart the xinetd server *as root* ("sudo /etc/init.d/xinetd restart"). [When I forgot "sudo", the system supplied a user-mode xinetd server in addition to the system-wide one, and things got confusing.] Similarly, changes to /etc/gdm/custom.conf don't actually take effect until you restart the display manager ("sudo service gdm restart"). Note that restarting gdm terminates your session completely and sends you back to the login screen instantly.

As a preliminary step, I used the command line to practice giving the Xvnc command that the xinetd daemon would ultimately emit. I picked a port number different from the ones xinetd was busy listening to (my choice was 5903) and replaced the option "-inetd" with the string ":3" to get this command. No need to run as root:

$ Xvnc4 :3 -SecurityTypes None -geometry 1000x600 -depth 24 -fp /usr/share/fonts/X11/misc/ -co /usr/share/X11/rgb -query localhost
Seeing a small-sized greeter screen in response to "vncviewer localhost:3" meant it was safe to take the next step and get xinetd involved. Of course there were many failures before this point, and they came with helpful messages -- something you don't get when relying on xinetd!

errodrigues
May 28th, 2010, 07:08 PM
Thanks a lot Crass Spektakel!!! Ihad already spent more than 1 day trying to make this thing work on my Lucid and your instructions did the trick.

I don't need 2 services running so I just created 1 and it works like a charm now. Only thing I added was including "gdm: localhost" to file /etc/hosts.allow

Thanks again!

vyath
June 21st, 2010, 07:07 AM
I managed to set things up like Spektakel and it works great, only now if I remotely login and try to access a connected USB drive (from "places", for example) I get
"Unable to mount X filesystem, Not authorized"

How do I fix it?

KillerPancake
July 14th, 2010, 12:53 AM
After trying a lot of different things, I was FINALLY able to get a VNC server up and working reliably (sort of!) on 10.04. It was the sage advice of Crass Spektakel and PHDLinux that did the trick.

My goal is to setup a headless server that can live in the basement, toiling in obscurity while not taking up any space or generating heat in prime living space. Having gotten everything set up and working well, I dragged the box downstairs and started it up. Fired up the VNC viewer on my laptop and only got the X11 screen when connecting to the server, so I dragged the box back upstairs to investigate. Started up the box again, and this time no problems with the VNC viewer on the laptop. So, back downstairs with the machine, and again only got the X11 screen in the VNC viewer. What, is the machine lonely in the basement and protesting!? Other than this issue, the machine seems fine and I can access shares without problems, no matter where the server is.

So one of two things is happening:
1) Something is happening due to the difference in location - main difference in the basement is that keyboard, monitor and mouse are not connected and a different Ethernet cable connects the server to a switch
2) Some problem is occurring intermittently and its just coincidence that it shows up when the computer is moved to the basement

I would appreciate anyone's insight as to what might be happening here! Below are the outputs of the VNC viewer during a good connection, followed by a failed connection with X11 screen only.

Successful connection:
Tue Jul 13 23:29:34 2010
CConn: connected to host 192.168.1.105 port 5920
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

Tue Jul 13 23:29:37 2010
CConn: Throughput 4000 kbit/s - changing to hextile encoding
CConn: Throughput 4000 kbit/s - changing to full colour
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using hextile encoding

Failed connection (note the last 5 lines are missing compared to above):
Wed Jul 14 00:02:25 2010
CConn: connected to host 192.168.1.105 port 5920
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

Crass Spektakel
July 17th, 2010, 12:34 AM
Actually with the newer versions you can configure a remote desktop from System>Personal>Remote Desktop.

This is different from the objective of this topic:

Your method allows for remote control of the local, physical screen (though i must say this has always been very edgy and unreliable within ubuntu for me).

This topic is about creating virtual sessions, eg. if someone connects to port 5920 he will get a seperate VNC session not connected to the local, physical screen. This also means that several people can log in over VNC and work seperately. This has proven to be rockstable even with 10 or more people logging in at once.

--- cut ---

Thanks to Crass Spektakel for Post #605 above!

I have to thank you too, your logging-statements are pretty helpful. About the following:



[security]
DisallowTCP=false
[xdmcp]
Enable=true
MaxSessions=16
DisplaysPerHost=2

I am pretty sure that the last two lines are NOT required - they are useful sometimes though. Try putting one or two blank lines there instead and it will work too.

Reason: Many unix tools have a problem reading config files which don't end in a newline so basically the last line "Enable=true" gets ignored. I think this has been haunting us since before mankind visited the moon :-)

scaltro
August 5th, 2010, 11:28 AM
This tutorial seems to be very helpful thanks to all...

But unfortunately I have some problems....
When I'm trying to connect to my vnc server, I got a grey window in which I'm able to move the cursor, but nothing else... Any idea?

My /etc/gdm/custom.conf is as default:
[daemon]

[security]
DisallowTCP=false

[xdmcp]
Enable=true

I'm working on a fresh install of Ubuntu 10.04.

Crass Spektakel
August 15th, 2010, 10:53 AM
Now I have run into something odd myself...

I have four nearly identically configured systems. One of them decided to display the grey screen upon vnc connect from time to time.

Restarting xinetd and gdm doesn't do the trick but rebooting does. I really have no idea where this comes from as all log file are clean and nice. It only happens rarely so I haven't investigated much. I think I did some inner works on the system though, lots of updates, configuring, changing runlevels, all that will produce the effect pretty reliable. But sometimes, once a month or less, it happens without good reason at all.

Keep in mind: If things dont work, reboot.

howardjacobson
September 17th, 2010, 08:51 AM
As of September 17, 2010, the instructions most recently posted on pages 61 and 62 of this thread work for Lucid 10.04. Thank you to all for the great help!

jmontani
September 20th, 2010, 09:34 PM
what should I write in the server parameter in a home network? I only
have the computers names available (i.e pc01; pc02, etc)

popzero
September 24th, 2010, 05:34 PM
After trying a lot of different things, I was FINALLY able to get a VNC server up and working reliably (sort of!) on 10.04. It was the sage advice of Crass Spektakel and PHDLinux that did the trick.

My goal is to setup a headless server that can live in the basement, toiling in obscurity while not taking up any space or generating heat in prime living space. Having gotten everything set up and working well, I dragged the box downstairs and started it up. Fired up the VNC viewer on my laptop and only got the X11 screen when connecting to the server, so I dragged the box back upstairs to investigate. Started up the box again, and this time no problems with the VNC viewer on the laptop. So, back downstairs with the machine, and again only got the X11 screen in the VNC viewer. What, is the machine lonely in the basement and protesting!? Other than this issue, the machine seems fine and I can access shares without problems, no matter where the server is.

So one of two things is happening:
1) Something is happening due to the difference in location - main difference in the basement is that keyboard, monitor and mouse are not connected and a different Ethernet cable connects the server to a switch
2) Some problem is occurring intermittently and its just coincidence that it shows up when the computer is moved to the basement

I would appreciate anyone's insight as to what might be happening here! Below are the outputs of the VNC viewer during a good connection, followed by a failed connection with X11 screen only.

Successful connection:
Tue Jul 13 23:29:34 2010
CConn: connected to host 192.168.1.105 port 5920
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

Tue Jul 13 23:29:37 2010
CConn: Throughput 4000 kbit/s - changing to hextile encoding
CConn: Throughput 4000 kbit/s - changing to full colour
CConn: Using pixel format depth 24 (32bpp) little-endian rgb888
CConn: Using hextile encoding

Failed connection (note the last 5 lines are missing compared to above):
Wed Jul 14 00:02:25 2010
CConn: connected to host 192.168.1.105 port 5920
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


I think I hit the same issue as you did with this one, mine was after doing an upgrade from 8.04 LTS to 10.04 LTS for my headless/mouseless/keyboardless server. :)

Took me a while to figure this one out; finally found it by forcing my system to disable kernel mode setting. There's a description of what is needed to disable it here: https://wiki.ubuntu.com/X/KernelModeSetting
I used the change listed for radeon cards and then it forced my X system to use the vesa setup. (Note: in my /etc/modprobe.d/ directory it didn't have any of the file names listed under "Turning it off"; the purpose of the link is to create the files using the echo command...the webpage didn't really make that clear so I like to be extra explicit :) ). This little gem of an issue drove me crazy for a day wondering WTH was going on with that dam grey X display mouse doing remote vnc access.

Oh one other thing I've found that might be helpful is putting "DisplaysPerHost=2" in my /etc/gdm/custom.conf file under the [xdmcp] section so it looks like this:
[security]
DisallowTCP=false
[xdmcp]
Enable=true
HonorIndirect=false
DisplaysPerHost=2

If I don't have this in my config each time I logout using the UI it won't let me log back in (gives that stupid timeout "111" error in the terminal). That might be why PhDLinux added that into the custom.conf file.

Hope this helps some of my fellow Ubuntu users

jocko_johnson
October 8th, 2010, 11:44 PM
I am only able to get the grey X11 screen. can someone please look at my setup and point me in a direction to resolve this?


I am running 10.04, fresh install, all updates current.

Here are my files:

/etc/xinetd.d/Xvnc

service xvnc
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/bin/Xvnc4
server_args = -inetd -desktop xvncDesk -query localhost -geometry 1024x768 -once -depth 16 -fp /usr/share/fonts/X11/misc -SecurityTypes=none
log_type = SYSLOG daemon info
log_on_failure = HOST
log_on_success = PID HOST EXIT
}

service xvncResumable
{
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = me
server = /usr/bin/Xvnc4
server_args = -inetd :88 -desktop xvnc-resumableDesk -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc/ -DisconnectClients=0 -NeverShared passwordFile=/home/me/.vnc/passwd
log_type = SYSLOG daemon info
log_on_failure = HOST
log_on_success = PID HOST EXIT
}

/etc/gdm/custom.conf



[daemon]

[security]
DisallowTCP=false

[xdmcp]
Enable=true
HonorIndirect=false
#following line fixes a problem with login/logout
DisplaysPerHost=2
MaxSessions=16

[greeter]

[chooser]

[debug]
Enable=true

/etc/services
I added these lines

#added by me 10.6.2010 for xvnc server
xvnc 5908/tcp
xvncResumable 5988/tcp


/etc/hosts.allow
I added this line
gdm: localhost


I am testing this locally on the server with the commands:
Xvnc :4 -query localhost -geometry 1024x768 -once -depth 16 -fp /usr/share/fonts/X11/misc -SecurityTypes=none
and
sudo Xvnc :3 -query localhost -geometry 1024x768 -once -depth 16 -fp /usr/share/fonts/X11/misc -SecurityTypes=none passwordFile=/home/me/.vnc/passwd

as well as trying to connect from a different machine within my LAN and also from my work computer via ssh tunnelling/x11 forwarding ( ssh is configured to allow x11forwarding ).

no matter what the results are the same:

I get the x11 window but I only seethe grey speckled screen with the giant "X" for a cursor - no login window

would really appreciate if someone knows how to fix this.

r0ck3t
October 24th, 2010, 01:45 PM
I am only able to get the grey X11 screen. can someone please look at my setup and point me in a direction to resolve this?


Hi,

just registered, hope this helps: I had exactly the same setup and the same problem, some of the last updates broke it...
I disabled IPV6 and everything works as expected (saw some strange errors in the gdm logs).

Cheers

jocko_johnson
October 24th, 2010, 06:06 PM
thanks for the suggestion.

sorry if this is a dumb question...

how do you disable IPv6?


------
edit - found my answer i think:

http://www.webupd8.org/2009/11/how-to-disable-ipv6-in-ubuntu-910.html

eti.que
January 1st, 2011, 04:53 PM
Just to mention, this is indeed a bug with GDM, listening to ipv6 only:

http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563406

It is fixed already. For now... disabling ipv6 will do the trick !

sebu18
January 3rd, 2011, 03:45 AM
Hi, i'm kind of new and didn't want to start a new thread so i ask here. How can i connect to my httpc running win 7 and vnc, from my desktop running ubuntu 10.04. I tried the methods i found on google. None of them worked. I don't want to turn on the tv when i want to make a change in the torrent client, or delete some movies.

Can you also give me a link with a tutorial on connecting to the shared windows drives from ubuntu?

Thanks!!

sanlinhtet
January 3rd, 2011, 04:33 PM
Hi;
Anybody , can help me ,plz?
I want some address , I mean host address to call in client computer from Ubuntu server.
Now I have to call like this "http://my-IP/administrator" so that I get my index files form public_html. I don't want to use that address. Let me know how to setup domain to do that
like "https://sit-name.com or others to use for only local.
please guide me
Thanks to all

tails_naf
February 6th, 2011, 02:49 PM
I have a real head scratcher here..
pretty fresh install of 10.10, and I was trying to set up vnc with resumable sessions, and had originally used this guide:

http://www.stuartellis.eu/articles/vnc-on-linux

But ran into problems - which I'll explain later.
So I assumed the guide was wrong, and instead I followed post #605 (copied exactly the setup, just to get me going)

and then when I tried it, I had the same problem.
The problem is, unless the resolution is set to 640x480, the login hangs.

I created the following screen-shots to illustrate the point -
http://imgur.com/a/tBaSh#QJxD4

one image shows the login correctly (I edited one of the configs to use 640x480)
the second image shows the broken login (this login will not respond to keys or mouse input). The resolution chosen is the only difference between them.

My main desktop is very high res (in case that makes a difference)

could someone please offer any help or advice? using a 640x480 login is really difficult.
I installed vnc4server and xinetd today, so should have the latest versions.

Lommelun
March 15th, 2011, 02:45 PM
This is my exact same problem. I am running 10.10 and I can't get resumable sessions to run for my life. Same problem when logging into XDMCP or VNC.

An entry in /ETC/HOSTS.ALLOW was required, before that I could not even connect. I have also disable IPV6, but I do not know if that was necessary. Right now at least I have the exact same problem you are describing tails_naf. It works in 640x480, but not in any other resolution.

It was all running nicely in Lucid, after a few tears and lots of sweat. I have had it running since Ubuntu 6.x. But now it seems like it is no more to be.

>tail /var/log/syslog
Mar 15 20:31:55 reoserv xinetd[10434]: xinetd Version 2.3.14 started with libwrap loadavg options compiled in.
Mar 15 20:31:55 reoserv xinetd[10434]: Started working: 2 available services
Mar 15 20:32:03 reoserv gnome-session[10453]: WARNING: GSIdleMonitor: IDLETIME counter not found
Mar 15 20:32:03 reoserv gdm-simple-greeter[10470]: Gtk-WARNING: /build/buildd/gtk+2.0-2.22.0/gtk/gtkwidget.c:5684: widget not within a GtkWindow

This probably is a good clue... The greeter has problems. But we knew that.....

Lommelun
May 4th, 2011, 03:11 PM
Problems are fixed in natty.
A host of new problems introduced, but remote login is back up and working now.

cu_
May 22nd, 2011, 11:15 PM
Problems are fixed in natty.
A host of new problems introduced, but remote login is back up and working now.

Hi... I am trying to set this up on Natty. I get a blank x windows screen instead of XDMCP. Any ideas? I mean, can you please share your set up to have this working in Natty.

kalyp
June 24th, 2011, 02:10 PM
Just installed vnc4server this morning and I had the same problem at first, I fixed it either by disabling ipv6 (cf above) or by commenting the last 4 lines in .vnc/xstartup (cf http://www.ehow.com/how_5089245_install-vnc-server-ubuntu.html, even if the syntax is slightly different). Not sure because I tried both at the same time.

I'm running into another problem. When I'm logged out and try to connect via VNC (I want to be able to remotely connect while someone else is logged in...) I getAuthentication to host [myhost] has failed (No password configured for VNC Auth).. I simply have to ssh to the machine, not even do anything else, then it works (and I can kill the ssh terminal, doesn't matter, after I'm logged in I don't need to be logged in via ssh anymore). Somehow it looks like if I don't have one session open on the computer, the password fails.
Any way to avoid that?
Thanks.

edit - actually, that's not totally true. If I close the ssh terminal I lose the possibility to control the desktop. For instance trying to launch a terminal, it hangs and never opens it, while if I'm still sshed in it shows up in a fraction of second...

mök
August 11th, 2011, 05:12 AM
> When I'm logged out and try to connect via VNC (I want to be able to remotely connect while someone else is logged in...) I get Authentication to host [myhost] has failed (No password configured for VNC Auth). I simply have to ssh to the machine, not even do anything else, then it works

Sounds like an encrypted home directory to me.

kalyp
August 11th, 2011, 05:20 AM
Yep that's what I figured out in between (forgot I had posted this). It also causes my autofs to stop mounting network shares into my home directory while I'm logged out and a session is running via VNC, which is obviously a problem when running scripts.

I need to un-encrypt my home directory, but since I'm away from the machine right now, I won't risk it until I'm back :) the ssh trick works well enough except that I can't switch off my computer...

I find it kind of annoying though, that encrypted home folders aren't accessible by remote VNC sessions if not logged in. I would have imagined that virtual sessions were just as good as "regular" ones...

Rogach
August 18th, 2011, 05:48 AM
Hello!
I have a problem with vnc. I configured it like it was in how-to, got grey screen at first, but it solved after enabling xdmcp.
Now I do see the login prompt, and I am able to login to system - but only if I set -geometry option of Xvnc to 640x480. On higher resolutions login prompt hangs after several seconds - on 800x600 it sometimes starts to render user names, on 1024x768 it is draws only the white box with machine name.

What could cause such behavior?

dreamage
August 23rd, 2011, 01:49 PM
> When I'm logged out and try to connect via VNC (I want to be able to remotely connect while someone else is logged in...) I get Authentication to host [myhost] has failed (No password configured for VNC Auth). I simply have to ssh to the machine, not even do anything else, then it works

Sounds like an encrypted home directory to me.

I've found a simple solution for this problem.
Login to your remote machine and create a screen session:
$ screen
The from inside the screen session run vncserver:
$ vnc4server
and open a ssh sesion to localhost
$ ssh localhost
Next detach the screen by "CTRL+A" "d"
Done
Now the vnc accepts the connections without the ssh session

kalyp
August 23rd, 2011, 02:02 PM
oh wouah!! it works!! this is simply awesome. Not need to go through the un-encryption process anymore :)
Thank you so much!

mdavi
October 4th, 2011, 12:57 PM
Forgive me if this there is an obvious solution to this, but I am new enough to linux that it isn't obvious to me.

First of all, thanks to everyone for all the tips here. I got everything set up with all of the advice and some thought and perseverance. I have a need for several folks to be able to log in to my machine with independent sessions for doing calculations that can take days to run, thus the need for resumable sessions. Having an ssh session doesn't work when the calculation running stops on logout.

The problem I'm having is that after a number of successful repeat logins to the same session, occasionally a user is getting locked out with a message at the VNC login stage saying "the server is already in use." He isn't logged in, so he isn't using the server. We aren't sure what is happening. I've searched the logs and cannot find anything unusual, other than the attempted logins. It is very frustrating, because thus far, I cannot find a way to get him in, other than to kill the vnc session and restart the servers which also kills the calcuations he has been running for days.

I'm running Lucid and have several vnc services set up on different ports with different users and passwords as outlined elsewhere in this thread. A copy of my Xvnc file is below for reference. Any thoughts on how to fix the problem will be most appreciated. As a second best advice, if you have an idea on how to restore my user's access without killing the session when he does get locked out, I could use that as a band-aid in the meantime while I continue to troubleshoot the root cause.

Thanks!
Mark


service vncshort
{
disable = no
socket_type = stream
protocol = tcp
wait = no
user = nobody
server = /usr/bin/Xvnc4
server_args = -inetd -desktop mark-desktop -query localhost -geometry 1024x768 -once -depth 16 -fp /usr/share/fonts/X11/misc -SecurityTypes=none
}

service vncsticky1
{
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc4
server_args = -inetd :25 -desktop mark-desktop-staticvnc -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc/ -DisconnectClients=0 -NeverShared passwordFile=/etc/vncpasswd-somefile1
}

service vncsticky2
{
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc4
server_args = -inetd :30 -desktop mark-desktop-staticvnc -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc/ -DisconnectClients=0 -NeverShared passwordFile=/etc/vncpasswd-somefile2
}

service vncsticky3
{
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc4
server_args = -inetd :35 -desktop mark-desktop-staticvnc -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc/ -DisconnectClients=0 -NeverShared passwordFile=/etc/vncpasswd-somefile3
}

service vncsticky4
{
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc4
server_args = -inetd :40 -desktop mark-desktop-staticvnc -query localhost -geometry 1024x768 -depth 16 -once -fp /usr/share/fonts/X11/misc/ -DisconnectClients=0 -NeverShared passwordFile=/etc/vncpasswd-somefile4
}