<div dir="ltr"><div dir="ltr">Oh.  I thought you said you had upgraded <a href="http://squeaksource.com" target="_blank">squeaksource.com</a> to utilize the new <a href="http://source.squeak.org/ss" target="_blank">source.squeak.org/ss</a> code, Personal SqueakSource.  Is that not the case?</div><div dir="ltr"><br></div><div>That code tackles this use-case from a 100% headless approach (no Morphs involved) by simply putting a "Smalltalk mitigateIfHeadless" as the first line within the Smalltalk run: [] block.</div><div><br></div><div>   Smalltalk run:</div><div>       [ Smalltalk mitigateIfHeadless.</div><div>       ... ]</div><div><br></div><div>Here's that method:</div><div>    ____</div><div>    mitigateIfHeadless<br>        self isHeadless ifTrue: [ self headlessMitigation ]<br></div><div>    ____</div><div>    headlessMitigation<br>        "If I'm headless and RFB is present, start an RFBServer on port identified by rfbPort."<br>        (Smalltalk classNamed: #RFBServer) ifNotNil:<br>            [ : rfbServer |<br>            rfbServer<br>                <font color="#0000ff">allowRemoteConnections: false ;  "<--- check this out"</font><br>                allowEmptyPasswords: true ;<br>                setFullPassword: nil ;<br>                setViewPassword: nil ;<br>                start: (self rfbPort ifNil: [ 5900 ])-5900 ]<br></div><div><br></div><div>By allowing only local connections (which is what Dave's ssh tunnel accomplishes -- even when the server is remote), the port is able to be left open all the time, so there's no need to signal the process, and no need to leave the server exposed even for 1 minute.</div><div><br></div><div>As you can see, this also allows multiple images on the same server to use different RFB ports / screens, instead of only 5901 / :1, by way of an "rfbPort" file.</div><div><br></div><div>A lot of work went into making Personal SqueakSource the most-thought-out, most-documented[1], easiest-to-setup, most-maintained and bug-free version of SqueakSource available.  All the fixes and workspace scripts from the old <a href="http://squeaksource.com" target="_blank">squeaksource.com</a> image were incorporated long ago.  I thought you had already switched over to it, Dave.  I believe community collaboration on a unified (vs. forked) code base for our SCM tool is beneficial.  Personal SqueakSource is also the only one able to provide class and method-level revision history for one's own private code.</div><div><br></div><div> - Chris</div><div><br></div><div>[1] -- <a href="https://wiki.squeak.org/squeak/6365" target="_blank">https://wiki.squeak.org/squeak/6365</a></div><div><br></div><div><br></div><div>On Sat, Dec 3, 2022 at 3:03 PM David T. Lewis <<a href="mailto:lewis@mail.msen.com" target="_blank">lewis@mail.msen.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">During a recent board discussion, Tim asked about experiences in using VNC<br>
to control server images. There are various ways to do this, but here is how<br>
it is done for the <a href="https://squeaksource.com" rel="noreferrer" target="_blank">https://squeaksource.com</a> server. The easiest way to see<br>
how it works is to try it out on your own computer, so here is what to do:<br>
<br>
- Start with a fresh Squeak image.<br>
- Open a Monticello Browser, and add repository <a href="http://source.squeak.org/ss" rel="noreferrer" target="_blank">http://source.squeak.org/ss</a>.<br>
- Open the repository and navigate to category update.sscom.<br>
- Select update.sscom-dtl.5.mcm and load it.<br>
<br>
When loading is complete, you will see a notifier saying that SqueakSource<br>
is running on port 8888, as well as a pinnable morph for controlling the<br>
RFBServer (for VNC connections).<br>
<br>
Pin the RFB control morph so that it stays active. If you close it by<br>
accident, do "RFBServer menu openInWorld" to get it back.<br>
<br>
Save the image once and restart it to make sure the startup initialization<br>
is working.<br>
<br>
You can now open a web browser on <a href="http://localhost:8888" rel="noreferrer" target="_blank">http://localhost:8888</a> to connect to<br>
the SqueakSource web interface. Only one account will be present in the<br>
repository, this is your administrative user with user name 'admin' and<br>
password 'password'. Changing that password (from the web interface) is<br>
a good idea.<br>
<br>
The following will work only on Unix/Linux/OSX:<br>
<br>
In the RFBServer menu, in the passwords menu, select "allow empty passwords"<br>
<br>
In a terminal window (outside of Squeak), identify the pid of the Squeak VM<br>
process (pgrep -l squeak).<br>
<br>
>From the terminal, send a SIGUSR2 signal to the VM process. If the Squeak<br>
VM pid is 1234, then the command is "kill -SIGUSR2 1234".<br>
<br>
Back in the Squeak image, you will see the VNC control change from<br>
"RFBServer (stopped)" to "RFBServer :1" to indicate that it is accepting<br>
VNC connections on display number 1. It will stay in this state for the<br>
next 60 seconds.<br>
<br>
>From a VNC client program running on the local machine, connect to<br>
localhost:1, and you should have an active connection to the Squeak image.<br>
<br>
If you want to run your SqueakSource image on another server, run the<br>
VM with -vm-display-null and use ssh port forwarding if needed to access<br>
the VNC ports.<br>
<br>
For example, I have a unix account on the server that hosts <a href="http://squeaksource.com" rel="noreferrer" target="_blank">squeaksource.com</a>.<br>
When I want to open the running SqueakSource image through VNC, I first<br>
log in to the Linux server with a command like this (except that 10.1.2.3<br>
is not the real address that we are using).<br>
<br>
$ ssh -L8888:localhost:8888 -L5900:localhost:5900 -L5901:localhost:5901 10.1.2.3<br>
<br>
Once logged in, I locate the Squeak VM process and send SIGUSR2 to it. I keep<br>
the login session open to handle the port forwarding while I use VNC.<br>
<br>
Then back on my local computer, I open a VNC connection to localhost:1 to<br>
get a connection to the running image. This step needs to be done within 60<br>
seconds of the SIGUSR2, after than no further connections will be accepted.<br>
<br>
I used to use a VNC password (settable from the RFBServer menu) but I decided<br>
that it was too much hassle given the 60 second connection enablement window,<br>
which can only be started by someone with login access to the server and<br>
sufficient privilege to send signals to the VM process.<br>
<br>
If you want to copy any of these ideas for use in some other Squeak server<br>
application, the interesting bits are in class SSImageInit, especially<br>
SSImageInit class>>enableFRBServerOnSigUsr2.<br>
<br>
I should note that RFBServer is written by Ian Piumarta. I don't recall<br>
where it was originally hosted, but a copy of RFB-ikp.8.mcz is in our<br>
<a href="http://source.squeak.org/ss" rel="noreferrer" target="_blank">source.squeak.org/ss</a> repository, along with later updates that are currently<br>
in use for SqueakSource.<br>
<br>
Dave<br>
<br>
</blockquote></div></div>