Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
X GUI

X + VNC + SSH + Keyboard Shortcuts = Dueling Network WMs? 22

nil0lab asks: "I want to use keystrokes to switch between various systems and go from workspace to workspace within each system with another set of keystrokes." By using a combination of VNC, SSH and the right window manager, nil0lab wants to be able to look at any desktop on his network. Sounds cool, and I bet there are a lot of us who could put a trick like this to use. nil0lab has a partial solution, however there are still issues that need to be solved, and this is where he needs your help.

"Here's my partial solution:

  1. I run blackbox (google cache) with bbkeys (google cache) on my local box (debian+xfree86-4). This gives me workspaces. I programmed ctrl-alt-1 through ctrl-alt-9 to give me workspaces 1-9.
  2. In each workspace I run Tridia's version of vncviewer to connect to a different remote box (debian, suse, aix). (Actually, one is to the local box for consistency and my mobility)
  3. I run the same window manager on each of the remote systems. I tried using blackbox with bbkeys there too but with -config to define different keys but there seems to be some conflict. I settled on flwm for the remote boxes: its minimal decorations and low memory impact seems to give good response over 256Kbps - T1 grade lines + ssh. It also supports keyboard-oriented operation (ctrl-F1 thru ctrl-F12) to get to different workspaces. (Tho Ctrl-F8 pos up the vncviewer's pop-up menu.)

Downsides: (1) flwm seems to support switching windows within a workspace fairly well, but since focus follows mouse, any little bump of the mouse changes the focus back. (2) copy and paste don't work very well (first you gotta copy, then you gotta use the popup thingy to transfer remote to local, then you go to the other one and use its popup thingy to transfer local to remote, then you paste, and then it doesn't work half the time and you have no idea which step wasn't done just so or there's some limitation.) (3) each vncviewer is in a window so it is subject to being minimized or defocused or resized. tried the vncviewer's fullscreen mode but it seemed to block changing workspaces under the local bbkeys control.

Is there a better way?"

This discussion has been archived. No new comments can be posted.

X + VNC + SSH + Keyboard Shortcuts = Dueling Network WMs?

Comments Filter:
  • by Anonymous Coward
    Although this may not work in your situation, bandwidth being a concern, I open from the command line remote connections using the following: X :1 vtXX -query number.of.machine.here

    And assuming you have the remote Xserver set up correctly it will open a new XDM (or WDM in my case) session on the remote server. Now I know that this is not inherently secure so you will need to wrap this with ssh, but you should still be able to use Ctrl-FXX to switch to any of the Desktops you have running. Since I use WindowMaker I set Ctrl-Meta-Right Arrow to cycle through the desktops. The left Arrow takes me the reverse direction.

    Now all of this is done on a local network so I do not know how heavy the bandwidth will impact on this solution. However the vtXX part of the syntax for the X server handles the machine switching so you are free to use whatever WindowManager you want. The really sweet part is that when you switch to a different machine's desktop, your other instances of the Xserver you are running will sleep after a few seconds, thus reducing the load on the machine you are using and the remote servers also. I also use Debian so this should work for you.

    Good Luck,
    Matt
  • by TBone ( 5692 ) on Saturday June 16, 2001 @06:39PM (#146354) Homepage

    ...but why are you running remote desktops on all of your systems anyway? I beat down my users who feel they absolutely HAVE to run a remote desktop instead of just running remote windows. The performance hit on the remote machines is noticable - expecially when I kill all dtremote sessions on some of my Solaris boxes at work.

    X transcends the desktop. Set yourself up a workspace dedicated to a machine or group of machines. Configure buttons to launch things on certain OS's, and only put them on certain desktops. Any user who tells me that he needs to run in a virtual desktop finds shortly after I disable his remote desktop that he does his work just fine without the remote desktop and just remote X windows.


    This space for rent. Call 1-800-STEAK4U

  • Assuming you have a permanent network connection to the remote host, you can open up an X application on the remote host with the display on the local host and keep it open as long as you want. VNC is nice if the connection or the local system has problems. But otherwise, why bother with the extra overhead that VNC imposes?
  • Well, yes, those are problems and VNC solves them. I would add that screen(1) solves the same problems for console applications with lower overhead of all types. But I was replying to the original claim that VNC solves the problem of running an X based application on a remote system for a long time. You don't need VNC for that; you can do it cheaper just with X.
  • You can start multiple X servers on different virtual terminals. (Linux/BSD and other *NIXes that support virtual terminals)

    From an X terminal on your current X desktop, type 'X :1 &' - this will start a new X server on the next available virtual terminal with a display name of yourbox:1 in the background.

    Then type 'X :2 &', to start another one with the display name of yourbox:2.

    you'll probably need to fire up a local xterm on each of these servers to type 'xhost +remotebox', so that your remote machines have permission to connect, but then you can telnet into your remote box, type 'export DISPLAY=yourbox:1 or whatever, and then fire up whatever dektop environment you like.

    Then all the desktops for all your machines can be a Ctrl-Alt-F* away.

    There is most likely a better way to set this up, but since my Voodoo 3 has major problems doing this, i use a single X server with multiple workspaces, ssh into each of my boxen and use the X-forwarding features to have them display windows on my desktop - i.e. i don't have a separate 'desktop environment' for each machine.

    Another option is starting multiple VNC Servers on your local machine, and local VNC Viewers as well. This may get around your copy/paste issue.

    Then, on your remote boxes, set DISPLAY= localbox:X, where X is the number of your VNC server, and run your desktop environment startup script i.e. 'gnome-session &' form a telnet/ssh shell to the remote machine.

    Hope that helps. Others may be able to suggest more streamlined ways of doing this stuff, but this is what works for me

    -Pete

  • Cool, then do you have an idea of how to script renote application launches via SSH / X?

    Having to type commands for every opened window would be fairly cumbersome.
  • If what you want is to be able to pop up an xterm, emacs, or other app which is running on the remote machine, with out going through all the steps of starting a new xterm, sshing, and typing the app name, then what you do is put that into the one of the menus in your window manager.

    It depends on which window manager you use, of course. I use fvwm2. Here's a little snippet from my ~/.fvwm2rc file:

    AddToMenu xemacs
    + "Catbus %mini-bball.xpm%" Exec xon catbus xemacs &
    + "Woozle %mini-bball.xpm%" Exec xon woozle xemacs &

    xon is command or script which rsh's to the machine and lauches the application. You can replace everything after the "Exec" with a differnent command to make it use ssh. You have to set up your authorized_keys to allow you ssh into the machines without typing your password, or else do some more interesting scripting to make a window pop up and ask you for it.

    It's worth setting it up right even if it takes a couple of hours fiddling with scripts and manpages.
  • right on. sometimes, we forget just how cool X can be. :)
  • The VncMonitor [wilson.co.uk] patch allows you to monitor several remote systems. A single window is used to present all the displays."

    The main VNC page, contrib. section, has a few weird additions to the viewer and servers.

  • How many computers, and what are these computers being used for?

    If these machines are servers, you really shouldn't be running X at all. X wastes tons of cpu, and most of the newer window managers blow even more.

    If these machines are being used as individual desktops and there is alot of them, you may want to consider purchasing a management solution like Tivoli.

    Tivoli allows you to remote control, perform remote software installation, and take inventory of installed hardware and software. The downside is that Linux support is so-so until the end of the year, and the package is very expensive and requires dedicated staff.
  • I think his point was to take over currently open sessions, PCAnywhere style.

    He seems to understand how to export X displays
  • True, true.

    I'm working with about 120k nodes... I tend to think big.
  • What if there are problems on the network (like inactivity kicks from your provider) or the local system has the "problem" of not being powered-on all the time? What if you want to switch desktops without having to restart applications on the server just for redirecting them to a different X-server?
  • VNC lets you keep the windows open even if you close your local X-server. If you have a system that you just want to look after from time to time, you don't need to reopen applications everytime. Just leave them running on the virtual VNC X-server. An added bonus is that you can then download a small and free application for any OS to see the screen of that headless box. If you have the cycles to spare, that is a lot more convenient than restoring the session everytime you want to use that machine.
  • just dl a trojen. its the same thing
  • Whenever I install openssh on a new machine, the man page is totally hosed...no sections or formatting, and all the words are run together. Freaking useless. Other implementations of ssh don't have this problem, I don't know why.
  • Yeah, it's amazing how many Windows-originating Linux johnnie-come-latelies completely fail to understand X...using VNC, I mean come on. The question asker uses an "enhanced" version of VNC that offers zero new features, but does include an installer (woooo), instead of just going to the AT&T site and getting the damn thing. I love using remote X desktops, but I always get stung by things like incompatible fonts and lack of availible static colormaps.
  • X doesn't really take up *that* many resouces...unless your server is heavily loaded and you need every megabyte of RAM you can spare, there's no harm in running X. Tivoli is insanely expensive, and is complete overkill unless you have thousands of nodes to monitor.
  • Heh, heh...get this...our company bought HP/Openview IT/Operations for monitoring...and we have, oh, thirty nodes. For those of you keeping score at home, that's about $2,000 per node.
  • um. 'man ssh' is your friend.

    'ssh -X grace xmms' is what i use to run xmms on the workstation tucked away in the corner, wired into my home stereo.

    it's just like running any other remote command from the ssh command-line.

    read the man page. it's big and scary, but damn is it worth it. ssh is killer at this stuff (port redirection, or, how i poked a big ole hole through the firewall)
  • Sure, that's possible -- but VNC doesn't do this by default. You need to install something like x0rfbserver [hexonet.de] to do it. Basically, x0rfbserver captures the regular X framebuffer and serves it out using the RFB (Remote Framebuffer) protocol. Thus, you can bring up a presently running X session remotely using a regular VNC client -- more in the style of WinVNC. By default, Xvnc does not behave like this...

    VNC is great for a lot of things: for instance, if you want to connect and control a presently running session (a la WinVNC or VNC through x0rfbserver), or if you want to, say, control an X desktop from a Mac or Windows machine that doesn't have (and you can't install) an X server. It all depends what you want to do, I suppose.

    BRx.

  • by bacchusrx ( 317059 ) on Sunday June 17, 2001 @06:47PM (#146374)
    Since the machines to which you're connecting are running X clients, you might as well use X. X is a network transparent windowing system, after all, this is what it was designed to do... a rudimentary way to get started would be to SSH to the remote machine, setenv DISPLAY your_local_ip:display and run xterm.

    The neat part is, of course, that your local window manager & decorations will be used -- so there's no reason to be minimalist with eye candy as is the case with VNC: window management & drawing, etc. is all done locally. It further solves your problem with copy & paste because the remote X apps will be treated just like local ones.

    Lastly, if you find the performance sluggish, there are several ways you can decrease the bandwidth neccessary to make network X possible. Beyond SSH tunnelling (which is a good idea anyways :)), the two that spring to my mind are LBX and DXPC. LBX (Low Bandwidth X) is probably the simplest to configure & use -- it's included with XFree86 (4.x at least.)

    On the remote machine, simply type:

    lbxproxy -display local_machine:display :1

    now, set your DISPLAY variable to :1 on the remote machine. that's that. X will now use LBX compression -- there's noting to configure locally as the local X server will automatically decompress the stream for you.

    DXPC (Differential X Protocol Compressor) is a little more complicated as it requires a proxy on both sides. Search Google for setting up DXPC -- there's plenty of HOWTOs & FAQs on the subject out there.

    All in all, using X for this purpose will integrate better with your local desktop as well as make the integration between your remate apps & your local ones seemless.

    BRx.

All seems condemned in the long run to approximate a state akin to Gaussian noise. -- James Martin

Working...