miércoles, 23 de febrero de 2011

Remote screen using X

This is just too awesome to keep it for myself. I had an installation bundle for a Business Rules Engine, and it wouldn't allow to be installed using a console: it required a GUI. Pretty weird arrangement, since this would be deployed on a server, where graphical user interfaces are the exception, not the norm. Thanks to a friend, I got myself to use X for the first time.

IMPORTANT DISCLAIMER: DO NOT USE THESE INSTRUCTIONS ON AN INSECURE ENVIRONMENT! This was a quick-and-dirty approach because I needed it so.

On the server:

You'll need Xvfb and x11vnc. Xvfb will set a screen for the server, and x11vnc will allow it to be accessed through the network. Run these in order (if you are like me, you'll open three sessions, one for Xvfb, another for x11vnc, and the last one for the export and xterm, although this one is included just as an example):

  1. Xvfb :0 -screen 0 1024x768x16 &
  2. x11vnc -display :0 &
  3. export DISPLAY=:0.0
  4. xterm &

On the client:

You'll need a vnc viewer, I used vncviewer :P . Run it like this (remember to change "server-hostname" for the hostname or IP of the server):

  • vncviewer server-hostname:0

And that's it! Using these instructions, I runned the installer, a Java desktop application, and everything went smoothly.

I like to close my posts with a quote, and here it is, from Emanuel Goldstein a.k.a. Cereal Killer, and it's exactly how I felt when I saw that xterm appear remotely:

I kinda feel like God!

No hay comentarios:

Publicar un comentario