LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   General (https://www.linuxquestions.org/questions/general-10/)
-   -   How to tell if Cygwin is functioning?? (https://www.linuxquestions.org/questions/general-10/how-to-tell-if-cygwin-is-functioning-665592/)

john test 08-26-2008 03:55 PM

How to tell if Cygwin is functioning??
 
Running ubuntu 7.10 and trying to talk to it from vista
I did xhost + and if I echo $DISPLAY I get 0.0

I downloaded cygwin and I have a nice little batch file that allows me to some limited linux style comands but cant do gedit from there

I can ssh in using putty and I can ftp in but cant run gedit or any other gui from the ssh window.

How can I tell if cygwin is actually functioning? and how can I can I get x apps to display on the vista machine???

The vista machine is 192.168.1.102 and the uxbox is 192.168.1.124

johnsfine 08-26-2008 04:03 PM

Quote:

Originally Posted by john test (Post 3260651)
I can ssh in using putty and I can ftp in but cant run gedit or any other gui from the ssh window.

That is as it should be.

Quote:

How can I tell if cygwin is actually functioning?
Despite thread title, I don't think that is the question you want answered.

Quote:

how can I can I get x apps to display on the vista machine???
That is the question.

I use xwin, which is located in /usr/X11R6/bin in my cygwin install. But I don't recall whether it came as part of cygwin or needed to be installed after cygwin.

Hopefully the names xwin and X11R6 should give you enough that if you don't have it installed you can find the cygwin compatible copy to install.

Edit: The web site for some version of this (not the one I use) is at
http://x.cygwin.com/

pwc101 08-26-2008 04:05 PM

Quote:

Originally Posted by john test (Post 3260651)
Running ubuntu 7.10 and trying to talk to it from vista
I did xhost + and if I echo $DISPLAY I get 0.0

I downloaded cygwin and I have a nice little batch file that allows me to some limited linux style comands but cant do gedit from there

I can ssh in using putty and I can ftp in but cant run gedit or any other gui from the ssh window.

How can I tell if cygwin is actually functioning? and how can I can I get x apps to display on the vista machine???

The vista machine is 192.168.1.102 and the uxbox is 192.168.1.124

I have the following function in my cygwin .bashrc which starts X, allowing me to use X apps in cygwin:
Code:

gg () {
        X -multiwindow &> /dev/null &
        export DISPLAY=127.0.0.1:0.0
}

After I log in, I run gg (the name of the function), and then I can run gedit, gvim or whatever, be it from the cygwin installation or after ssh-ing into a linux box.

Hope this helps.

edit: Also make sure you have X11 forwarding enabled in Putty (can't remember which section it's in, but it's fairly straightforward :)).

CRC123 08-26-2008 04:09 PM

Have you got the Xwin part of cygwin running?

Simply starting Cygwin's command line doesn't start the XWin server that emulates X on windows. Here's what you do:

-Start Cygwin command shell
-run 'startxwin.sh'
-A new window should pop up with a new shell inside of it.

That new shell is where you can run gui apps.

Also note that when you ssh, you need to use '-X' option to enable X11 forwarding (X must be capitalized and remote computer must support X11 forwarding).

john test 08-26-2008 04:27 PM

on vista / looking in /usr/bin I see "xarg" but no "xwin"

I am guessing the script above is a shell script and I am wondering if it runs on the uxbox or the vista box?

Does X reside somewhere in the Cygwin file system ?
Is there an equivalent of apt-get install xwin for cygwin?

Remember I am a newbie Thanks for the help

pwc101 08-26-2008 04:35 PM

Quote:

Originally Posted by john test (Post 3260688)
I am guessing the script above is a shell script and I am wondering if it runs on the uxbox or the vista box?

Run it on the Vista box.
Quote:

Originally Posted by john test (Post 3260688)
Does X reside somewhere in the Cygwin file system ?

Yes.
Quote:

Originally Posted by john test (Post 3260688)
Is there an equivalent of apt-get install xwin for cygwin?

Rerun the setup.exe that installed cygwin, and select the X packages to install; they're not part of a default cygwin install.

john test 08-26-2008 04:45 PM

I will try to reinstall cygwin

I can/t execute X or startxwin or xwin in cygwin

when I putty into the uxbox do I run -X or -X + ????

john test 08-26-2008 04:51 PM

is there an editor in cygwin?? I tried nano pico vi and vim with no luck
scratch that word pad cant navigate the the cygwin directory and notepad doesnt track the cr newlines in .bashrc

pwc101 08-26-2008 04:58 PM

Quote:

Originally Posted by john test (Post 3260710)
is there an editor in cygwin?? I tried nano pico vi and vim with no luck
Never mind I see wordpad and notepad work sorry bout that

Probably best not to use notepad or wordpad as they might add windows line endings, which don't work in cygwin.

Think of the setup.exe file as a package manager rather than an installer in the traditional sense; it allows you to add packages to the system as well as install updates to the installed packages.

I find the cygwin default base install is very minimal, and always spend some time browsing the list to install all the things I think I'll need. Inevitably, I miss some things, but the setup.exe package manager is handy for adding extra packages.

The syntax for the ssh command is
Code:

ssh -X hostname
where hostname is the ubuntu box's name or ip address you're using to connect.

CRC123 08-26-2008 05:02 PM

Here ya go:

1. run Cygwin setup program
2. Click 'Next>'
3. Click 'Install from Internet' and click 'Next>'
4. Leave everything defaulted on next page and click 'Next>'
5. Leave Local Package Directory alone and click 'Next>'
6. Use whatever your internet connection is set to(Probably direct connection) and click 'Next>'
7. Pick whatever mirror works and click 'Next>'
8. Scroll down to 'X11' entry.
9. Click the space that is to the right of 'X11' until it says 'install' and then click 'Next>'
10. After it's done you know have the XWin program installed

1. Start cygwin shell, bash prompt, etc.
2. Type in 'startxwin.sh' and press enter
3. A new window should appear that is another shell prompt.

From here, you can either use command line ssh or putt:

Command line ssh:
Code:

ssh -X <username>@<serverURL>
and that will log you in.

Putty:
Open putty and goto 'Connection->SSH->X11'
On that page you need to make sure you always click 'Enable X11 forwarding' before you sign into your remote computer.

Good luck. If that doesn't work, get back to us! ;)

john test 08-26-2008 06:48 PM

OK I set up putty to do x11 forwarding -- i have two authentication choices and both fail
as below
gedit
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
cannot open display:

There is a block to the right which is for display location what goes there??

john test 08-26-2008 09:13 PM

Did a reload of cygwinX and still no gedit or other gui apps

CRC123 08-26-2008 11:23 PM

Quote:

Originally Posted by john test (Post 3260801)
OK I set up putty to do x11 forwarding -- i have two authentication choices and both fail
as below
gedit
Xlib: connection to "localhost:10.0" refused by server
Xlib: PuTTY X11 proxy: wrong authentication protocol attempted
cannot open display:

There is a block to the right which is for display location what goes there??

HMM. This is baffling me actually. Mine works without anything in that display location box.

Also, I tested turning X11 forwarding off in sshd_config and still got a different error.

The only thing I can think of would be a firewall blocking access one of the machines. Try turning firewalls off and see if that fixes it.

john test 08-27-2008 06:54 AM

Do you export the $DIPLAY?
What do you get on the suse cli if you type "echo $DISPLAY"?

CRC123 08-27-2008 08:21 AM

on my box:
Quote:

~> echo $DISPLAY
localhost:10.0
if yours is different try this:

Code:

export DISPLAY=localhost:10.0
See if that works


All times are GMT -5. The time now is 03:54 PM.