Question

cygwin xwin -multiwindow

Asked by: netminder39

I am a linux on windows newbie and would like to find out how to setup cygwin to produce a display like they show in the screenshots on their website of each program opening in its own window.  I have figured out how to open the particular remote applications I need to work with from with the single window environment, but this requires an xhost +domainname command to be run prior to the application being successfully launched from within ssh.  Is there anyway to do this in the multiwindow environment?  I don't see any kind of terminal to enter the command, and entering the command in the main cygwin window before typing startx doesn't work.

Thanks for the help anyone.  Hopefully, this was the right place to post this question?

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2004-02-26 at 22:28:18ID20899808
Tags

cygwin

,

xwin

,

display

Topic

X-Windows Window Manager

Participating Experts
1
Points
250
Comments
25

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. start KDE in cygwin
    I have installed KDE and qt for Cygwin, but do not know how to start it. I tried those commands such as "startx", "xinit" or "X", it only gives me the cygwin default X environment. Any expert please tell me how to start KDE ? thx!
  2. Difficulty with Cygwin SSH package
    I'm installed CygwinX on windows so I can run Solaris apps on my XP machine. But, am having trouble getting ssh to work with cygwin. www.cygwin.com says to install package first but I can't find the package on the cygwin website. It uses openssh.
  3. Cygwin wierdness
    I had Cygwin a while back, and have since removed it. However, it has left values in my registry! HKLM\SYSTEM\ControlSet001\Enum\Root\LEGACY_SSHD\0000 DeviceDesc=CYGWIN sshd There are two other similar keys as well. What are all those 'legacy' keys? Device categories?...
  4. Cygwin SSH question
    I setup cygwin on my AD at home to ssh to and I verfied that SSH works but I am not sure home to sh remotely with putty. ... I enter the user account but the password is rejected . I see the domain users accounts when I do a less /etc/mkpasswd
  5. cygwin ..ssh does not work
    Hello I am new to Cygwin, I downloaded Cygwin (evreything looks good so far) and I tried to ssh to a remote host.But cygwin does not seem to recoganise the ssh command: It says .. bash:ssh command not found. The same thing happeded fo the ssh-keygen command.Is there some ...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: GnsPosted on 2004-02-27 at 06:01:00ID: 10469199

As can be seen on http://x.cygwin.com/docs/ug/configure-cygwin-xfree-options.html you need specify the correct commandline option...
XWin -multiwindow
will let windoze decorate/manage the windows... While
XWin -rootless
will make the X root window transparant (making the apps float above the windows dittos... this needs a windowmanager to be run too:)

-- Glenn

 

by: GnsPosted on 2004-02-27 at 06:06:22ID: 10469246

BTW, you shouldn't need any xhost +... command. ssh -X would be all you'd need ... Setting the DISPLAY on the remote side so that all traffic moves through the ssh tunnel, and (and this is a real neat thing) making the traffic look like it's local to the local machine. So just fire up "XWin -multiwindow", "ssh -X remote" and on the remote start whatever app you need.... try it out with an xterm;-).

-- Glenn

 

by: GnsPosted on 2004-02-27 at 06:23:52ID: 10469401

If you have problems with the cygwin ssh, do try putty (I just tested with ... mixed results.... for ssh:-). Find putty at http://www.chiark.greenend.org.uk/~sgtatham/putty/

-- Glenn

 

by: netminder39Posted on 2004-02-27 at 06:27:29ID: 10469434

Here's what I need help with: I can double click the Cygwin icon, type in "XWin -multiwindow", but then what?  I don't see a terminal!!!

If I just type just "startx" I can enter my commands in the terminal that pops up in the X window (i.e. "xhost +134.456.789.012" and "ssh -X -l myusername 123.456.789.012").  Unfortunately, I have tried without the xhost but it will not work for some reason.

Once logged in to 123.456.789.012 I simply type "setenv DISPLAY 135.791.246.802:0.0" then say "/usr/openwin/bin/xclock".

where 123.456.789.012 is a sample name for the computer I'm connecting to
and 135.791.246.802 is a sample name for the computer I'm connecting from
(which I get by looking at the last logged in line)

 

by: netminder39Posted on 2004-02-27 at 06:28:44ID: 10469444

I have tried putty but it doesn't allow me to use xhost+ anywhere I can see.  Plus if I understand correctly it doesn't handle the xwindow part just the ssh??

 

by: netminder39Posted on 2004-02-27 at 06:29:45ID: 10469453

(because the xhost+ command has to be typed on my local machine and it takes me straight to the ssh login prompt)

 

by: GnsPosted on 2004-02-27 at 06:37:43ID: 10469529

The first command should be:
XWin -multiwindow &
to put X in the background... leaves the terminal free for the next command (or just start two bash windows):
ssh -X myusername@123.456.789.012
which will (hopefully) connect you to the remote host, and establish the relevant tunnel for X as well as set the DISPLAY environment variable for the remote shell to something like localhost:10 ... on the remote (after connecting) you can verify this with
echo $DISPLAY
and perhaps
xterm
... should be all needed.
If that doesn't work for you, please report back, and we'll see what might be the problem... As said, at least one incarnation of ssh that I've tried with has some issues with setting up the X tunnel correctly. This is why I suggested you might try putty, since I know this to be rock-solid for that.

I'll repeat: you do _not_ need the xhost +whatever.domain because the traffic relevant to X will appear to be local to both machines. If you set the DISPLAY to go to your windows machine directly, you'd need the xhost thing for that, you would not use the ssh tunnel for X.

-- Glenn

 

by: GnsPosted on 2004-02-27 at 06:45:07ID: 10469597

With putty: enter the relevant name/address (don't forget to choose ssh) then expand/choose Connection->SSH->Tunnels and make sure you've checkmarked "X11 forwarding" and that the local display looks ok (it should be "localhost:0"). Then click Open. When you are connected, putty should have set the DISPLAY for you already.

Tunneling X will waste some bandwidth, since the encryption will "bloat" the X traffic a bit. You can counteract this with compression (-C flag to ssh, Connection->SSH and checkmark "Enable compression" in putty).

-- Glenn

 

by: netminder39Posted on 2004-02-27 at 06:51:54ID: 10469669

here is my relevant output from cygwin (don't know I didn't think of the & before, thanks):

tcsh: using dumb terminal settings
myusername@123.456.789.012> echo $DISPLAY
DISPLAY: Undefined variable.
bdeckard@123.456.789.012> xterm
xterm Xt error: Can't open display:
bdeckard@123.456.789.012>

I get the exact same results, minus the tcsh line using PuTTY with X11 Forwarding enabled.

 

by: GnsPosted on 2004-02-27 at 07:03:29ID: 10469758

Hm, might be that the remote isn't allowing X11 forwarding... If you set DISPLAY manually like this (use putty)
setenv DISPLAY localhost:10
xterm
Still no joy? If so, look at the remote machines sshd_config you should have something like
X11Forwarding yes
#X11DisplayOffset 10
#X11UseLocalhost yes
(the two remarked lines show the default values)

-- Glenn

 

by: netminder39Posted on 2004-02-27 at 07:21:57ID: 10469914

still no luck.

the system wide file has ForwardX11 no, but I had previously tried changing my user file to yes.  These are the only settings available.  Should I add more?

# Host *
#   ForwardAgent no
#   ForwardX11 yes
#   PubkeyAuthentication yes
#   PasswordAuthentication yes
#   FallBackToRsh no
#   UseRsh no
#   BatchMode no
#   CheckHostIP yes
#   StrictHostKeyChecking ask
#   EscapeChar ~

if not, is there any way to just use xhost + in cygwin before calling xwin -multiwindow &.  When I try that I get a "Can't open display message"  (the only way I've gotten it to work is by running startx and then typing it in that terminal)

 

by: netminder39Posted on 2004-02-27 at 07:29:58ID: 10469985

I just added those two lines to my file and now got this response (in PuTTY):

Xlib: connection to "localhost:10.0" refused by server
Xlib: Client is not authorized to connect to Server
xterm Xt error: Can't open display: localhost:10

so is there anyway to make xhost work with multiwindow like I originally asked?

 

by: GnsPosted on 2004-02-27 at 07:39:18ID: 10470060

Yes. The cygwin bash window is all you need for that:
export DISPLAY=:0
xhost
xhost +whatever.you.like

I think you've been looking at the wrong file though. ssh_config is for the ssh client, while sshd_config is for the sshd server.
The relevant one to look at is on the remote machine.

-- Glenn

 

by: netminder39Posted on 2004-02-27 at 07:49:52ID: 10470146

the only file I've changed on the server is under my home folder as ~/.ssh/config

when I tried typing the first two commands in the cygwin window I get this response:
xhost: unable to open display ":0"

Is there something I'm missing here?  I downloaded cygwin then added the openssh package and the complete XFree86.

 

by: netminder39Posted on 2004-02-27 at 07:52:09ID: 10470167

btw, if you get the xhost method to work opening in multiwindow I'm going to boost points to 250 for all your time.  If we somehow get ssh alone to do the job I think this is worth a full 500 points.

 

by: GnsPosted on 2004-02-27 at 08:03:41ID: 10470264

>  the only file I've changed on the server is under my home folder as ~/.ssh/config
Yes, and this is not the one you should look at.
You should be looking at something like /etc/ssh/sshd_config on the remote.
That file has a completely different look (the one you qouted above is for the ssh client).

> when I tried typing the first two commands in the cygwin window I get this response:
> xhost: unable to open display ":0"
Strange. Did you have XWin running at the time? And just to be sure, you ran that in the cygwin bash window on the local windoze machine?

-- Glenn

 

by: netminder39Posted on 2004-02-27 at 08:12:34ID: 10470331

actually both files look exactly the same, but I don't have edit rights to the other one (/ect/ssh/sshd_config)

right on with the other comment, I didn't have XWin running.

so presto, you've earned at least 250 points.  Any other suggestions on ssh other than contact the system administrator?

If not then I'll award the points.  Thanks so much.  

 

by: GnsPosted on 2004-02-27 at 08:15:51ID: 10470364

Great that at least something works:-).

Apart from talking to the sysadm... nope. If sshd won't allow X11 forwarding, there's not much to do:-).

-- Glenn

 

by: GnsPosted on 2004-02-27 at 08:17:07ID: 10470371

When you talk to him/her, do stress that letting X fly all over the network is worse than letting it pass through a nice (compressed) tunnel,,, from a security standpoint;-).

-- Glenn

 

by: netminder39Posted on 2004-02-27 at 08:17:16ID: 10470373

wait a minute though, why is the xterm window not popping up with my file system instead of the remote file system?

 

by: GnsPosted on 2004-02-27 at 08:20:23ID: 10470410

Cygwin has an xterm, perhaps that is the one you're starting, not the one on the remote?

-- Glenn

 

by: netminder39Posted on 2004-02-27 at 08:20:57ID: 10470416

nevermind that, it worked fine.  I don't know what the eror was.  Thanks again.

 

by: GnsPosted on 2004-02-27 at 08:23:09ID: 10470437

You're wellcome.
Having a lot of xterms from a host of machines sometimes makes it very easy to ... mix things up. If that was it, you wouldn't be the first (nor the last... this is personal experience talking:-).

-- Glenn

 

by: netminder39Posted on 2004-02-27 at 08:26:03ID: 10470464

Our messages crossed, what you said about the cygwin xterm makes sense.  Again thanks for A+++ help!

 

by: GnsPosted on 2004-03-02 at 03:07:17ID: 10493894

just some additional info, to clear some "obfuscation" on my part regarding cygwins ssh command... I said:
> If you have problems with the cygwin ssh, do try putty (I just tested with ... mixed results.... for ssh:-)....

Well, my memory isn't as good as I sometime think it is...:-)
For ssh -X to work (the cygwin incarnation), you need have the DISPLAY environment variable set already... Prior to starting ssh, just do
export DISPLAY=:0
in the cygwin bash window (and perhaps start the local local X server too:-)... Works as well as putty.

Sorry for that.

Did you ever decide to bother your admin about allowing sshd to forward X?

-- Glenn

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...