Desktop broadcast with vncreflector

From FBSD_tips

Jump to: navigation, search

DRAFT - INCOMPLETE

Contents

[edit] Rationale

Sharing applications live on the internet has become nearly commonplace for conducting many types of business today. Yet most of the services are proprietary and quite expensive, especially if used a lot. While this solution offers no bells and whistles, it does fulfill the basic function of broadcasting the desktop to several viewers, and allows control to be shared. This is a demonstration of the technique the building blocks are quite simple, and it is well within possibility to wrap them up in a more sophisticated (web?) system.

[edit] Set up

[edit] Server

[edit] Set up

I am setting the server up on FreeBSD only, other are possible.

Install vncreflector (I show the dependancies also)

> pkg_add -r vncreflector
> pkg_tree -v vncreflector-1.2.4_2
vncreflector-1.2.4_2
 \__ jpeg-6b_4

The reflector requires a port for the connection to the broadcaster (this can be a listening port or it can connect to the broadcaster) and a listening port for the viewers to connect to (like a normal viewer->server connection).

Make a password file, 1st line is the write pasword, 2nd is the read. These will be used to challenge the viewers connecting to the reflector.

vnc_passwords.txt:

write
readonly

Make a host configuration file, '*' means listen for incoming requests (a host name means make an outgoing request to a VNC server), 5598 is the port to use to communicate with the broadcaster and 'testpass' is the password that the broadcaster will need to connect.

host_info_file:

*:5598 testpass

[edit] Running

Start the reflector using the passwords and host files detailed above, and with the pid file argument (-p) :

vncreflector -p vnc_passwords.txt -i vncref.pid host_info_file

You can tail() the log file :

tail -f reflector.log

[edit] Broadcasters

[edit] Windows

[edit] FreeBSD

Install x11vnc.

> pg_add -r x11vnc

X11vnc has a TON of options and is very flexible. One of my favorite options on it is the "only control / view one window". This is where you pass it the window ID of an X windowand it set the viewport to that window's dimensions. Like so :

> xwininfo | grep "Window id"
xwininfo: Window id: 0x2000005 "Shell - Konsole"
>  x11vnc -id 0x2000005
...<snip>...
The VNC desktop is:      test1.khome.utcorp.net.:0
PORT=5900

Now you can 'attach to the window, but we want to broadcast it to the listening reflector so :

 x11vnc -id 0x2000005 -connect dmz2:5598

[edit] Viewers

This is the simple part, the viewers 'sees' nothing special over a normal vnc server.

[edit] Windows

[edit] FreeBSD

Run your preferred VNC client pointed at the reflector's client listening port :

vncviewer dmz2:5599

[edit] Example of use

[edit] Discussion

Gongo 22:55, 25 December 2007 (UTC)

Personal tools