# X11 Forwarding



## Phishfry (Oct 8, 2017)

I want to mess with X Forwarding and I have an application runing on debian or ubuntu desktop I want to run on FreeBSD xfce4.

I have not heard many people talk about x Forwarding. Is it a viable way to run a Linux program on FreeBSD desktop?

Is xauth going to work cross platform?

Anybody try this lately? Most tutorials are rather old.
This seems to be informative on the topic. No mention of FreeBSD.
https://unix.stackexchange.com/ques...ver-ssh-to-run-graphics-applications-remotely


----------



## aragats (Oct 8, 2017)

I run applications on remote desktop via `ssh` almost every day, it doesn't matter whether it's FreeBSD or Linux and in what direction.
Of course, you have to have it enabled in /etc/ssh/sshd_config: `X11Forwarding yes`, I guess, it's so by default.
On the client side I use `ssh -XY`. You probably don't need both *-X* and *-Y* at the same time for any particular case, but I prefer to have them as a universal approach. You may also want to use _*-C*_ switch to compress data, check with ssh(1). There are some specific cases when you may need extra tweaks, for example, certain Qt programs may require to `export QT_GRAPHICSSYSTEM=native` on the server side, otherwise they display just a blank window on remote desktop.


----------



## Phishfry (Oct 8, 2017)

Can you have a headless X machine serving up apps? For instance debian on headless APU2 serving X applications to FreeBSD xfce machines?

How about speed? Can you play videos? Use the web browser? Does it lag or is it seemless over a local network?

So if I am reading this right X-Forwarding over ssh is for a single app but XDMCP does the whole desktop. Is that right?


----------



## aragats (Oct 8, 2017)

Phishfry said:


> Can you have a headless X machine serving up apps?


Sure! You don't even need an X server running on the "app server".


Phishfry said:


> How about speed? Can you play videos? Use the web browser? Does it lag or is it seemless over a local network?


Well, everything but videos is okay. High resolution videos consume huge bandwidth, they are better served in a different way: mount the remote filesystem locally (NFS, SMB etc.) and play video files which are compressed very well. In other words, a file transfer over the network consumes 300-400 times less bandwitdh. The math is simple: an HD video played at 30 fps takes 1920x1080x30x3bytes/px = 180MB/s bandwidth.

I haven't tried XDMCP, but as per https://wiki.ubuntu.com/xdmcp:
«XDMCP uses a large amount of bandwidth because it uses no compression»


----------



## debguy (Oct 17, 2017)

this is very simple, no need for "any VNC products" or anything - it's been built into Xerox Windows since the 1980's, network transparency...

first: make sure  --no-tcp was not used starting Xorg (you need it, and note RedHat is wrong - --no-tcp only blocks local connections NOT remote ones).  firewall ports X uses (6000 something) or use a vlan or something.

# do this after logging into X desktop on HOST_A
HOST_A: xhost +inet:HOST_B
HOST_A: ssh HOST_B
HOST_A@HOST_B: export DISPLAY="HOST_A:0"
HOST_A@HOST_B: netscape &
# you now have HOST_B running netscape which is displayed on HOST_A's desktop

this works on all X11 servers and clients, and it does not matter what OS they run !!  (if it doesn't, then someone lied to you about their version number, they are hacks).  (note: xorg is not X11 compatible it screws up costly X11 apps a little, but mostly kinda works you hope) (X11 is also arch independant, however if your going 32 on one side 64 on other expect you could run into needed work-arounds for some apps)

(if you want GL graphics that's possible but you'll have to read up on a "good way" to make it perform)

Xnest(1) can allow a different way of doing things (a (remote) desktop in a window on a desktop), however running it is beyond this little post.


----------



## SirDice (Oct 17, 2017)

debguy said:


> it's been built into Xerox Windows since the 1980's,


The X in X11 and X.Org has nothing to do with Xerox. X was developed by MIT and the X was the next letter after V and W (previous project names). Similar to "C" being the next iteration of "B". The correct name is "X Window System".

Xerox is largely considered to be the first to implement a desktop like GUI but it had very little to do with X.


----------

