How can I pre-fill OSXvnc's "Connect Host:" field?

I use OSXvnc 1.71 on MacOS X (along with RealVNC’s winvnc.exe on Windows), and the Reverse Connect feature is fantastic!

Here’s the background to my question:

On my Windows machine:

  • I run the “listening VNC viewer” (vncviewer.exe -listen 5500)
  • I’ve set a static local IP address on my local network, 192.168.1.102

In my router I’ve forwarded port 5500 to my Windows machine’s static local IP address.

So for a long time now, when I’ve helped someone who uses Mac OS X, I put OSXvnc 1.71 in their Dock so that later on, while I’m talking to them on the phone, I have them:

  • click the OSXvnc 1.71 icon in their Dock
  • click in OSXvnc’s “Connect Host:” field
  • type in my IP address (which I read to them on the phone each time, since it changes)
  • click “Add” or press Return

Recently I’ve discovered the “dynamic DNS” concept (www.dyndns.com), so to make all this a little easier:

  • I’ve created an account with dyndns.com, and created my own “host,” which I will refer to as “xxx.getmyip.com” for the purposes of this discussion
  • on my Windows laptop I now have “DynDNS Updater” running to keep dyndns.com notified when my ISP’s IP address changes and to update the value of xxx.getmyip.com

So these days, when I’m helping someone on Mac OS X, I now have them:

  • click the OSXvnc 1.71 icon in their Dock
  • click in OSXvnc’s “Connect Host:” field
  • type in my dyndns host name: xxx.getmyip.com
  • click “Add” or press Return

This all works great!

Here’s my question:

I’d like to make it even easier for the other person, so I’ve been wondering if it’s possible to create a slightly customized copy of OSXvnc 1.71 which, when launched by the user (typically by clicking the icon on the Dock) would already have the text “xxx.getmyip.com” pre-filled into the “Connect Host:” field, so all that the other person would have to do (when we get on the phone) is:

  • click the OSXvnc 1.71 icon in their Dock
  • click “Add” or press Return

If this isn’t possible per se, an acceptable alternate solution would be if I could customize OSXvnc so that, when launched by the user, it would not only have the text “xxx.getmyip.com” pre-filled into the “Connect Host:” field, but also immediately initiate the reverse connection to the viewer.

So far, I’ve figured out that I can:

  • go to the Applications folder
  • Control-click on OSXvnc 1.71.app, then click on “Show Package Contents” in the contextual menu, which opens a folder showing the Contents of the application
    but then I have no idea what file(s) in which subfolder(s) I might modify to perform this customization.
    Please be aware that I have a Mac running OS X 10.4.8 and I do not have any Developer tools.

I tried using Apple’s Script Editor, but apparently OSXvnc 1.71 isn’t set up for AppleScript.

(I’ve also read your FAQ and have found that I can open the Terminal program on OS X and issue the command:
/Applications/OSXvnc.app/OSXvnc-server -connectHost xxx.getmyip.com
and the OS X user’s machine immediately connects to my listening VNC Viewer, but I’d much rather stick with the regular GUI if at all possible and avoid the other person having to do anything with the Terminal program or shell scripts.)

Thanks in advance for your advice on how to make this small customization to your already incredibly useful application!

Regards,

Martin

Unfortunately there isn’t an easy way to do this right now with Vine Server (formerly OSXvnc).

But being able to retain or configure that value is a GREAT feature suggestion and one that we could probably add fairly easily.

If you do want to get the developer tools which are free if you register at http://connect.apple.com then this procedure will work to permanently set those values for a particular installation:
[list]Using the Finder and “Open as Package” go to Vine Server.app/Contents/Resources/English.lproj/
Double Click on Main Menu to open the NIB in Interface Builder
Double click inside the “Viewer: Host or IP” field
Just type the value you want pre-set
Command-S to Save the NIB
[/list:u]
Hope that helps and hopefully we can add that feature soon.

Thanks for your reply! I tried what you suggested:

  • I went to connect.apple.com
  • signed up for free
  • downloaded the “Xcode 2.4.1” .dmg file for free (almost a gigabyte!)
  • opened it, which mounted the “Xcode Tools” volume on my Desktop
  • rather than installing everything, since I only wanted Interface Builder, judging from what I read in “About Xcode Tools.pdf” I only ran “Xcode Tools/Packages/DeveloperTools.pkg”, which created the folder “Macintosh HD/Developer” on my hard disk, and within the subfolder Applications I could see Interface Builder

So, I then customized OSXvnc 1.71:

  • in the Finder, I Ctrl-clicked on my copy of OSXvnc 1.71, then clicked Show Package Contents in the contextual menu
  • the “OSXvnc 1.71” folder opened
  • I went into the “OSXvnc 1.71/Contents/Resources/English.lproj” folder and double-clicked MainMenu.nib, which launched Interface Builder
  • in the OSXvnc main window, I double-clicked in the white text box to the right of the label “Connect Host:” and typed in the name of my dyndns.com “host” (xxx.getmyip.com)
  • I did File->Save, but when I closed and reopened MainMenu.nib I found that the text field was blank again, so I concluded that typing in that text was insufficient for Interface Builder to consider the file to have been changed, so after some fiddling around I found another way to make a benign but worthy-of-saving “change” to the file (I used Layout->Keyboard Navigation->Show Keyboard Check, partly because I was interested in tab ordering, and partly because of its easy keyboard shortcut, Cmd-K)
  • Quit Interface Builder
  • noted that Interface Builder created “MainMenu~.nib”, apparently a backup copy of MainMenu.nib prior to my change
    and voila! I found that when I opened my newly-customized OSXvnc 1.71, my dyndns.com host name xxx.getmyip.com was already filled in in the “Connect Host:” field!

So, when I tested my newly-customized OSXvnc 1.71, all I had to do was:

  • open OSXvnc 1.71
  • observe that “xxx.getmyip.com” was already filled in
  • click the Add button
    and a VNC window opened in my “listening” VNC Viewer! Excellent! Just what I wanted!

However, I then noticed that on your www.redstonesoftware.com/downloads/index.html web page you’ve got a newer (and larger) version of osxvnc, now called “Vine Server 2.0”, so I downloaded that and performed the exact same customization using Interface Builder. Then, when I tried:

  • open Vine Server 2.0
  • observe that “xxx.getmyip.com” was already filled in
  • click the (recently-renamed) Connect button
    NOTHING happened in my “listening” VNC Viewer! (I was careful to Quit OSXvnc 1.71 first to avoid having two servers running on the same machine.)

However, when I ran Vine Server 2.0 and entered my actual IP address and clicked Connect, a VNC window did open in my “listening” VNC Viewer just fine.

Thus, I think you’ve got a bug in your Vine Server 2.0.

In case it helps, here is the OSXvnc-server.log when I use OSXvnc 1.71 with my dyndns.com host name xxx.getmyip.com, right up through my clicking the Add button (slightly edited to remove my identifying info using capital “X” characters):

2006-11-11 13:07:54 -0500 Starting OSXvnc Version 1.71
-rfbport 5901 -desktop martin (martins-powerbook-g4.local) -dontdisconnect -restartonuserswitch N -keyboardLoading N -pressModsForKeys N -swapButtons -rendezvous Y -rfbauth /Applications/VNC/OSXvnc 1.71.app/.osxvncauth

2006-11-11 13:07:54.894 OSXvnc-server[315] Arguments: -rfbport 5901 -desktop martin (martins-powerbook-g4.local) -dontdisconnect -restartonuserswitch N -keyboardLoading N -pressModsForKeys N -swapButtons -rendezvous Y -rfbauth /Applications/VNC/OSXvnc 1.71.app/.osxvncauth
2006-11-11 13:07:54.934 OSXvnc-server[315] Main Bundle: /Applications/VNC/OSXvnc 1.71.app
2006-11-11 13:07:54.937 OSXvnc-server[315] Loading Bundle /Applications/VNC/OSXvnc 1.71.app/Contents/Resources/JaguarBundle.bundle
2006-11-11 13:07:54.967 OSXvnc-server[315] Keyboard Loading - Disabled
2006-11-11 13:07:54.967 OSXvnc-server[315] Press Modifiers For Character - Disabled
2006-11-11 13:07:54.977 OSXvnc-server[315] Running in Big Endian
2006-11-11 13:07:54.992 OSXvnc-server[315] Waiting for clients
2006-11-11 13:07:55.009 OSXvnc-server[315] Registering Rendezvous Service(_rfb._tcp.) - martin (martins-powerbook-g4.local)
2006-11-11 13:07:55.009 OSXvnc-server[315] Rendezvous(_vnc._tcp) - Disabled
2006-11-11 13:07:55.012 OSXvnc-server[315] IPv6: Started Listener Thread on port 5901
2006-11-11 13:07:55.012 OSXvnc-server[315] Started Listener Thread on port 5901
[I clicked “Add”]
2006-11-11 13:08:11.841 OSXvnc-server[315] Connecting VNC Client XX.getmyip.com(5500)
2006-11-11 13:08:11.893 OSXvnc-server[315] Protocol version 3.3
2006-11-11 13:08:11.893 OSXvnc-server[315] Ignoring minor version mismatch
2006-11-11 13:08:11.936 OSXvnc-server[315] Pixel format for client XX.XX.XX.XX:
2006-11-11 13:08:11.936 OSXvnc-server[315] 8 bpp, depth 8
2006-11-11 13:08:11.936 OSXvnc-server[315] true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
2006-11-11 13:08:11.936 OSXvnc-server[315] ENCODING: ZRLE for client XX.XX.XX.XX
2006-11-11 13:08:11.937 OSXvnc-server[315] Client Connected - Registering Screen Update Notification

And here is the OSXvnc-server.log when I try Vine Server 2.0 with my dyndns.com host name “xxx.getmyip.com”:

2006-11-11 13:15:55 -0500 Starting Vine Server Version 2.0
-rfbport 5901 -desktop martin (martins-powerbook-g4.local) -dontdisconnect -restartonuserswitch N -keyboardLoading N -pressModsForKeys N -swapButtons -rendezvous Y -rfbauth /Applications/VNC/Vine Server 2.0.app/.osxvncauth

2006-11-11 13:15:55.434 OSXvnc-server[331] Arguments: -rfbport 5901 -desktop martin (martins-powerbook-g4.local) -dontdisconnect -restartonuserswitch N -keyboardLoading N -pressModsForKeys N -swapButtons -rendezvous Y -rfbauth /Applications/VNC/Vine Server 2.0.app/.osxvncauth
2006-11-11 13:15:55.467 OSXvnc-server[331] Main Bundle: /Applications/VNC/Vine Server 2.0.app
2006-11-11 13:15:55.470 OSXvnc-server[331] Loading Bundle /Applications/VNC/Vine Server 2.0.app/Contents/Resources/JaguarBundle.bundle
2006-11-11 13:15:55.476 OSXvnc-server[331] Keyboard Loading - Disabled
2006-11-11 13:15:55.476 OSXvnc-server[331] Press Modifiers For Character - Disabled
2006-11-11 13:15:55.484 OSXvnc-server[331] Running in Big Endian
2006-11-11 13:15:55.490 OSXvnc-server[331] Registering Rendezvous Service(_rfb._tcp.) - martin (martins-powerbook-g4.local)
2006-11-11 13:15:55.491 OSXvnc-server[331] Rendezvous(_vnc._tcp) - Disabled
2006-11-11 13:15:55.494 OSXvnc-server[331] IPv6: Started Listener Thread on port 5901
2006-11-11 13:15:55.494 OSXvnc-server[331] Waiting for clients
2006-11-11 13:15:55.494 OSXvnc-server[331] Started Listener Thread on port 5901
[I clicked “Connect”]
2006-11-11 13:16:07.718 OSXvnc-server[331] Connecting VNC Client XX.getmyip.com(5500)
2006-11-11 13:16:07.720 OSXvnc-server[331] Error resolving reverse host XX.getmyip.com
2006-11-11 13:16:07.751 OSXvnc-server[331] Waiting for clients

Clearly, OSXvnc 1.71 is able to resolve XX.getmyip.com to an actual IP address, but for some reason Vine Server 2.0 fails to do so (“Error resolving reverse host XX.getmyip.com”).

For comparison, here is the OSXvnc-server.log when I try Vine Server 2.0 and type in my actual IP address:

2006-11-11 13:19:36 -0500 Starting Vine Server Version 2.0
-rfbport 5901 -desktop martin (martins-powerbook-g4.local) -dontdisconnect -restartonuserswitch N -keyboardLoading N -pressModsForKeys N -swapButtons -rendezvous Y -rfbauth /Applications/VNC/Vine Server 2.0.app/.osxvncauth

2006-11-11 13:19:36.924 OSXvnc-server[335] Arguments: -rfbport 5901 -desktop martin (martins-powerbook-g4.local) -dontdisconnect -restartonuserswitch N -keyboardLoading N -pressModsForKeys N -swapButtons -rendezvous Y -rfbauth /Applications/VNC/Vine Server 2.0.app/.osxvncauth
2006-11-11 13:19:36.962 OSXvnc-server[335] Main Bundle: /Applications/VNC/Vine Server 2.0.app
2006-11-11 13:19:36.965 OSXvnc-server[335] Loading Bundle /Applications/VNC/Vine Server 2.0.app/Contents/Resources/JaguarBundle.bundle
2006-11-11 13:19:36.969 OSXvnc-server[335] Keyboard Loading - Disabled
2006-11-11 13:19:36.969 OSXvnc-server[335] Press Modifiers For Character - Disabled
2006-11-11 13:19:36.976 OSXvnc-server[335] Running in Big Endian
2006-11-11 13:19:36.982 OSXvnc-server[335] Registering Rendezvous Service(_rfb._tcp.) - martin (martins-powerbook-g4.local)
2006-11-11 13:19:36.982 OSXvnc-server[335] Rendezvous(_vnc._tcp) - Disabled
2006-11-11 13:19:36.986 OSXvnc-server[335] IPv6: Started Listener Thread on port 5901
2006-11-11 13:19:36.987 OSXvnc-server[335] Waiting for clients
2006-11-11 13:19:36.987 OSXvnc-server[335] Started Listener Thread on port 5901
[I clicked “Connect”]
2006-11-11 13:19:53.763 OSXvnc-server[335] Connecting VNC Client XX.XX.XX.XX(5500)
2006-11-11 13:19:53.789 OSXvnc-server[335] Protocol version 3.3
2006-11-11 13:19:53.789 OSXvnc-server[335] Ignoring minor version mismatch
2006-11-11 13:19:53.848 OSXvnc-server[335] Pixel format for client XX.XX.XX.XX:
2006-11-11 13:19:53.849 OSXvnc-server[335] 8 bpp, depth 8
2006-11-11 13:19:53.849 OSXvnc-server[335] true colour: max r 7 g 7 b 3, shift r 0 g 3 b 6
2006-11-11 13:19:53.849 OSXvnc-server[335] ENCODING: ZRLE for client XX.XX.XX.XX
2006-11-11 13:19:53.850 OSXvnc-server[335] Client Connected - Registering Screen Update Notification

and a VNC window opened in my “listening” VNC Viewer.

Thanks for looking into this problem. For the moment I will stick with OSXvnc 1.71.

Regards,

Martin

Glad you were able to get that working and thank you very much for your report.

I can confirm that there is a bug resolving named entries for the reverse connection in Vine Server 2.0. That bug and a few others are resolved in a forthcoming maintenance release.

Here is how to do what you want

open applscript editor

enter the following:

do shell script "’/Applications/Vine\ Server.app/OSXvnc-server’ -connectHost xxx.getme.com

save this as an app not as a script.

Voila. you can now mail this to your freind. when they double click it the server will start the reverse connection to xxx.getme.com

pluto,

I tried your suggestion, but I am getting an error using the command line -connectHost option, it works with an ip address, but still fails with a hostname. I get “Error resolving reverse host”. Seems like this error has crept back into the code. Release notes say it was resolved back at version 2.1

Using Vine Server version 4.01, OSX 10.8.2

To get around this problem, just do a quick IP translation.
So my script reads:

#!/bin/sh
ip=/sbin/ping -c 1 YOURSERVER | /usr/bin/awk 'BEGIN{FS="[()]"};{print $2}'
/Applications/VineServer/OSXvnc-server -connectHost $ip

Hth,
-Lyle