[K12OSN] TeacherTool VncReflector Success!!

Robert Arkiletian robark at telus.net
Sat Nov 20 07:32:27 UTC 2004


David Trask wrote:

>Actually if you can...document what you did and I'll add it to the how-to
>with credit to you (of course) that way we can all benenfit.  :-)
>  
>
Okay first my server runs 3.1.2 (rh9). Here it goes:

I will add info to the "how-to" all my input will be inside 
================= lines


VNC Reflector How-To


By David Trask

Vassalboro Community School

Vassalboro, Maine, USA

dtrask at vcs.u52.k12.me.us <mailto:dtrask at vcs.u52.k12.me.us>



What this document is and is not.


This document is basically a write up of exactly what I did in my own 
situation to enable vncreflector on my own K12LTSP network. As far as I 
know for the most part it is adaptable to nearly any situation. 
VNCreflector acts as a proxy for vnc and allows multiple users to 
connect to a single instance of vnc. The beauty of the setup outlined 
here is that we will have a “full control mode” and a “read only” mode. 
This enables the teacher to have full control for the demo and the 
students can only watch. Understand this...unlike many other remote demo 
programs such as Apple's Remote Desktop, Vision, and a host of others 
where the students are watching what you do on your own desktop...you 
will instead be launching another desktop or “session” on top of your 
current “session”. This is nice since you can have a “demo only” 
account. In this document we will use a user called vncuser. This user 
is the “demo” account. When I want to demo something to my kids....I log 
in as myself....launch the vncreflector (watchteacher) and then log in 
as vncuser in the “new window”. I have changed the desktop background 
for vncuser to be an obnoxious red background tiled with the work “DEMO” 
to let the kids know just what they are watching. This document also 
assumes that you are running vncserver with K12LTSP using the default 
settings.... localhost:1. Anyway...let's get started.



===================================
One question that might come up is what password do you use when you add 
the user "vncuser". Answer is anything (for example "banana"). But 
remember only the TEACHER logs into the vncuser account. The students 
just view it. So the students don't need to know the password for 
vncuser. This is nice since you can store demo files and code etc to 
teach with in the vncuser account. Available at your finger tips when 
you do demos.
===================================



Getting and installing vncreflector


First, the home page for vncreflector is located here 
http://sourceforge.net/projects/vnc-reflector/


Link to the current version (as of the writing of this document) is here 
http://prdownloads.sourceforge.net/vnc-reflector/vnc_reflector-1.2.4.tar.gz?download


Download and untar the vncreflector file

tar -xzvf vnc_reflector-1.2.4.tar.gz 
<http://prdownloads.sourceforge.net/vnc-reflector/vnc_reflector-1.2.4.tar.gz?download> 



then


]# cd vnc_reflector


then


]# make

this will make the executable file called vncreflector that you need. In 
fact, that's all you need. Now let's make a place to put it and copy it 
over there.


]# mkdir /vnc-reflector


then copy it over


]# cp vncreflector /vnc-reflector

<>
=================================
you don't need to be root to do these steps. Note: Don't worry there is 
no need to do a ./configure (which is very common) Also, I installed 
this into my own personal dir
=================================


Now...we need to create some files in the /vnc-reflector directory to 
tell vncreflector what to do. The first one is the HOST_INFO_FILE which 
tells vncreflector where the server is. So with your favorite text 
editor create (In /vnc-reflector) the file HOST_INFO_FILE and put in 
it...the following....


*localhost:1*

====================================
Not sure if this matters but I always hit return at the end of a line 
even if it's the last line in a script or whatever
=====================================



/**note – If you have a non-default vncserver set up you would also add 
the server password her as well (localhost:1 password)*/


that's it! Now on to the next file we need.... PASSWD_FILE. This file 
will contain 2 passwords...the top one will be the full control password 
(for the teacher)....the second will be the read only password (for the 
students to view the demo). So with your favorite text editor create (In 
/vnc-reflector) the file PASSWD_FILE and put in it...the following....


*fullcontrolpassword * (make up your own)

*readonlypassword* (again make up your own)


====================================
Don't actually copy *fullcontrolpassword and **readonlypassword*** which 
is what I did the first time I tried this. Fortunately David has the 
files online now so you can see his example
Fore example assume the passwords are

administrator
everyone

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


that's all that's in this file! Now let's create a file to launch all 
this stuff...using your text editor (pico, emacs, vi...whatever) create 
a file called *startreflector*

Now type the following into the file...(make sure this file is 
executable...you may need to change permissions)


*cd /vnc-reflector*

*./vncreflector -p PASSWD_FILE -i PID_FILE -l 5999 HOST_INFO_FILE
*

*
*

==========================================
I used the full path instead of cd /vnc-reflector
==========================================

This sets the listening port to 5999 on display 99...good default setup.


/*Note:* the PID_FILE argument is very useful as it will create a simple 
text file in the /vnc-reflector directory letting you know the process 
ID # thus allowing you to kill the reflector with ease should you need 
to. Let's say the pid is 4767....you can run kill -9 4767 to kill the 
vncreflector if needed./

============================================
DON'T forget to delete the PID_FILE if you kill the process. This is 
important because if you kill the reflector process and start it again 
without deleting the file you won't know the new process id to kill it 
again.

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



Setting up the server


We're assuming here that you already have vncserver installed as part of 
your K12LTSP installation. If not you need to install it. Use apt, yum, 
or the installation CD's. If you are not running K12LTSP...grab a copy 
of tightvnc from www.tightvnc.com <http://www.tightvnc.com/> and install 
it. Installation of the vncserver is beyond the scope of this how-to.


/*Note for non-default set up (all others ingnore this): To set up the 
password for the vncserver to match the one in the HOST_INFO_FILE 
(non-default) run:*/


/*]# vncpasswd*/

/*Password:*/

/*Verify:*/


/*This password MUST be the same as the one you put in HOST_INFO_FILE*/

/*You may also need to edit /etc/sysconfig/vncservers to reflect your 
settings.*/


Vncserver is usually not running by default. The easiest way to get it 
running is to use the menu item “System Settings” > “Server Settings” > 
“Services” then find vncserver and start it....if you wish...save the 
settings so it will start everytime you boot the server.

===================================
Note: there are 2 services. One says "vnc" the other says "vncserver". I 
never could get vnc to run (it was greyed out) as it kept saying xinetd 
needed to be running. But I could see below it WAS running. However I 
did start vncserver and it said "successful" but it still reported it as 
not running. Don't worry if it says "successfully started" it is. 
Remember to save as David writes.
==================================


Setting up the Client


We need to set up a password file to run for the students viewer. We 
will create a file in /usr/local/share called passwd. This password 
needs to be set to the “read only” password that you put into 
PASSWD_FILE. Run the following:


*]# vncpasswd /usr/local/share/passwd*

*Password:*

*Verify:*

===============================
Okay this should be "everyone" in our case
===============================


Be sure to change the permissions on this file....I have mine set for 755.

*chmod 755 /usr/local/share/passwd*


Starting the vncreflector


Once the vncserver is started you can now run the file we created called 
“startreflector”


*cd /vnc-reflector *

============================
or wherever you put the vncreflector binary and startreflector script
============================

then


*./startreflector *


Running the Teacher Mode


To connect to the reflector as the teacher run:


]# vncviewer localhost:99

Password: (enter the full control password here)

<>


===========================================
The password here would be "administrator". Now once you view the login 
screen you can type vncuser and banana to login.
Now this is where TeacherTool comes in. I did not create a launcher for 
the students as below. I just launch TeacherTool and select who I wish 
to allow viewing of the demo. Then I click run and click "run vnc" so 
all selected students now see the vnc session I am connected to. But 
they have no input. Thank you David!!! Now go ahead and do your demo 
while they watch. A programming teachers dream. When finished students 
can just close the window. You the teacher on the other hand DON'T log 
out. I just close the vnc session with the X at top right corner of the 
window. That way it remains active so I can simply type # vncviewer 
localhost:99 the next time I want to do a demo. If you log out you have 
to kill the reflector process and re start it as David states below in 
yellow.

Well that's it for now.

Oh ya I had to install the following rpm's (#rpm -ivh 
___________________.rpm ) to be able to install the TeacherTool app

tk
itcl
tix
tkinter

All of these are in the repositories of k12ltsp.
However teachertool is not in the 3.1.2 repo so you have to get it from 
4.0.1 or above
ftp://k12linux.mesd.k12.or.us/pub/K12LTSP/
But if you have 4.0.1 or above you can just go #yum install teachertool


Robert Arkiletian
<>============================================

Running the Student (view only mode)


To have the students connect have them run (or better yet...simply 
create a menu item for them to click...more on that in a minute):


]# vncviewer -passwd /usr/local/share/passwd localhost:99


Now...let's be realistic...many of us don't want little kids on the 
command line...so let's create a file that we can execute as a menu item 
in IceWM or whatever. Using your favorite text editor...create a file in 
/usr/bin called watchteacher.sh This file should contain:


vncviewer -passwd /usr/local/share/passwd localhost:99


Save it and let's make another file also in /usr/bin called 
watchteacherdemo This file should contain:


#!/bin/sh

. watchteacher.sh


That's it! Make sure both of these files are executable (change 
permissions if necessary). Now you can use “watchteacherdemo” to make a 
menu item for the kids to click on.


One note of caution: Once you log on as vncuser in the demo window...do 
not log off....simply close the window. Logging off will force you to 
have to kill the vncreflector and start again....better to simply leave 
it logged in. Remember...the vncuser is not the same as a system 
user...so they will not show up in TeacherTool or any other similar 
program. I have found that killing the vncreflector (once you use the 
PID file and kill the reflector...be sure to delete the PID file so a 
new once can be written when you start it again) and stopping and 
starting the vncserver works best to reset everything.


*Thanks to:*

Donald Ellerich of Yorktown HS for his intial help with vncreflector

Nicholas Wheeler for taking a stab at it ;-)

Richard Melton for writing TeacherTool

Eric Harrison for making K12LTSP the awesome thing that it is

Jim McQuillan for making LTSP the awesome thing that it is...too

Everyone on the K12LTSP list for all their help past, present, and future

The Open Source community at large.





More information about the K12OSN mailing list