LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 11-10-2011, 11:04 PM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Rep: Reputation: 70
A question on the X window system...


Just wondering if this is possible. Say I have two computers, Server A and Server B, both on the same network.
Server A: 192.168.1.2/24
Server B: 192.168.1.3/24

On Server A, I setup a user's X with "xhost 192.168.1.3"
On Server B, I setup another user's X with "xhost 192.168.1.2"
So this gives the user on Server A permission to open windows on Server B and vice versa.

Now when I'm on Server A, is there a way I can open an X window on Server B?
Something like
Code:
xclock -display 192.168.1.3:0
Can I do that? What's the correct syntax if so?
Would be neat to do the following from Server A
Code:
xmessage -display 192.168.1.3:0 "hey don't forget to bring the book"
Sure you can always text but this would be way more fun.

Also if this is possible, and Server A and Server B were on different networks and both behind NATd environments, which port would I have to forward on each router's end?

Last edited by trist007; 11-11-2011 at 08:26 AM.
 
Old 11-11-2011, 09:27 AM   #2
camorri
LQ 5k Club
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 15.0, current, slackware-arm-currnet
Posts: 6,214

Rep: Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849Reputation: 849
You can run an x application over ssh.

See this tutorial,it explains it.

-->http://www.linuxquestions.org/linux/...display_export
 
Old 11-11-2011, 09:55 AM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,052

Original Poster
Rep: Reputation: 70
Yes I know x11 forwarding via SSH. However, what I'm trying to do is similar but has one major distinction. I'm trying to do that without having to ssh into the host.

Also, two more questions in addition to my original post.

1. I can make an X sessions at display :0, :1, :2, etc. How would I switch from :0 to :1, to :2, etc?

2. What is the command to display all the X sessions with their displays and what is the proper way to terminate those sessions?
 
Old 11-11-2011, 09:56 AM   #4
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS,Manjaro
Posts: 5,613

Rep: Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695Reputation: 2695
xserver tricks

Sure you can, and you do not need ssh. (USE ssh if you are going over the internet. Xprotocols themselves are not secure!)

On each host you need to run a command to make your xwindows accept the connections from the other server, as such are blocked by default. See 'man xhost' for details.

You do NOT want to set your environment variable, just use the --display option on the command lines. Otherwise when you open ANY X program it will go to the other desktop and you will not be able to use it (bummer).
 
Old 11-11-2011, 10:48 AM   #5
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 202

Rep: Reputation: 36
Since you only started X, you will need xdm running and setup to accept remote connections. Check documentation here, you wilL need to change the line

DisplayManager.requestPort: 0

and comment it

!DisplayManager.requestPort: 0,

Once you have done that, you will be able to launch an xclock on one machine and display it on the other.

Last edited by rodrifra; 11-11-2011 at 11:13 AM.
 
  


Reply



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
Creating a Fixed Window Size in a Window Manager (Odd Question) Stupac Programming 3 06-30-2011 04:04 AM
What's the best X-Window System window manager in your opinion? t3gah Linux - Software 9 12-16-2006 10:10 PM
why mandriva 10.2 gnome2.8 system freezes upon resizing/opening window/new window skaramanger Mandriva 8 08-30-2005 10:22 AM
why mandriva 10.2 gnome2.8 system freezes upon resizing/opening window/new window skaramanger Mandriva 2 08-15-2005 04:38 PM
dumb X-window system question rusty_slacker Linux - Newbie 1 11-17-2004 05:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:36 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
Open Source Consulting | Domain Registration