Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://twitter.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Stable ChunkVNC Repeater - Perl Script

Simple, Free, Open Source UltraVNC Wrapper Supporting Windows and Mac OSX
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Stable ChunkVNC Repeater - Perl Script

Post by B »

I must be dense this week, Rat. I was talking about port forwarding AT THE HOSTING COMPANY for INBOUND connections to the repeaters we'd be running on our shared accounts. Because apparently HostGator, at least, does NOT have all inbound ports available for its hosting clients. I assume that "outgoing connections" from the shared server (repeater) for the most part are unfiltered, just as outbound connections would be unfiltered emanating from behind a NAT router... ?

And your self-quote is the reason I asked about your later test ("I just tested it on a completely unrelated shared hosting environment and it ran fine.."). I interpreted that as being a test on a hoster you do NOT control, and was wondering how the port forwarding worked out. Maybe you just meant it was another hosting account on your company servers, and you were still able to control the inbound port forwarding appropriately?

My understanding is that, no matter what, repeaters running on both myserver.hostco.com and yourserver.hostco.com need unique listening ports reserved (two each), and that VNC clients and servers can ONLY specific a host name / IP address + port number, NOT a directory path? Is that accurate?
Rat
80
80
Posts: 182
Joined: 2004-11-01 02:11

Re: Stable ChunkVNC Repeater - Perl Script

Post by Rat »

I must be dense this week, Rat. I was talking about port forwarding AT THE HOSTING COMPANY for INBOUND connections to the repeaters we'd be running on our shared accounts. Because apparently HostGator, at least, does NOT have all inbound ports available for its hosting clients. I assume that "outgoing connections" from the shared server (repeater) for the most part are unfiltered, just as outbound connections would be unfiltered emanating from behind a NAT router... ?
Hmm.. I guess I was thinking outbound since this is the usual routing problem facing net admins when setting up services inside their own LAN. Of course the hosting company can block anything in any direction if they wish. (although the one I tried didn't)
And your self-quote is the reason I asked about your later test ("I just tested it on a completely unrelated shared hosting environment and it ran fine.."). I interpreted that as being a test on a hoster you do NOT control, and was wondering how the port forwarding worked out. Maybe you just meant it was another hosting account on your company servers, and you were still able to control the inbound port forwarding appropriately?
Nope completely unrelated server on a different commercial host in a different continent, (same planet).
My understanding is that, no matter what, repeaters running on both myserver.hostco.com and yourserver.hostco.com need unique listening ports reserved (two each), and that VNC clients and servers can ONLY specific a host name / IP address + port number, NOT a directory path? Is that accurate?
All Correct
KyferEz
8
8
Posts: 14
Joined: 2011-04-12 14:47

Re: Stable ChunkVNC Repeater - Perl Script

Post by KyferEz »

supercoe wrote:I guess I just don't see big deal with setting it up in Linux?
Maybe I should write up a guide but I simply purchased a cheap Linux VPS, used wget to download Karls repeater and ran it with perl. :)
The problem is I don't want to pay for multiple servers. If I get an unmanaged VPS, then I might as well use it to host all my customer websites too, but I don't know how to do all that... I guess I could, but I've decided to go a different route. It will cost a small amount of money, but I think it will be worth it not to have to manage everything and offers lots of features; I already have too much work and not enough time... Hopefully it stays that way ;)
adrianio
Posts: 6
Joined: 2011-05-21 10:20

Re: Stable ChunkVNC Repeater - Perl Script

Post by adrianio »

Hello!

I like the ultravnc_repeater.pl perl script and what it can do. I install it on an Asus WL500GPv2 router with DD-WRT firmware and optware packages installed on a USB stick.
So, it works like a charm, and I really need this functionality on my router :).
I post here the start-up script I have made. It is made for sh command shell, but it can be tailored easy to suit your needs.

Code: Select all

#!/bin/sh

# Enter here path to ramfs file system
# The PID file will be moved there
# The script will create the PID file on start and delete it on stop
# In case of power failure PID file will be lost from ram
# And the program will be safely started

tmp_fs=/tmp/var/run
pidfile=repeater.pid
friendly_prog_name="UltraVNC repeater"
prog_path=/opt/etc/uvnc
prog_name=ultravnc_repeater.pl
log_path=/opt/etc/uvnc
log_name=repeater.log
prog_opt="-L BG -r -p ${pidfile} -l ${log_name}"

start() {

if [ -e ${tmp_fs}/${pidfile} ]; then
                        echo "... ${friendly_prog_name} already started?"
                        echo "If you are sure that ${friendly_prog_name} is not running, delete ${tmp_fs}/${pidfile}"
                        exit 1
fi

# start program with options
${prog_path}/${prog_name} ${prog_opt}
# move pidfile in ram drive
mv ${prog_path}/${pidfile} ${tmp_fs}/${pidfile}

echo "${friendly_prog_name} has been started!"
echo "Command line used for start:"
echo "${prog_path}/${prog_name} ${prog_opt}"

}

stop()  {
if [ -e ${tmp_fs}/${pidfile} ]; then
	kill `cat ${tmp_fs}/${pidfile}`
	echo "Process ${friendly_prog_name} with PID: `cat ${tmp_fs}/${pidfile}` has been stopped!"
	rm ${tmp_fs}/${pidfile}
	else
	echo "${friendly_prog_name} is not running"
fi
}

restart()  {
stop
start
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart|reload)
	restart
	;;
   *)
	echo "Usage: $0 {start|stop|restart}"
	exit 1
	;;
esac
exit $?
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by supercoe »

Great stuff, thanks adrianio. :)
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
adrianio
Posts: 6
Joined: 2011-05-21 10:20

Re: Stable ChunkVNC Repeater - Perl Script

Post by adrianio »

It is happened that, often I read this on log file:
Wed May 25 23:46:24 2011: new vnc client connecting.
Wed May 25 23:46:24 2011: ultravnc_repeater: short read 0 != 250
Wed May 25 23:46:24 2011: new vnc client connecting.
Wed May 25 23:46:25 2011: ultravnc_repeater: short read 12 != 250
Thu May 26 00:15:16 2011: new vnc client connecting.
Thu May 26 00:15:16 2011: ultravnc_repeater: short read 0 != 250
Thu May 26 00:15:16 2011: new vnc client connecting.
Thu May 26 00:15:17 2011: ultravnc_repeater: short read 12 != 250
Thu May 26 01:46:58 2011: new vnc client connecting.
I connect to the server through repeater without any problem.
But, what this could be?
Rat
80
80
Posts: 182
Joined: 2004-11-01 02:11

Re: Stable ChunkVNC Repeater - Perl Script

Post by Rat »

adrianio wrote:It is happened that, often I read this on log file:
Wed May 25 23:46:24 2011: new vnc client connecting.
Wed May 25 23:46:24 2011: ultravnc_repeater: short read 0 != 250
Wed May 25 23:46:24 2011: new vnc client connecting.
Wed May 25 23:46:25 2011: ultravnc_repeater: short read 12 != 250
Thu May 26 00:15:16 2011: new vnc client connecting.
Thu May 26 00:15:16 2011: ultravnc_repeater: short read 0 != 250
Thu May 26 00:15:16 2011: new vnc client connecting.
Thu May 26 00:15:17 2011: ultravnc_repeater: short read 12 != 250
Thu May 26 01:46:58 2011: new vnc client connecting.
I connect to the server through repeater without any problem.
But, what this could be?
This means that the socket read buffer was not full but the "sysread" call returned normally and did not trigger an alarm timeout. The script will continue looping, so this is not regarded as a fatal error.
Last edited by Rat on 2011-05-27 01:24, edited 1 time in total.
Rat
80
80
Posts: 182
Joined: 2004-11-01 02:11

Re: Stable ChunkVNC Repeater - Perl Script

Post by Rat »

There's a new release of the Perl Repeater script available for download from here.

The following changes have been made:
1. IP Address Logging has been added for both the client and server connections.
2. An explicit call to the Perl interpreter has been added to the "exec" command call when in looping mode. (Some system configurations required this.)
adrianio
Posts: 6
Joined: 2011-05-21 10:20

Re: Stable ChunkVNC Repeater - Perl Script

Post by adrianio »

Rat wrote:There's a new release of the Perl Repeater script available for download from here.

The following changes have been made:
1. IP Address Logging has been added for both the client and server connections.
2. An explicit call to the Perl interpreter has been added to the "exec" command call when in looping mode. (Some system configurations required this.)
This new script does not work on my DD-WRT :(
By the other way, when fork in background, perl script make a new pidfile in script directory (it fork in background after closing one successful vnc connection). I want pidfile to be in ramdrive, I move it there with start script, but, after forking in background ... I lose it from ramdrive.
So, I think there must be an option in perl script to choose pidfile directory.
Rat
80
80
Posts: 182
Joined: 2004-11-01 02:11

Re: Stable ChunkVNC Repeater - Perl Script

Post by Rat »

adrianio wrote:This new script does not work on my DD-WRT :(
Did the old one?
adrianio wrote:By the other way, when fork in background, perl script make a new pidfile in script directory (it fork in background after closing one successful vnc connection).
Really? It should fork immediately the script is executed with the correct arguments. Can you provide me with the command-line you are using to launch the script please? I have several DD-WRT systems here I can test it on.
adrianio wrote:I want pidfile to be in ramdrive, I move it there with start script, but, after forking in background ... I lose it from ramdrive.
So, I think there must be an option in perl script to choose pidfile directory.
The PID file is created once the application is properly launched, (either into the background or otherwise), and is "chained" into the application directory by design, since Karl Runge regarded the ability to write the PID file anywhere as a potential security risk. The PID file name extension is also restricted to ".pid" for the same reason. Please read items 7 and 8 in the Changes List.
adrianio
Posts: 6
Joined: 2011-05-21 10:20

Re: Stable ChunkVNC Repeater - Perl Script

Post by adrianio »

I use the following command-line to start ultravnc_repeater.pl script:
ultravncrepeater -L BG -r -p repeater.pid -l repeater.log

For your security considerations I modified the start script above and now, this is:

Code: Select all

#!/opt/bin/bash
ultravncrepeater -L BG -r -p repeater.pid -l repeater.log
exit 0
Pretty simple, eh?
Try to test the version for download here, and see log. Try to use pidfile in a start up script. How will the script start in case of sistem power failure? The pidfile will be in its place! Start up and stop script could be made without the pidfile with pkill or pgrep command, so pidfile will have no sense!!!
After that, try previous version (if you have it anymore...if not I give it to you)
Security considerations are for the case when we want to run perl script as cgi from web interface. But, how when the case we want to run it as standalone server?(I think most of us want this script to run as standalone server).
Rat
80
80
Posts: 182
Joined: 2004-11-01 02:11

Re: Stable ChunkVNC Repeater - Perl Script

Post by Rat »

adrianio wrote:I use the following command-line to start ultravnc_repeater.pl script:
ultravncrepeater -L BG -r -p repeater.pid -l repeater.log

For your security considerations I modified the start script above and now, this is:

Code: Select all

#!/opt/bin/bash
ultravncrepeater -L BG -r -p repeater.pid -l repeater.log
exit 0
Note: "-p repeater.pid -l repeater.log" are the default values so you don't need to include them in your command line.
adrianio wrote:Pretty simple, eh?
Try to test the version for download here, and see log. Try to use pidfile in a start up script. How will the script start in case of sistem power failure? The pidfile will be in its place! Start up and stop script could be made without the pidfile with pkill or pgrep command, so pidfile will have no sense!!!
After that, try previous version (if you have it anymore...if not I give it to you)
Security considerations are for the case when we want to run perl script as cgi from web interface. But, how when the case we want to run it as standalone server?(I think most of us want this script to run as standalone server).
Ummm.... I'm really sorry Adrianio, but I didn't understand any of that paragraph? I should point out though that you are encouraged to make modifications to the script to suit your needs, (thats why I publish the source code).
lupick
8
8
Posts: 16
Joined: 2007-01-27 08:53

Re: Stable ChunkVNC Repeater - Perl Script

Post by lupick »

If I try to launch the perl repeater I've the following error:

: No such file or directory


I'm already using othe perl script without problem.....

thank you

L.
Rat
80
80
Posts: 182
Joined: 2004-11-01 02:11

Re: Stable ChunkVNC Repeater - Perl Script

Post by Rat »

lupick wrote:If I try to launch the perl repeater I've the following error:

: No such file or directory
Can you post your command line here thanks?

lupick wrote:I'm already using othe perl script without problem.....
What other Perl script?
olegmik
Posts: 1
Joined: 2011-06-29 12:27

Re: Stable ChunkVNC Repeater - Perl Script

Post by olegmik »

lupick wrote:If I try to launch the perl repeater I've the following error:

: No such file or directory


I'm already using othe perl script without problem.....

thank you

L.
Problem in the line break or end-of-line character.
I replaced the "CRLF" to "LF" in the file it helped.
Sorry for my english :oops:
lns
8
8
Posts: 12
Joined: 2011-07-05 23:04

Re: Stable ChunkVNC Repeater - Perl Script

Post by lns »

I can't believe I had this problem and had this post up on my other computer, unknowingly...and figured it out on my own ;)

It would be good to convert this Perl script to Unix format (dos2unix) before uploading it so us *nix users don't have the issue of ":No such file or directory" =)

I'm loving this repeater!! Thank you all so much for it!! =)


olegmik wrote:
lupick wrote:If I try to launch the perl repeater I've the following error:

: No such file or directory


I'm already using othe perl script without problem.....

thank you

L.
Problem in the line break or end-of-line character.
I replaced the "CRLF" to "LF" in the file it helped.
Sorry for my english :oops:
hbanko
Posts: 3
Joined: 2011-07-22 03:33
Location: Kuala Lumpur, Malaysia
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by hbanko »

My small company took over some customers from another company. They have been running Teamviewer. Certainly not a bad solution but to expensive for my taste!

So I thought it could be possible to build up a similar functionailty with UVNC and Chunkrepeater. From one Viewer to one Host this worked already for me, but I wonder is it possible to have multiple IDs to connect to the repeater at the same time?

To have the same functionality with TV, all the computers on site, would need a UVNC installation as service and connect immediately after boot to the repeater?

Am I right, or is it that way just impossible?
Rat
80
80
Posts: 182
Joined: 2004-11-01 02:11

Re: Stable ChunkVNC Repeater - Perl Script

Post by Rat »

I wonder is it possible to have multiple IDs to connect to the repeater at the same time?
Possibly. I routinely make concurrent multiple connections on the same Perl repeater with different IDs from the same Client and Server IP addresses. I can't recall if I've ever concurrently connected between multiple different Client and Server IP addresses... I will see if I can test this next week.

Also if you want a heavily customised/branded solution, you may want to have a look at my ChunkVNC "Fork". There are several screenshot examples there including a customised release that provides a list of technicians to choose from. All of these require only simple configuration changes to implement.
hbanko
Posts: 3
Joined: 2011-07-22 03:33
Location: Kuala Lumpur, Malaysia
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by hbanko »

Thank you, looks very interesting. It seems similar to SC. I will ask questions in the related thread :-)
lns
8
8
Posts: 12
Joined: 2011-07-05 23:04

Re: Stable ChunkVNC Repeater - Perl Script

Post by lns »

Just a quick question, does the Perl repeater support encryption? I'm pretty sure it doesn't, but wanted to make sure. I've tried running ChunkVNC but it fails on the connection, both when the perl repeater is using '-R' and without. No dice.

If no, how difficult is it to incorporate it? This is something I'd love to help with, as I'd rather not run the Windows repeater under Wine, and I'm definitely not going to run a dedicated VM just for the repeater ;)


Cheers,
Jordan
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by supercoe »

The repeater is just a general purpose TCP rendezvous device, it doesn't care if the data going through it is encrypted.

What is the command line string when starting the perl repeater?
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
lns
8
8
Posts: 12
Joined: 2011-07-05 23:04

Re: Stable ChunkVNC Repeater - Perl Script

Post by lns »

Got it - sorry, I can't believe I missed that the viewer port in the compile script for Chunk was 5901 and not 5900. :) Works a treat, thank you so much! GO LINUX! ;)
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by supercoe »

That's what I was hoping you were going to say. :)

Go ChunkVNC!
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
lns
8
8
Posts: 12
Joined: 2011-07-05 23:04

Re: Stable ChunkVNC Repeater - Perl Script

Post by lns »

Indeed go ChunkVNC! =)

I hope I'm not hijacking this thread at all btw. :) I'm now having issues running ChunkVNC viewer under Wine. I can run the VNC viewer directly, and it connects with the plugin and all perfectly. However, when I run the ChunkViewer.exe via Wine, it simply exits to my shell. There must be some coding that isn't compatible with Wine, but I'm not sure what (it seems like a simple enough wrapper!)

For now, I have a bash script that automates the connection. Hopefully this will be of help to someone else with my setup.

Code: Select all

#!/bin/bash
#
# *** Created 2011/08/24
# *** Jordan Erickson (logicalnetworking.net)

# Variables
WINE="/usr/bin/wine"							        	   # FULL PATH TO WINE BINARY
VNCVIEWER="/usr/local/bin/chunkvnc/Bin/vncviewer.exe"		   # FULL PATH TO VNC VIEWER BINARY
VNCPASSWORD="password"				                           # VNC PASSWORD
VNCREPEATER="CHANGEME"					  	   # VNC REPEATER IP/FQDN
REPEATERPORT="5900"								   # VNC REPEATER PORT NUMBER

clear
      echo -n "Enter VNC ID: "
      read VNCID
      $WINE $VNCVIEWER -proxy $VNCREPEATER:$REPEATERPORT ID:$VNCID -password $VNCPASSWORD

# EOF
...Or, for those who like pretty graphics.. ;) (Must have 'zenity' installed in Linux for this one to work, in Debian, 'apt-get install zenity'):

Code: Select all

#!/bin/bash
#
# *** Created 2011/08/24
# *** Jordan Erickson (logicalnetworking.net)

# Variables
# Variables
WINE="/usr/bin/wine"							        	   # FULL PATH TO WINE BINARY
VNCVIEWER="/usr/local/bin/chunkvnc/Bin/vncviewer.exe"		   # FULL PATH TO VNC VIEWER BINARY
VNCPASSWORD="password"				                           # VNC PASSWORD
VNCREPEATER="CHANGEME"					  	   # VNC REPEATER IP/FQDN
REPEATERPORT="5900"								   # VNC REPEATER PORT NUMBER
VNCID=$(zenity --title "uVNC Wrapper" --text="Enter the VNC ID:" --entry)

      $WINE $VNCVIEWER -proxy $VNCREPEATER:$REPEATERPORT ID:$VNCID -password $VNCPASSWORD

# EOF
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by supercoe »

Neat stuff, thanks for sharing.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
B
800
800
Posts: 2338
Joined: 2009-09-09 14:05

Re: Stable ChunkVNC Repeater - Perl Script

Post by B »

You know, since Chunk is just UltraVNC, you could probably run a Linux native VNC viewer such as ssvnc instead of thunking around with WINE. (ssvnc has UltraVNC repeater support.)

Not sure about the encryption issues though.
User avatar
rcooke
40
40
Posts: 98
Joined: 2011-02-19 13:06
Location: Toronto, Canada
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by rcooke »

Talk to me about Authentication.

As in, what is needed to make it work in the PERL script?
Regards,
Richard Cooke
Rat
80
80
Posts: 182
Joined: 2004-11-01 02:11

Re: Stable ChunkVNC Repeater - Perl Script

Post by Rat »

rcooke wrote:Talk to me about Authentication.
As in, what is needed to make it work in the PERL script?
Well since there is AFAIK, no authentication support in UltraVNC's Client or Server, this would need to be implemented separately in the AutoIT scripts wrapping them. The Perl repeater could then be modified to support this as well. It represents a significant amount of work and I don't currently have a requirement for it myself, (so my personal motivation levels are low :)). Since the client and server will only connect if they both know the same ID and the repeater won't do anything sensible if you try to connect to it from just one side, then perhaps authentication isn't really required in most cases?

Anybody else got any thoughts on this?
User avatar
rcooke
40
40
Posts: 98
Joined: 2011-02-19 13:06
Location: Toronto, Canada
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by rcooke »

@rat

I don't understand. There is a password in WinVNC.exe (ultravnc.ini) that I get asked for when I make a direct connection with vncviewer.exe. Why does that not happen through the repeater?
Regards,
Richard Cooke
User avatar
supercoe
400
400
Posts: 1732
Joined: 2009-07-20 21:27
Location: Walker, MN
Contact:

Re: Stable ChunkVNC Repeater - Perl Script

Post by supercoe »

Because the UltraVNC server is making a reverse connection to the repeater. If you need authentication you must use a plugin such as SecureVNC.
Remember the repeater is just a simply TCP rendezvous device, it does not support (unless you check out repeater 2011) any authentication.
http://www.chunkvnc.com - ChunkVNC - Free PC Remote control with the Open Source UltraVNC wrapper InstantSupport!
Post Reply