Crash-proof connection from Linux (client) to Windows (server) - X

This is a discussion on Crash-proof connection from Linux (client) to Windows (server) - X ; Hi, I'm use the Reflection X server on Windows 2000 to work with X11 applications on a Suse 9 box. The problem is that Reflection crashes too much, killing my Emacs session, which I don't like. The solution I think ...

+ Reply to Thread
Results 1 to 11 of 11

Thread: Crash-proof connection from Linux (client) to Windows (server)

  1. Crash-proof connection from Linux (client) to Windows (server)

    Hi,

    I'm use the Reflection X server on Windows 2000 to work with X11
    applications on a Suse 9 box. The problem is that Reflection crashes
    too much, killing my Emacs session, which I don't like.

    The solution I think of is some kind of proxy server between the
    client and the server. When Reflection crashes, the proxy keeps the
    connection and thus Emacs alive. The restarted Reflection can then
    reconnect to the proxy. This solution would be similar to 'screen'
    for terminals.

    I'd be glad if anyone could give me advice on how to accomplish this.

    Regards,
    Daniel

  2. Re: Crash-proof connection from Linux (client) to Windows (server)

    Daniel Engeler wrote:
    > Hi,
    >
    > I'm use the Reflection X server on Windows 2000 to work with X11
    > applications on a Suse 9 box. The problem is that Reflection crashes
    > too much, killing my Emacs session, which I don't like.
    >
    > The solution I think of is some kind of proxy server between the
    > client and the server. When Reflection crashes, the proxy keeps the
    > connection and thus Emacs alive. The restarted Reflection can then
    > reconnect to the proxy. This solution would be similar to 'screen'
    > for terminals.
    >
    > I'd be glad if anyone could give me advice on how to accomplish this.


    Might VNC work for you?


  3. Re: Crash-proof connection from Linux (client) to Windows (server)

    On 2004-09-24, Daniel Engeler wrote:

    > I'm use the Reflection X server on Windows 2000 to work with X11
    > applications on a Suse 9 box. The problem is that Reflection crashes
    > too much, killing my Emacs session, which I don't like.
    >
    > The solution I think of is some kind of proxy server between the
    > client and the server. When Reflection crashes, the proxy keeps the
    > connection and thus Emacs alive. The restarted Reflection can then
    > reconnect to the proxy. This solution would be similar to 'screen'
    > for terminals.
    >
    > I'd be glad if anyone could give me advice on how to accomplish this.


    Have you tried VNC? VNC is stateless, meaning the client can disconnect
    from the server without killing the session.

    --

    -John (john@os2.dhs.org)

  4. Re: Crash-proof connection from Linux (client) to Windows (server)

    > VNC

    It's too slow, and it doesn't work for multiple users, since only one
    person can own the screen at once.

    > xmove


    Thanks for the tip, I'll give it a try.

  5. Re: Crash-proof connection from Linux (client) to Windows (server)

    You want a crash-proof connection to a crash-prone server?
    --
    Copyright 2004 Angela Kahealani. All rights reserved without prejudice;
    UCC1-207. All information and transactions are non negotiable and are
    private between the parties. http://www.kahealani.com/

  6. Re: Crash-proof connection from Linux (client) to Windows (server)

    > You want a crash-proof connection to a crash-prone server?

    Sure. It's the client (the actual application, Emacs in my case)
    which doesn't crash and I want to keep running. Maybe you confuse the
    X client with the X server.

  7. Re: Crash-proof connection from Linux (client) to Windows (server)

    Daniel Engeler wrote:
    >>You want a crash-proof connection to a crash-prone server?

    >
    >
    > Sure. It's the client (the actual application, Emacs in my case)
    > which doesn't crash and I want to keep running. Maybe you confuse the
    > X client with the X server.


    Maybe I'm missing something, but Emacs is text based, yes ? Wouldn't
    screen help out ? I mean, if you were running emacs in a screen
    session, and something did crash, at the very least you'd be able to
    reconnect to the same emacs session.

    --
    - Matt -

  8. Re: Crash-proof connection from Linux (client) to Windows (server)

    > Maybe I'm missing something, but Emacs is text based, yes ? Wouldn't
    > screen help out ? I mean, if you were running emacs in a screen
    > session, and something did crash, at the very least you'd be able to
    > reconnect to the same emacs session.


    Emacs is a text-editor, yes. It runs in both the Terminal and an X
    window, but it looks much nicer in X.

  9. Re: Crash-proof connection from Linux (client) to Windows (server)

    Daniel Engeler wrote:
    > I'm use the Reflection X server on Windows 2000 to work with X11
    > applications on a Suse 9 box. The problem is that Reflection crashes
    > too much, killing my Emacs session, which I don't like.
    >
    > The solution I think of is some kind of proxy server between the
    > client and the server. When Reflection crashes, the proxy keeps the
    > connection and thus Emacs alive. The restarted Reflection can then
    > reconnect to the proxy. This solution would be similar to 'screen'
    > for terminals.
    >
    > I'd be glad if anyone could give me advice on how to accomplish this.


    I suggest a solution which relies on a cool feature of (GNU) Emacs,
    being able to open frames on several displays and keep running until
    all are closed. I'll give you a sample session to show how it works.
    For a reason given below I'm using the CVS version of Emacs.

    Let's use use Xnest to simulate your unreliable Xserver, which will
    spontaneously crash. Start it up, and also a simple window manager...

    Xnest :2 -geometry 600x400 & PID_XNEST=$!
    twm -display :2 &

    Suppose you have just compiled Emacs from its sources it will site in
    the build-directory under src/. Start it...

    src/emacs-21.3.50.1 -display :2 &

    Now we need a reliable backup X-server to which Emacs will fall back
    when your bad one crashes. If you don't have another real display
    around, you can use a virtual one, which will never be actually
    visible...

    Xvfb :1 & PID_XVFB=$!

    For the later parts we need the emacs-server running, for which I have
    (server-start) in my ~/.emacs, but let's just start it manually. And
    we'll open a frame on our backup display...

    M-x server-start RET
    M-x make-frame-on-display RET
    :1 RET

    Now we simulate the crash of your visible server...

    kill $PID_XNEST;unset PID_XNEST

    Emacs doesn't get panicky about that. We can't see it now, but it
    actually just logs "Connection lost to X server `:2.0'" in *Messages*.

    Now comes the recovery part. Since we cannot easily access the virtual
    X-server (no keyboard attached) we use the CVS version of emacsclient
    which can evaluate ELisp expressions given on the command line. So
    let's start a new (unreliable) X-server and get back to the old Emacs
    session...

    Xnest :2 -geometry 600x400 & PID_XNEST=$!
    twm -display :2 &
    lib-src/emacsclient -e '(make-frame-on-display ":2")'

    emacsclient should give you a message such as
    #emacs-21.3.50.1@host.domain 0x8792e48> and open the new frame.
    That's it. Clean up the demo-session

    kill $PID_XNEST;unset PID_XNEST
    kill $PID_XVFB ;unset PID_XVFB

    Hope that helps, Daniel

  10. Re: Crash-proof connection from Linux (client) to Windows (server)

    Thanks a lot! This solution looks great! I got everything running
    except for the CVS Emacs which I'll try later. Is there a good reason
    does the CVS version have more features anyway?

  11. Re: Crash-proof connection from Linux (client) to Windows (server)

    Daniel Engeler wrote:
    > Thanks a lot! This solution looks great! I got everything running
    > except for the CVS Emacs which I'll try later. Is there a good reason
    > does the CVS version have more features anyway?


    Well, in my message I wrote "Since we cannot easily access the virtual
    X-server (no keyboard attached) we use the CVS version of emacsclient
    which can evaluate ELisp expressions given on the command line."

    This was based on my knowledge that the previous stable Release 21.3
    does not have this feature but CVS-HEAD does. In short, if your
    emacs/emacsclient version supports

    emacsclient -e '(make-frame-on-display ":2")'

    you're all set and don't need to compile the sources from CVS. In
    fact if you are using the latest "test" release for GNU emacs from
    Cygwin, I think it is called GNU emacs 21.3.50-2 and was in fact
    compiled from "the current official FSF CVS tree".

    If your emacs does not have the feature, there are probably other ways
    to make emacs open a frame on the newly created X-server display. It
    just appeared to be the easiest to me. - Daniel

+ Reply to Thread