Squeak Thin Jail
Earlier I wrote about setting up a FreeBSD thin jail to run simple_httpd, a very simple HTTP server.
Running Squeak in a thin jail isn't too much more work. Indeed, I simply reused the aforementioned jail set up for simple_httpd.
Squeak, as a Smalltalk implementation, comes with a powerful GUI development environment. On Unix, Squeak uses the X window system.
One may run Squeak headless, e.g., to power a Swiki. I don't just want to run a swiki; I may not run one, in fact. I want to play with Comanche, Swazoo, Seaside, etc. so I'd rather have access to the development environment.
But! I want to host Squeak in a thin jail and I don't want to install X into it...
VNC to the rescue! RemoteFrameBuffer is a VNC server and client written entirely in Squeak; the "server transmits (or broadcasts) the Squeak desktop to remote VNC clients (either running natively on Unix, Mac or Windows, or running the Squeak client included in this same package)." Aha!
The procedure:
» Install and invoke Squeak normally.
» Install RemoteFrameBuffer (RFB) into Squeak. Start the RFB server.
» Verify that the Squeak RFB server is running by connecting to it using a VNC client. Save the image; when prompted, do not stop the RFB server.
» Stop Squeak. (This step is optional.)
» Create the thin jail. Skip building simple_httpd if you wish.
» Copy the Squeak installation into the jail. In my case, the destination is /pkg/squeak36:
total 37442 -r--r--r-- 1 root wheel 14542313 Dec 30 17:52 SqueakV3.sources drwxr-xr-x 2 root wheel 512 Dec 30 17:52 plugins -r-xr-xr-x 1 root wheel 788624 Dec 30 17:52 squeak -rw-r--r-- 1 www www 10524871 Dec 30 23:22 squeak.changes -rw-r--r-- 1 www www 12382644 Dec 30 23:22 squeak.image ./plugins: total 40 -r-xr-xr-x 1 root wheel 28784 Dec 30 17:14 UnixOSProcessPlugin -r-xr-xr-x 1 root wheel 4316 Dec 30 17:14 vm-display-null -r-xr-xr-x 1 root wheel 3732 Dec 30 17:14 vm-sound-null
» Recall that simple_httpd needs no device special files. Squeak wants /dev/null. Create it:
# mknod /usr/jails/nano/dev/null c 2 2 root:wheel
» Fix up the jail's /etc/rc:
#!/bin/sh /usr/bin/su www -c \ "(cd /pkg/squeak36; ./squeak -plugins plugins -nodisplay -nosound &)"
» The jail is still known as nano. Start it up:
# jailadmin start nano Starting server nano... # jailadmin status nano Server: nano USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND www 1866 33.6 6.3 1050692 16256 p1 SJ 4:54PM 0:01.04 ./squeak -plugins plugins -nodisplay -nosound #
» Connect to the jail using your VNC client again to verify that Squeak is still accessible.