LinuxQuestions.org
Visit Jeremy's Blog.
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-11-2011, 12:04 AM   #1
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Rep: Reputation: 69
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 09:26 AM.
 
Old 11-11-2011, 10:27 AM   #2
camorri
LQ Guru
 
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
Posts: 5,117

Rep: Reputation: 494Reputation: 494Reputation: 494Reputation: 494Reputation: 494
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, 10:55 AM   #3
trist007
Senior Member
 
Registered: May 2008
Distribution: Slackware
Posts: 1,033

Original Poster
Rep: Reputation: 69
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, 10:56 AM   #4
wpeckham
Senior Member
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, Fedora, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, Vsido, tinycore, Q4OS
Posts: 1,793

Rep: Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618
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, 11:48 AM   #5
rodrifra
Member
 
Registered: Mar 2007
Location: Spain
Distribution: Debian
Posts: 201

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 12:13 PM.
 
  


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


All times are GMT -5. The time now is 06:17 PM.

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