Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 872 Bytes

x-window-with-wsl2.md

File metadata and controls

27 lines (20 loc) · 872 Bytes
tags title layout
winconfig
wsl
X Window with WSL2
note.html

{{ title }}

This was actually pretty straightforward:

  • Install VcXsrv on Windows. (I used cinst vcxsrv.)
  • Install X apps on Linux. (My first use case was OWASP ZAP.)
  • Set an environment variable on Linux that references the Windows host by its IP address.

The last step is arguably the hardest. It looks like this:

export DISPLAY=$(/sbin/ip route | awk '/default/ { print $3 }'):0

For more information about that, see WSL2 Networking.

Run VcXsrv, choose no startup program. You get the most seamless experience by choosing multiple windows. Now just run the X clients on Linux from a shell window, and they should display on your Windows desktop.

References