Configuring X forwarding between BSD and Windows

On Unix systems, windowing systems are an optional component. There are numerous window systems but the most prevalent, as I understand it, is X. It’s a networked client/server model, where the machine with the display and input devices is called the server, and the machine running windowed apps against this server is the client. This is backwards from how you typically think about clients and servers, i.e. servers are usually headless and clients are usually responsible for rendering data from servers and translating input.

I usually interact with my BSD machine from my Windows laptop using PuTTY. But running Emacs in a terminal window is sometimes hard on the eyes, it’s hard to get good fonts, color schemes, etc. I wanted to see if I could launch Emacs from PuTTY but have it render its UI over the X protocol on my Windows laptop. This was harder than I thought, and I didn’t find any step-by-step tutorial to help me troubleshoot, so here’s an account of what worked for me. Note that I started from a relatively clean install of FreeBSD 10.1, with only sshd and some basic packages installed.

To prepare the BSD machine for acting as an X client, I had to install the xauth package:

$ sudo pkg install xauth

The only visible result of this is the addition of the DISPLAY environment variable in upcoming SSH sessions, set to its default localhost:10.0.

Now to set up the X server, i.e. my Windows laptop. First I installed Xming from SourceForge. I opted not to include any bundled PuTTY, as I already had it installed.

Then I configured the PuTTY connection to my BSD machine to do X11 forwarding, see screenshot below:

PuTTY X11 forwarding configuration

PuTTY X11 forwarding configuration

(don’t forget to save that setting on the connection in question.)

I installed the xterm package on my BSD machine to have a simple app to test this setup. Here’s what the workflow looks like to run an X application on the BSD box showing its UI on the Windows side:

  • Connect with PuTTY, using a connection with X11 forwarding
  • Start Xming on the Windows box (this is the X server responsible for rendering the UI of the remote app)
  • Start the application from the shell, e.g.
$ xterm

After a short delay, the xterm application should show a window on the Windows desktop. Note that the app is executing on the BSD box, but showing its UI over the networked X11 protocol via Xming on Windows.

Now I just need to figure out how to set up nicer fonts and coloring in this environment.

3 thoughts on “Configuring X forwarding between BSD and Windows

  1. […] Configuring X forwarding between BSD and Windows.  (via) […]

  2. […] wrote earlier about how to set up X forwarding between FreeBSD and Windows. Unfortunately, once all that was done, my Emacs came out looking like […]

Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut / Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut / Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut / Ändra )

Google+ photo

Du kommenterar med ditt Google+-konto. Logga ut / Ändra )

Ansluter till %s