Squeak and VNC
Last updated at 9:02 pm UTC on 10 August 2017
http://www.squeaksource.com/RFB (Remote Framebuffer Protocol)
See class comment of class RFBServer for documentation.
VNC is a protocol for remote display (and control) of an X-Windows / Win / Mac desktop. So why not use it to control your Squeak desktop as well? This would be ideal for
- remote administration of a Swiki
- teaching, as VNC allows multiple users to share a session
- embedded Squeak (Squeak in your CD player, anyone?)
The software consists of two parts: the VNC server (keeps your desktop, and sends update information on request) and the viewer for displaying the desktop. VNC viewers are available for many platforms: (Mac, Windows, Unix, Java, even Win CE). Using the Java client, you can control your desktop using any Java-enabled Web-browser.
The server recognizes changes on the desktop and sends bitmaps with these changes to the client(s).
The home page for VNC is at http://realvnc.com/.
How to use Squeak via VNC
Rough notes from #squeak:
gokr: you can fire up a VNC.
gokr: Squeak works fine with VNC.
gokr: But then again - you built it headless...
water: yeah, he'll have to build an image on a headed vm
water: and send it to where the headless vm is, and run it there
gokr: Yup. Or do it all "in a dark room".
sm: no I built it headed.. just running it with -headless
water: which should be avoided until you have a lot of experience with headless work
water: oh, ok
sm: accidental.. but that's what I did
water: yeah just run it normally with remote-X or VNC
gokr: Good then. Install vnc, start the vnc with "vncserver -cc 3" and off you go.
gokr: Familiar with VNC?
sm: I've used it.. I'm not sure how it will work here, yet
sm: will squeak think X is running ?
sm: and did you mean install vnc locally, on server, or in squeak image ?
gokr: The "-cc 3" is needed though.
gokr: You install the vnc server part on the machine with no X.
gokr: Fire it up - this will start an X server that Squeak will think is a fine X display.
gokr: Then you connect to that from another machine using the vncviewer.
gokr: But just so you know - you don't need any vnc package to get it working. It is just that people have implemented the vnc protocol in Squeak too.
water: oh, right
sm: gokr: I don't understand what you just said
sm: ie there's a vnc server which could run in squeak ?
gokr: Think so. Have never tried it.
water: yes there is
water: it's not too shabby
water: but not designed for what you're doing
sm: ok.. so I could install that and connect vnc client directly to squeak
water: i don't know
water: but i suggest you take goran's advice
water: since that's more reliable
sm: but for now I'll be connecting to a standalone vnc server, which will act as X server to squeak
VNC package on Squeakmap: http://map1.squeakfoundation.org/sm/packagebyname/vnc
The RemoteFrameBuffer package (aka VNC) is now here (link changed due to an update of SqueakMap?): http://map1.squeakfoundation.org/sm/package/d4f692a8-c7fa-4d49-927f-74aba7e8fd83
More on VNC setup, for running squeak on a hosted server account
My server is a freebsd jail. I previously built squeak there - full squeak, not headless - after installing the necessary X11 libraries from ports (I think now I could have installed a package).
Today I installed vnc and the X11 clients via packages. Mark Schwenk said:
mschwenk: I'm not sure what the default scripts do there. But basically to start one up by hand requires the following...
Error: this should not happensm listens
mschwenk: you need to figure out a user to run as. LIke yourself or a new user, say "squeak"
mschwenk: then login as that user. Create a .vnc directory in their home.
mschwenk: then change into that directory and run vncpasswd to create a password for that user.
mschwenk: You should then be able to connect to that desktop by using your vncclient to connect to hostname:1
mschwenk: assuming no firewalls, etc.
mschwenk: It's best not to leave open for general access, so firewall based on ip is one option. Or use ssh to tunnel your connection to your box via ss.
I did the vncpasswd thing. Next, (all as the squeak user) I ran "vncserver" and it set up a default xstartup for me. I think I then had to run it a second time, before seeing an Xvnc process running. My host is now listening for VNC connections.
On my local machine, I installed a VNC client. On debian gnu/linux, that goes like this:
apt-get install xvncviewer
got me a password prompt and the X desktop! It seemed necessary to specify the port, perhaps debian and freebsd disagree on the default.
Using this, I ftp'd the latest squeak image and sources and unpacked them in /home/squeak, then ran squeak. Hurrah! Server squeak, displaying on my local desktop.
You can connect with a vnc client on port 5901, or java-enabled web browser on 5801.
Doing it more securely over SSH:
pr3d4t3ur: sm: You can also use SSH tunneling to connect to VNC. That's what I do to talk to my machines which aren't on-site.
sm: pr3d4t3ur: would you have a recipe handy ? I'd like to do this more securely
pr3d4t3ur: sm: Easy as cake, piece of pie. On your client, run SSH and tell it that you want to forward local port 5901 to the same port on the remote machine after you connect. Then you run VNC connecting to localhost:1 and that's it.
pr3d4t3ur: sm: How you tell SSH to forward is dependent on your SSH client. PuTTY does it from a dialog box, NIX normally over the command line.
sm: cool.. let me try
pr3d4t3ur: sm: So man ssh – I think the syntax is something like ssh -L5901:5901 -l pr3d4t3ur to.somehost.com
sm: so I quit the vnc viewer and fired it up again, and of course my x session is still thereError: this should not happensm giggles.. ignore me
This worked for me:
ssh -l squeak -L5901:serverhost:5901 serverhost
It seemed a bit slower, adding the -C options seemed to help (this is over a DSL connection). For more on this see http://www.uk.research.att.com/archive/vnc/sshvnc.html ,