The purpose of this page is to provide Windows Subsystem for Linux (WSL) users guidance on how to use X Window System (X11; X) forwarding with Teton.

X11 is a great tool for interactively viewing R plots, dialogue boxes, etc. on Teton. Unfortunately, X11 does not work with WSL "out of the box." However, it is still possible to use X11 with WSL, with a couple of modifications. Thankfully these modifications are relatively easy to implement.

Approximate time to complete: 5-20 minutes.

This tutorial makes the following assumptions:

  1. You already have WSL installed. If you don't have it installed, please refer to the Using Windows Subsystem for Linux page.
  2. You are using Ubunutu (a version of Linux). Many of the commands and instructions will likely work on other distributions of Linux, but I have not explicitly tested these instructions for other distributions.
  3. You have a Teton account. If you do not have an account, then you will either need to be added to an existing project, or request a new project (with permission from your PI). For more information: https://uwyo.teamdynamix.com/TDClient/Requests/ServiceCatalog?CategoryID=3339

It is recommended that you read through the sections below before executing any of the instructions.

A comment on X11 servers/programs

To get X11 working, you need some form of X server (honestly, I'm not entirely sure what an "X server" is, but using one works). There are a couple of free options, but I'm going to focus on Xming (we will get to installing the program in a moment). I tried using Cygwin X, another X server program, but found the documentation and options a bit overwhelming and confusing. I thus abandoned Cygwin X for the much simpler Xming (simpler in terms of installation, at least). If you would like to add instructions for alternative server installations, feel free to do so. This is intended to be a living document.

Instructions

Part 1. Installing Xming

In this section, I will provide a step-by-step for installing the Xming program, which will act as our X server. Conceptually, it "looks" for graphical output from a Linux command (which WSL won't understand) and converts that output into something Windows can display.

 


Congrats! That was probably the hardest part of this entire exercise.

Part 2. Configuring WSL to work with Xming

Now what we are going to do is make sure that sure that our X11 Server is properly configured to work with WSL. This means configuring our display.

That's it!

Part 3. Testing X11/Xming locally

Now we are going to test our X11 connection locally. To do that we'll download some extra X11 applications to run.

Note: While Xming is running you cannot do anything in WSL's terminal. That is, before you can execute any other commands, you have to exit out of xeyes by clicking the "X" in the upper right hand corner of the pop-up window.

Note: In this case you may get en error in the terminal to the effect: "Warning: Missing charsets in String to FontSet conversion". As far as I can tell, this warning is harmless.


Part 4. Testing X11/Xming on Teton

Alright, so now that we've successfully installed, configured, and tested Xming on our local machine, let's see if the setup works with Teton.

Firefox

R

SWEET MAMA JAMA, IT WORKED!

You now have X11 forward setup for use with WSL.

Additional resources

Here are the main websites I used to develop this tutorial.

Related articles

The content by label feature displays related articles automatically, based on labels you choose. To edit options for this feature, select the placeholder below and tap the pencil icon.



Related issues