Skip to main content
//Let's learn Something New.ROBOTICS · EMBEDDED SYSTEMS · RESEARCH
Preferences
PERSONALIZE YOUR VIEW
Appearance & reading

Choose how you explore the notebook.

QUICK THEMES

How to set up working X11 forwarding on WSL2

Share
Share this article Facebook

 This tutorial is about properly setting up WSL2 X11 forwarding on Windows and Linux distro


  1. Add the following to your ~/.bashrc: 
    export DISPLAY=$(awk '/nameserver / {print $2; exit}' /etc/resolv.conf 2>/dev/null):0 export LIBGL_ALWAYS_INDIRECT=1
  2. Enable Public Access on your X11 server for Windows.*
  3. Add a separate inbound rule for TCP port 6000 to the windows firewall in order to allow WSL access to the X server, as described by the wsl-windows-toolbar-launcher people.
On the Ubuntu Wiki page about WSL you can already find a configuration adapted for WSL2 under Running Graphical Applications. A similar configuration is also suggested by the above mentioned Reddit User, who also contributes another part of the solution: Enable Public Access on the X11 server under Windows.
THE DISCUSSION

Comments

Ask a question, share a result, or add something useful.

0

Be the first to comment.Start the conversation below.