LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-16-2008, 03:04 PM   #1
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Rep: Reputation: 35
X window Display issue


Vista PC trying to ubuntu box and execute Graphic applications from the Vista PC. I am running puTTY on the Vista PC and can ssh into the uxbox and do simple tasks such as ls nano etc.
In the cut and paste below is the export done correctly?
Why can't the command xhost open the display on the local mchine (Vista)?

root@johns-desktop:/home/johns# export DISPLAY=192.168.1.101:0.0
root@johns-desktop:/home/johns# xhost
xhost: unable to open display "192.168.1.101:0.0"
root@james-desktop:/home/james#

Thank you for your help
 
Old 09-16-2008, 03:09 PM   #2
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
maybe try 'xhost 192.168.1.X' on the windows box with the IP of the Linux box. this might work but I've never used putty.
 
Old 09-16-2008, 03:27 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,603
Blog Entries: 25

Rep: Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981Reputation: 1981
Hi,

'putty' is not a 'X' or graphical display terminal. 'putty' is a textual terminal.
 
Old 09-16-2008, 03:43 PM   #4
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
Quote:
Originally Posted by onebuck View Post
Hi,

'putty' is not a 'X' or graphical display terminal. 'putty' is a textual terminal.
You need to have a X server on both machines to get X forwarding to work.
 
Old 09-16-2008, 05:05 PM   #5
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
The original question was "Did I do the "export" right?".

IP addr on the Vista is 192.168.1.101 and IP on the uxbox is 192.168.1.124

Putty is a secure shell and is capable of doing gui across the LAN

I have seen it done, I just don't know how to do it
 
Old 09-16-2008, 05:10 PM   #6
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
Quote:
Originally Posted by johnson_steve View Post
You need to have a X server on both machines to get X forwarding to work.
if I can do "xhost +" or "xload" from the uxbox cli, I think I have X running on the ux box.
Don't I have to export the DISPLAY to the Vista box so that the graphices can be viewed on the box with that IP address?
 
Old 09-16-2008, 06:07 PM   #7
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
You don't need to export anything if your SSH client supports X forwarding. Putty supports it since version 0.52: you have to enable X11 forwarding and tunnels in the Putty configuration. But, as onebuck and johnson_steve already pointed out, you need an X server running on the windows machine, since Putty is only a SSH client. When you have a X server available, first you will launch it, then Putty. And every graphical application you launch on the remote server through Putty, will be displayed on the local X server.

Regarding the X servers for windows, most of them are commercial products (Exceed, Xwin-32, MI/X, and so on) and I don't know if there is something for free.
 
Old 09-16-2008, 06:20 PM   #8
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
Quote:
Originally Posted by john test View Post
if I can do "xhost +" or "xload" from the uxbox cli, I think I have X running on the ux box.
Don't I have to export the DISPLAY to the Vista box so that the graphices can be viewed on the box with that IP address?
In order for X forwarding to work DISPLAY must be set on the machine where you want the program to run and the 'xhost' command I gave you needs to be run so that the X server on the computer you want to display on allows the connection from the first box. If your ssh and sshd are set up right then 'ssh -X' should set these automaticly, but if you need to set it up yourself then exporting the DISPLAY variable is only half the battle.

Last edited by johnson_steve; 09-16-2008 at 06:22 PM.
 
Old 09-17-2008, 10:28 AM   #9
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
I have removed Vista from the mix. I now have a box runnig Ubuntu 6 trying to run graphic apps on a box with ubuntu7. So U6 is trying to access graphic apps on U7 over a lAN.
U6 does a SSH to U7 and becomes root on U7. U6 does a export $display=192.168.1.191:0.0 and an echo $DISPLAY shows 192.168.1.101:0.0 which is the ip address of U6
Both boxes are running X11 via "startx"

At the U6 keyboard as root on U7, I type "xhost" and I get the error message "xhost: unable to open display "192.168.1.101:0.0"

If I do "export DISPLAY=:0.0", the display goes to the U7 box and if I do "gedit notes" Gecit opens up over on the U7 display.

So that brings me back to the original question: As root on the U6 box, SSHed into the U7 box as root on U7, what do I type to redirect the display to the U6 monitor?

Thanks in advance for your time and assistance
 
Old 09-17-2008, 01:11 PM   #10
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
on U7:
'export DISPLAY=192.168.1.101:0.0'

on U6:
'xhost 192.168.1.124'

this should work but it isn't the proper way to do X forwarding.

Just try to ssh into U7 with:
'ssh -X 192.168.1.124'

if that doesn't work post the 'sshd_config' file from U7 (mine is in /etc/ssh/) and I can help you edit it to get it working.
 
Old 09-17-2008, 01:31 PM   #11
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
# Package generated configuration file
# See the sshd(8) manpage for details

# What ports, IPs and protocols we listen for
Port 22
# Use these options to restrict which interfaces/protocols sshd will bind to
#ListenAddress ::
#ListenAddress 0.0.0.0
Protocol 2
# HostKeys for protocol version 2
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_dsa_key
#Privilege Separation is turned on for security
UsePrivilegeSeparation yes

# Lifetime and size of ephemeral version 1 server key
KeyRegenerationInterval 3600
ServerKeyBits 768

# Logging
SyslogFacility AUTH
LogLevel INFO

# Authentication:
LoginGraceTime 120
PermitRootLogin yes
StrictModes yes

RSAAuthentication yes
PubkeyAuthentication yes
#AuthorizedKeysFile %h/.ssh/authorized_keys

# Don't read the user's ~/.rhosts and ~/.shosts files
IgnoreRhosts yes
# For this to work you will also need host keys in /etc/ssh_known_hosts
RhostsRSAAuthentication no
# similar for protocol version 2
HostbasedAuthentication no
# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication
#IgnoreUserKnownHosts yes

# To enable empty passwords, change to yes (NOT RECOMMENDED)
PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Change to no to disable tunnelled clear text passwords
#PasswordAuthentication yes

# Kerberos options
#KerberosAuthentication no
#KerberosGetAFSToken no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes

X11Forwarding yes
X11DisplayOffset 10
PrintMotd no
PrintLastLog yes
TCPKeepAlive yes
#UseLogin no

#MaxStartups 10:30:60
#Banner /etc/issue.net

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

Subsystem sftp /usr/lib/openssh/sftp-server

UsePAM yes
 
Old 09-17-2008, 01:38 PM   #12
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
Hmm. that looks right. and 'ssh -X 192.168.1.124' doesn't work?

post the 'ssh_config' file from U6 (this isn't the same file notice there isn't a 'd'.)
 
Old 09-17-2008, 02:19 PM   #13
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
THIS IS FROM U6

root@ubuntu:/etc/ssh# cat ssh_config
# $OpenBSD: ssh_config,v 1.21 2005/12/06 22:38:27 reyk Exp $

# This is the ssh client system-wide configuration file. See
# ssh_config(5) for more information. This file provides defaults for
# users, and the values can be changed in per-user configuration files
# or on the command line.

# Configuration data is parsed as follows:
# 1. command line options
# 2. user-specific file
# 3. system-wide file
# Any configuration value is only changed the first time it is set.
# Thus, host-specific definitions should be at the beginning of the
# configuration file, and defaults at the end.

# Site-wide defaults for some commonly used options. For a comprehensive
# list of available options, their meanings and defaults, please see the
# ssh_config(5) man page.

Host *
# ForwardAgent no
# ForwardX11 no
# ForwardX11Trusted yes
# RhostsRSAAuthentication no
# RSAAuthentication yes
# PasswordAuthentication yes
# HostbasedAuthentication no
# BatchMode no
# CheckHostIP yes
# AddressFamily any
# ConnectTimeout 0
# StrictHostKeyChecking ask
# IdentityFile ~/.ssh/identity
# IdentityFile ~/.ssh/id_rsa
# IdentityFile ~/.ssh/id_dsa
# Port 22
# Protocol 2,1
# Cipher 3des
# Ciphers aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,aes192-cbc,aes256-cbc
# EscapeChar ~
# Tunnel no
# TunnelDevice any:any
# PermitLocalCommand no
SendEnv LANG LC_*
HashKnownHosts yes
root@ubuntu:/etc/ssh#

Last edited by john test; 09-17-2008 at 02:20 PM.
 
Old 09-17-2008, 02:39 PM   #14
john test
Member
 
Registered: Jul 2008
Distribution: ubuntu 9.10
Posts: 527
Blog Entries: 1

Original Poster
Rep: Reputation: 35
with ssh -x 192.168.1.124
from U7 env output
SSH_CONNECTION=192.168.1.101 40049 192.168.1.124 22
 
Old 09-18-2008, 01:17 AM   #15
johnson_steve
Senior Member
 
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
change:

# ForwardX11 no

to:

ForwardX11 yes

and that is supposed to be a capital '-X' it makes a big difference.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to move a running window to a different DISPLAY? mtford Linux - Desktop 2 03-13-2007 06:32 PM
X-window display problem stof1982 Linux - Networking 5 10-19-2005 02:05 PM
X-window prob - don't understand 'DISPLAY' setting Steerpike Linux - Newbie 1 11-29-2004 08:07 AM
root window has no children on display :0.0 jax8 Linux - Newbie 2 04-15-2004 09:26 PM
window display turgay2000 Linux - General 1 12-18-2000 09:34 AM


All times are GMT -5. The time now is 07:19 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration