How to export display from Linux to FreeBSD

by on February 7, 2006 · 0 comments· Last updated March 10, 2009

The process is extremely simple all you need to understand is configuration file modification. X Window System use TCP port 6000 to listen network connection. By default almost all operating system including FreeBSD turns off this feature for security reason. Because of this setting you are not allowed to remotely open a window. Let us assume your setup is as follows:

+--------------------+---------------------+
|Linux system        |  FreeBSD system     |
+--------------------+---------------------+
|IP: 192.168.1.2     |  IP:   192.168.1.16 |
+--------------------+---------------------+

You would like to export display from Linux to FreeBSD.

Step # 1: FreeBSD server startx
To enable this feature, you need to run startx command with the optional -listen_tcp:

$ startx -listen_tcp

Step #2: Allow client system to connect
You need to use xhost command, which is server access control program for X. The xhost program is used to add and delete host names or user names to the list allowed to make connections to the X server. For example to allow IP address 192.168.1.2 (our Linux system) you need to type command as follows:

Open X terminal and type command

$ xhost +192.168.1.2

Step #3: Export display from Linux to FreeBSD system (type all of the following commands at Linux system)
At your Linux system type following command to export display

$ export DISPLAY=192.168.1.2:0

Step #4: Start program

$ xeyes
$ xterm &
$ mozilla &

All of above three programs are now open on FreeBSD desktop system.
If you have a FreeBSD IPFilter firewall then add following rule to your FreeBSD firewall script:

pass in quick on lnc0 proto tcp from 192.168.1.2 to 192.168.1.16 port = 6000 flags S keep state

Above rule will allow TCP Port 6000 connection from Linux system to FreeBSD system. Make sure you replace lnc0 interface and IP address with your actual interface and IP address. Just restart IPFilter as follows:

# /etc/rc.d/ipfilter restart

Please note that above procedure is same even if you use OpeBSD or or any other Linux distro.



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 0 comments… add one now }

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 11 + 14 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: