Run Smalltalk on server without GUI?

后端 未结 5 1201
耶瑟儿~
耶瑟儿~ 2021-02-01 04:12

I\'ve got rather distinct question - I\'d like to run Smalltalk on a production server without using graphical interface. Is this possible with VW or Pharo (maybe even Squeak)?<

5条回答
  •  自闭症患者
    2021-02-01 04:30

    If I had root access on the VPS I would personally install Xvnc it doesn't add too much bloat on the server and it's much easier to manage Squeak and Pharo with a GUI.

    You can launch each Squeak instance in it's own Xvnc display without relying on a Window Manager by having Squeak take up the whole screen.

    You need only minimal X support files. On an headless Ubuntu apt-get install tightvncserver pulls only 19.8 Mb of packages. And unlike RFBServer it will just work with any Squeak/Pharo image.


    Here's how I do this:

    For each VM launch an Xvnc session. You can have as many displays as you need. Display :0runs on the VNC port 5900, display :1on 5901 and so on.

    To statrt Xvnc on display :0

    Xvnc :0 -nolisten tcp -geometry 1024x726 -depth 24 &
    

    Then launch Squeak on that display

    squeak -display :0 -- ~/fullscreen.st  &
    

    fullscreen.st is a simple Smalltalk statup script that adjusts Squeak to the size of the screen

    "fullscreen.st"
    ScreenController new fullScreenOn
    

    A note on security

    By default Xvnc accept connections without a password so I suggest you take at least one of the following precautions.

    • Forces Xvnc to listen on loopback. I use an LD_PRELOAD trick similar to this for that purpose and connect using ssh port forwarding.
    • Block the port on your firewall
    • Read on the -rfbauth argument to setup Xvnc password authentication.

提交回复
热议问题