[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Remote xboard without Desktop Environment



On Wed, Nov 20, 2013 at 01:33:21PM -0200, Beco wrote:
> Hello fellows,
> 
> I find it hard to ask exactly what I need as solution, and so, to
> avoid XY problem I'll openly discuss the main objective here.
> 
> So, I have this hobby, chess, and I've being developing since 94 a
> chess engine (Xadreco) that runs with xboard protocol. (Oldtimes, it
> just used conio.h/curses.h to print a fine board using ascii-art text
> to let you play on console).
> 
> Its a console application, very simple.
> 
> Now suppose I have this 2 computers:
> 
> [Fox]->ssh->[Lizard]
> 
> Fox and Lizard run Debian Wheezy.
> 
> Fox is a very fast notebook (intel i5, 6GB Ram), with KDE.
> 
> Lizard is an old computer (pentium 200Mhz MMX, 96MB RAM) used as a
> backup. It has no DE nor WM. Just plain console.
> 
> I will work on Fox only. No use of Lizard keyboard/mouse/monitor. I
> connect to Lizard by ssh.
> 
> 
> (1) How can I run xboard and play against xadreco issuing the command
> fox$ xboard -fcp xadreco
> 
> First: I cannot start xboard on lizard. Xboard needs " display ". I
> cannot start it from Fox, nor from Lizard directly.
> 
> It would be great if xboard would just run on a console. I tried the
> option "-noGUI", but I think its not about that.
> 
> So the commands:
> 
> fox$ xboard -fcp xadreco
> fox$ xboard -fcp xadreco
> lizard$ xboard -fcp xadreco
> 
> Wont work.
> 
> Of course, it tells me: no display.
> 
> The obvious solution is to install a DE. The machine is too old and
> slow. I don't want to install a DE unless necessary.

This is probably the easiest question to answer. If you do "ssh -X
lizard", then SSH will set up what is known as "X forwarding"; that is,
it sets up port forwarding and environment variables so that programs on
lizard will use the display on fox.

For example:
 fox$ xboard       # fox executes xboard and displays locally
 fox$ ssh -X lizard
 lizard$ xboard    # lizard executes xboard and displays on fox

> 
> 
> (2) xboard can connect to a chess server (a third computer). So the
> configuration would be:
> 
> [Fox] -> ssh -> [Lizard] -> xboard-protocol -> [Flik]
> 
> Flik is not mine, I suppose it runs linux. I don't need to know. Flik
> runs a chess server (ICS), so I can talk to it using xboard protocol (
> text commands over the internet that tells the opponents moves, and
> send the engine moves, in a fashion notation that reminds the
> coordinates of a naval battle game)
> 
> In this case, the "graphical interface" (or the chess board) is really
> unnecessary, as people will play chess at their computers. Xboard only
> need to keep the connection alive and send the "text" commands from
> the protocol (like moves, etc.).
> 
> 
> (3) Now, how can I keep xboard running on lizard, after I turn off fox.
> 
> Also, it happens that the connection break some time. So I would
> connect via ssh from Fox to Lizard to restart xboard again.
> 
> 
> Ultimately, the main objective is keep Lizard on, running xboard and
> xadreco, connected with Flik, playing games. If something goes wrong,
> use Fox to restart the program.
> And: saving as much RAM as possible of Lizard, without installing
> anything unless necessary.
> 
> [Fox] -> ssh -> [Lizard] -> xboard-protocol -> [Flik] <-
> xboard-protocol <- [netizens]

One possibility might be to use "screen" or "tmux" to provide a
detachable console. I don't know if the exact details of this are
possible, but it might be possible to do the following:

  fox$ ssh lizard
  lizard$ screen	# starts a new screen session
  lizard$ xboard-server   # Somehow run xboard in a text-only mode
  lizard$ Ctrl+A Ctrl+D   # Detach the screen session. xboard continues
                            to run in the background
  lizard$ logout
  fox$ xboard      # Fox connects to the xboard server in the same way
                     that flik does.

In other words, we treat Flik and Fox the same (as clients, talking the
xboard protocol to lizard, which runs purely as a server).

Attachment: signature.asc
Description: Digital signature


Reply to: