0

I am trying to get Real VNC server on Ubuntu 10.04 LTS 64 bit.

I tried 2 options. First, I got Real VNC free edition and got it working after getting all requires 32 bit libraries, configuration hacking etc. It's almost good with one little problem, after I disconnect client, server prints Aborted and exits. I tried many combination of parameters and could not figure it.

This is roughly a command line I used (but I tried many parameter combinations).

Xvnc :2 -desktop user-desktop -query localhost -geometry 1920x1200 -depth 16 -AcceptCutText -SendCutText -rfbauth /home/user/.vnc/passwd -SecurityTypes None -DisconnectClients

Second option. I got trial version of Real VNC Enterprise 4.6.1 and installed it. Now I can happily start it as standalone server and my clients can disconnect without killing server but when I try to use it with -inetd option it just silently exits. When I try free edition it would go into stdio mode and print handshake message

RFB 003.008

Not the case with enterprise edition. It just exits. No message and no logs.

So does anyone have any idea on how to get either option work?


Per recommendation from @grawity I run strace and ltrace. Here is most interesting output from ltrace (I collected data in file called abc and only pasted lines that I find interesting):

$cat abc | egrep 'strchr|print'

fprintf(0x7f330223e860, "\n%s", "Sun Jul 10 13:07:30 2011\n") = 26
strchr("inetd client gone, exiting", ' ')        = " client gone, exiting"
strchr("client gone, exiting", ' ')              = " gone, exiting"
strchr("gone, exiting", ' ')                     = " exiting"


$ cat abc | egrep 'strchr|print' | grep socket
strchr("getpeername: Socket operation on"..., ' ') = " Socket operation on non-socket "...
strchr("Socket operation on non-socket ("..., ' ') = " operation on non-socket (88)"
strchr("operation on non-socket (88)", ' ')      = " on non-socket (88)"
strchr("on non-socket (88)", ' ')                = " non-socket (88)"
strchr("non-socket (88)", ' ')                   = " (88)" 

1 Answers1

1

Try running it under ltrace or strace.

It could be that the inetd mode requires that stdin and stdout be sockets – for example, this is required for determining the client's IP address. It's likely that RealVNC isn't prepared for getpeername() to return failure.

Alternatively, use Xvnc.

u1686_grawity
  • 426,297
  • 64
  • 894
  • 966
  • Thanks for mentioning strace and ltrace. You may be right about sockets. I updated my question with output of ltrace. But what do I do next to solve it? – Alex Gitelman Jul 10 '11 at 20:20
  • @Alex: The problem shouldn't happen when running RealVNC under *real* xinetd. Have you tried that already? – u1686_grawity Jul 10 '11 at 21:16
  • I tried from real xinetd. I can connect, see X screen for a second and then it dies. I also can't figure how to get log from vnc. – Alex Gitelman Jul 10 '11 at 22:08
  • Try a packet sniffer; error messages usually go to stderr, which is sent over the same socket by xinetd. Also check `dmesg` for program crashes, and `/var/log/messages`|`/var/log/syslog`|`/var/log/everything.log` for VNC logs. – u1686_grawity Jul 10 '11 at 22:24
  • Actually, I accidentally :( found vnc log. Not sure why my attempts to direct it to specific place fail. It always just says that `inetd client is gone`. But anyway, apparently there is a permission issue. I changed user in xinetd config file to myself and now I can connect. However, it still dies once I disconnect client. I think there was an option to xinetd that controls it. I am browsing through docs and will probably find it, but do you remember on top of your head? – Alex Gitelman Jul 10 '11 at 22:31
  • @Alex: What if you change the user to `root`? Also, in inetd mode, the server is *supposed to* exit after losing TCP connection. – u1686_grawity Jul 10 '11 at 22:40
  • If server dies after disconnect that would defeat much of the purpose of vnc for me. For example, I work on my laptop, connect and then just step out for coffee. Laptop goes into power save and I lose my session. I am pretty sure that it didn't happen to me with Red Hat setups. I will try root, although vnc docs clearly say that it should not be done. – Alex Gitelman Jul 10 '11 at 22:55
  • @Alex: Then don't use it in inetd mode; run it as a daemon. – u1686_grawity Jul 10 '11 at 22:57
  • root makes no difference. It still exits. – Alex Gitelman Jul 10 '11 at 22:57
  • I was about to use it as daemon. But finally I set `wait=yes` and it seems to address my problem. Hooray! Which actually makes sense as I want to just always connect to the same instance of my server. – Alex Gitelman Jul 10 '11 at 23:06