Skip to main content

How to set up working X11 forwarding on WSL2

 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.

Comments

Popular posts from this blog

How to Play a Sound After a Terminal Command Completes

  Sometimes, while working on the terminal, especially during long-running processes, it’s useful to have an audible notification when the task is finished. In this guide, we’ll show you how to make your terminal play a sound after any command completes, ensuring you're alerted without constantly checking the terminal. Why Do This? This trick can save time and improve workflow, especially when: You’re running lengthy build processes or installations. You’re waiting for large file transfers. You're programming embedded systems and need confirmation when flashing is done. Let’s dive into how to do this on a Linux system. Step-by-Step Guide to Playing a Sound After a Command 1. Using paplay or aplay to Play Sounds On most Linux distributions, you can use paplay or aplay to play sound files directly from the terminal. Here's how you can append a sound notification after a command. Basic Command Structure : PC:~$ your_command && paplay /path/to/soundfile.oga  Or, if...

Heating with Electric Radiators

You want to heat your small garage using a couple of electric radiators. The power and voltage requirements for each radiator are 1200 W, 240 V. But you are not sure how to wire the radiators to the power supplied to the garage. Should you use the wiring diagram on the left or the one on the right? Does it make any difference?

Building a Robot Actuator with ESP32 and a 5010 BLDC Motor

Introduction Modern robotics demands actuators that aren’t just strong, but also smart — capable of precise control, smooth motion, and safe human interaction. Traditional servos are great for small robots, but they can be stiff, noisy, and limited in range or torque. This project demonstrates a custom robot actuator built around a 5010 360 KV brushless DC (BLDC) motor , controlled by an ESP32 running the SimpleFOC library. The goal is to create a compliant joint — one that can be moved by hand, but automatically returns to its home position with adaptive stiffness. 🧠 What Makes This Actuator Special Unlike a typical servo, this actuator behaves intelligently : You can turn it by hand — it feels soft and back-drivable. When you release it, the motor returns to its initial position smoothly. If you twist it harder (e.g., due to gear reduction), it becomes stiffer , resisting displacement more strongly. It’s powered by 12 V and controlled by a simple ESP32 boar...