Jump to content

SSH, X, BASH, Xming and PuTTY all in a single go? Your just been silly.


Recommended Posts

This is on the verge of been a "We do it because we can!" thing, but lets get to it.

So, you have a main desktop that runs Linux all the time, all your files on there (music and movies excluded), your 6 month old firefox profile with 50 bookmarks that you need because you do. And some stupid application that requires some USB dongle to run other wise it just complains "Not a valid copy".

It's sunny out side, you want to work on your laptop (can be windows or Linux) outside (there is obviously some thing wrong with you). How can you use this stupid proprietary program that requires the USB dongle and access all your main desktop files securely and from the laptop? With SSH of course (and Xming if you use windows)!

The following works fine with Ubuntu:

On the Linux desktop this is so easy it's silly. apt-get install ssh on the desktop and now your done.

On the laptop that runs Linux it's also silly easy. All you need to do is run the command ssh -l <username> -C -X <desktops IP> login, and run the program from that shell, a window will appear, boom.

On a laptop running windows it's not as easy (of course, nothing is in windows). You need to download and install Xming (x server for windows). This needs to run to the point that when you run it you get a black/gray checkered window with a X shaped cursor. Now when you run PuTTY, you need to fiddle your way through the menus to Connections - SSH and enable compression. Then fiddle the menus down to Connection - SSH - X11 and enable X11 forwarding. With this done, connect to your desktop and run a program. The program should appear border less in the Xming window. The reason been that when you do this on Linux the already running window manager adds the boarder to the window. So lets close that program, go back to that PuTTY and apt-get install wmaker. wmaker stands for Window Maker and is a very light window manager, perfect for use over ssh. Now in your PuTTY run wmaker &, you should get the wmaker desktop in Xming. then back in your PuTTY run your program, and your done.

Admittedly there are a few issues with this:

No sound from any program (if there is sound it will come out of the desktop).

Video doesn't play well (but plays, looks like a constantly polling VNC connection focusing around the overlay).

Cannot copy and paste files between programs that are running locally and ones that are running remotly (but you can do clipboard copy and paste. This includes text, GIMP cut selections, basically any thing that just uses the clipboard).

Firefox runs really slowly and practically locks up when loaded web pages.

programs (like Firefox) that would only like you to run one instance of them don't play nice. If you leave Firefox open on the desktop you will be told it's already running on the laptop.

Why doing this is better then VNC:

When all the windows data has (eventually) made it's way to your laptop it is smoother than VNC.

If you are using Linux on the laptop it integrates much better with the desktop (usually appears just as another application window with @<hostname> in the title bar).

Hella easier to setup then SSH tunnels (well, technically, thats what you are doing, but x is so wildly used that it's done automatically when you specify the -X option).

Things that would be nice (but I as of yet have not figured out):

Sound (can imagine this would make programs fairly laggy).

Moving programs between displays (meaning, I would like to be able to move Firefox running on localhost:0.0 to my laptops screen, but I haven't a clue how to do that, I guess it will have some thing to do with screen).


Link to comment
Share on other sites

I personally feel that the 'screen' program is being underrepresented.

So you use some typically long-running terminal-interactive program like pine, btdownloadmanycurses or irssi and while you're not at your main machine you find yourself with the need to use those programs. You really don't want to start another instance of those programs, but instead you want to use *THOSE* instances of the program. Just from another terminal.

So before we begin you start the screen program. You get some copyright notice and then you're back in a shell. This shell however runs within the screen program that you're now attached to. Type in something, then hit <CTRL-A>D and you will disconnect from this screen session. You'll be looking at your original shell again. Run 'screen -r' to re-attach to the screen session that remained dormant, and you will be presented with the shell into which you typed that something.

When you're running screen on a remote machine that you've accessed via, say, ssh, and your connection dies, screen will not be aware of this. So when you reconnect you need to explicitly tell screen to disconnect from whatever terminal it thinks it's connected to, and reconnect to your current terminal with 'screen -d -r'.

It gets really fun when you realize that you're not limited to a single shell. Within screen, hit <CTRL-A>C and you've got yourself a new shell. Cycle through  shells within screen with <CTRL-A><space> and <CTRL-A><backspace> or select them from a list using <CTRL-A>"

Screen can be a lifesaver, and has been for me on several occasions. I highly recommend using it.

Link to comment
Share on other sites

I might be missing some of the requirements, but this really seems like a job for FreeNX. Really does this job for me and allows cutting and pasting.  I can use it in full desktop mode and get a KDE or Gnome desktop, or just open an application in a floating window.  I know it has sound capabilities, however I don't use sound so I can't really tell you how good it is.  nxserver really has been awesome for me. . .  fast, secure and so far very reliable.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...