Display Forwarding UNIX Using X11 on macOS

Red Hat apps Firefox and xClock are executed on macOS using XQuartz X11 forwarding

There are so many things that we can do within a UNIX operating system and I just wanna share how to forward UNIX application’s display from host to our local. Maybe we have heard about SSH (Secure Shell) and it is a standard method to remote an UNIX host. In case we can’t access the host directly of course. But how to run an application from an UNIX host? Is that possible? Yap, the answer is possible.

For my case, I’ve a MacBook Pro that pre-installed with macOS High Sierra. To remote an app from an UNIX host, we need to install XQuartz for display forwarding and emulate the forwarding app on our macOS. Easy like a piece of cake, just simply download the package from here. After we’ve installed the package, need to logout our macOS and re-login. And that’s it, the main requirement is installed.

For the next step is a little bit more tricky, we need to make sure that “/etc/ssh/sshd_config” in UNIX host is well configured. Run this command on UNIX Host terminal :

cat /etc/ssh/sshd_config

Check these properties :

  • X11Forwarding is set to “Yes”
  • X11UseForwarding is set to “Yes”

If we don’t see that properties or the value is set to “No” or maybe the properties are commented, we need to modify the sshd_config using vi command or another file editor. Then if you see the properties are well configured, we may try to remote that UNIX host using additional ssh attribute. Try to run this command on our macOS terminal to remote the host using display forwarding option (-X).

ssh user@remotehost -X

Then we may try to run a simple apps from the host, in example clock apps just by using this command on macOS terminal.

xclock

If we have Firefox installed in host machine, we may try the Firefox browser also.

firefox

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s