Link to home
Start Free TrialLog in
Avatar of sundeepgopal
sundeepgopal

asked on

how to use X from remote

how to use X from remote ?  I just want to know the command to use the remote linux machine .

when I type xhost from ssh it gives  "unable to open the display"
SOLUTION
Avatar of DonConsolio
DonConsolio
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wikipedia (http://en.wikipedia.org/wiki/X11) provides a short introduction to X11
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sundeepgopal
sundeepgopal

ASKER

hey DonConsolio,
Could you please tell me what is 10.0.0.100 ??
where to use the following commands?/
----------------------------
$ DISPLAY=10.0.0.100
$ export DISPLAY
$ xterm &
$ xterm -display myserver2:0.0 &
-----------------------------
where to use this
----------------------------
$ xhost +10.0.0.101
$ xhost myclient1
-----------------------------  
I'm confused and have no idea about it ,please tell me in detail
thanks
Hi,

You don't need to export the display if you are using ssh...

ssh -Y <client>

of if that isn't working

ssh -X <client>

Then all you X stuff should work... (try issuing xterm on the connected target)

This does require you to have an X compatible desktop that you are running from. If you are running from Windows you need to get a X-server...

//jonas
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> how to use X from remote ?  I just want to know the command to use the remote linux machine .

> when I type xhost from ssh it gives  "unable to open the display"

"from remote" is not exactly a technical description of your problem :-)

are you looking for a way to tunnel a X session through ssh  or are
you trying to start a remote x program ?

in general you have to:
1) find out the names or IP addresses of "client" and "server" (see above)
2) on client:
- set $DISPLAY variable to server - client needs to know where to send output
(if you don't know how to set a variable just ask)
- then start your program
3) on server:
- allow client to connect - usually using the "xhost +name_of_client" command


sample session:
server name: asterix
client name: obelix

-------------------------------------------------------------------------------
don@asterix > echo $DISPLAY  ### show server name
asterix:0.0
don@asterix > xhost +obelix $DISPLAY  ### allow obelix to connect
obelix being added to access control list
don@asterix > ping -c 5 obelix   ### verify network connection
PING obelix (10.0.0.1) 56(84) bytes of data.
64 bytes from obelix (10.0.0.1): icmp_seq=1 ttl=64 time=0.151 ms
64 bytes from obelix (10.0.0.1): icmp_seq=2 ttl=64 time=0.149 ms
64 bytes from obelix (10.0.0.1): icmp_seq=3 ttl=64 time=0.181 ms
64 bytes from obelix (10.0.0.1): icmp_seq=4 ttl=64 time=0.179 ms
64 bytes from obelix (10.0.0.1): icmp_seq=5 ttl=64 time=0.180 ms

--- spice.int.ops.co.at ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4002ms
rtt min/avg/max/mdev = 0.149/0.168/0.181/0.014 ms
don@asterix > ssh -l don obelix ### log on to client
Password:
don@obelix > DISPLAY=asterix:0.0
don@obelix > export DISPLAY
don@obelix > xterm # start my program

-------------------------------------------------------------------------------