How to export display from Linux to FreeBSD

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:     |  IP: |

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 (our Linux system) you need to type command as follows:

Open X terminal and type command

$ xhost +

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=

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 to 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.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one
CategoryList of Unix and Linux commands
Disk space analyzersdf ncdu pydf
File Managementcat tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum