1

I currently do have putty and xming working correctly in tandem, however I don't really enjoy using putty's interface and the first command I run is gnome-terminal & and get my favorite terminal emulater pulled up. I can also do this with MobaXterm with the desired results.

I have ming ssh installed on my PC and also have it added to my env path so I can ssh to and from my *nix boxes without trouble from command prompt or windows run. However I can't use terminal ssh and xming in tandem. So when I try:

ssh -X myname@ipaddress gnome-terminal

I get the error Failed to parse arguments: Cannot open display:

Is there any way I can get these to interop fully? (The ultimate goal is to create a desktop shortcut or assign a keyboard shortcut to do this) Thanks to all in advance!

3 Answers 3

0

I think the normal way of running Putty is with X forwarding over ssh. You could log onto your machine with Putty, then run setsid gnome-terminal, then you can close Putty.

That said, for various reasons (multi-user environent) I like to run it with the normal old TCP Listener running.

start XMing :0 -ac -from 0.0.0.0 +bs -clipboard  -multiwindow -nowinkill -logfile C:\temp\xming.log -logverbose 3

Then set your DISPLAY export DISPLAY=:0

2
  • Closing putty closes all gui's that it pulled up unfortunately. As far as the second suggestion went, I ran set DISPLAY=:0 and confirmed it was set by running echo %DISPLAY which correctly displayed :0. However attempting to run ssh -X myname@ipaddress gnome-terminal gave me connect /tmp/.x11-unix/x0: Bad file number Failed to parse arguments: Cannot open display:
    – Niko
    Jan 30, 2014 at 23:07
  • @SonofLysander this is a bit of a FAQ, you can wrap the command you run with 'setsid' (my answer above edited with this change) or use other tricks like disown Jan 30, 2014 at 23:08
0

Use putty to build configuration that attaches to your server and starts your initial program. Ideally using agent-based authentication.

Once you have your configuration profile built, then simply use plink to load your session. With a command like plink -load sessionname

Finally start plink by writing a script using the Windows scripting host. VBscript, or Javscript will do. An example script is provided on the Xming page. Pass the options to your wshell.run command to hide the plink Window.

0

Eventually I just tossed XMing. It wasn't working correctly, regardless of the various directions I followed and research I did from various other sites (It must be something on my end, but I have no idea what). Instead I am using cygwin's version of x. I installed it after reading this and it works.

The only thing that didn't work out of the box was setting the environment variable by running export DISPLAY=localhost:0.0 in my .bashrc, as was stated in Rich Homolka's answer. For all my windows based prompts I added DISPLAY to my system environment variables and it works pretty much as expected.

Thanks everyone.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .