where to put -listen tcp?

I'm wanting to play with displaying an x application running on one machine on the screen of another. Across my home lan. No security concerns.

I have two laptops, one with xubuntu, one with freebsd.

I can run xeyes, as an example application, on the freebsd machine and see the display on the ubuntu machine. To make this work, To tell the x server on the ubuntu machine to listen on its default port. I've edited
/usr/bin/X11/xserverrc
and change -nolisten tcp to -listen tcp.

Where do I make the equivalent change to make the X server on the freebsd machine listen on the default port 6000? From the manual, I'm guessing somewhere in /usr/local/etc/X11.

I've seen posts elsewhere saying to use startx with a parameter
#startx -listen tcp
but the server shuts down if I use that command.
 
Thanks hruodr,

I'm starting the X server by calling xinit.
/usr/local/bin/X on my system is just a link to /usr/local/bin/Xorg
Looking at man pages for Xorg I can see that it has a -listen parameter

But how does your ~/.xserverrc work?
Does it not call Xorg?
I thought xinit had done that already.
 
But how does your ~/.xserverrc work?
Does it not call Xorg?
I thought xinit had done that already.
xinit calls the server you give in ~/.xserverrc, including the flag.
This is described in man xinit.

But you can give a server and options in the command line.

ok, I've got it working!
#xinit -- -listen tcp

X, that is a link to Xorg, is the default X server, and it seems you gave an option to the default.
 
I'm wanting to play with displaying an x application running on one machine on the screen of another. Across my home lan. No security concerns.
I had once a strange experience. Perhaps you can test it.

I opened in my FreeBSD PC with X an xterm of an OpenBSD computer. In both computers I had firefox.
I typed in the xterm of OpenBSD firefox expecting that it will run the firefox of OpenBSD, it is an xterm
running on OpenBSD with shell of OpenBSD for running programs in OpenBSD. Well, it run the firefox of
FreeBSD, or opened a new windows of the firefox of freeeBSD I run.

Really annoying experience. Of course, firefox is far away of beeing a unix program, but how it was possible?!

EDIT:

It seems, here is an answer:


 
I had once a strange experience. Perhaps you can test it.
My two test machines are Ubuntu 20.04.6 LTS and FreeBSD 14.1-RELEASE. Once listen tcp and xhost are correctly set:

Invoked from an xterm on the bsd machine, xeyes, xclock, chrome and firefox all display correctly on the ubuntu machine.

Invoked from an xterm on the ubuntu machine, xeyes, xclock and chromium all display correctly on the FreeBSD machine, but NOT firefox. Firefox displays on the screen of the same ubuntu machine where it was invoked.

Interesting. I'll have a look at the link you give.

I'm using Mozilla Firefox for Ubuntu 126.0.1 (64-bit)
 
Invoked from an xterm on the ubuntu machine, xeyes, xclock and chromium all display correctly on the FreeBSD machine, but NOT firefox. Firefox displays on the screen of the same ubuntu machine where it was invoked.
Thank, but I do not understand 100%.

You know, X11 is a client/server system.

The server runs where you see the windows, the clients run perhaps on other computers, are xterm, xeyes, firefox.

You sit for example in front of a FreeBSD machine with X11 server running, you may start an xterm that runs on
other machine, but displays on the FreeBSD, with DISPLAY variable set to the FreeBSD machine,
when you start a client from there, it runs in the remote machine, but displays in the FreeBSD machine.

Well, not 100%, firefox does not that. Terrible! Do you recognise where your firefox is running and where is displayed?
 
Do you recognise where your firefox is running and where is displayed?

For my experimentation, I have 2 physical machines in front of me. Not virtual machines.

I start an xterm on the FreeBSD machine. I'm not connecting to the FreeBSD machine via SSH, I'm typing directly at its keyboard. I set the DISPLAY variable and then in the same xterm window start firefox. Firefox appears on the Ubuntu machine.

Repeating the same process the other way around, ie via the keyboard of the Ubuntu machine, invoking firefox from an xterm does not result in firefox appearing in the FreeBSD machine. Instead, it appears on the display of the Ubuntu machine.

Unlike firefox, other x applications I've tested behave symmetrically.

Hope that explanation is better.
 
Back
Top