How to set up working X11 forwarding on WSL2

前端 未结 14 2288
灰色年华
灰色年华 2020-12-12 12:09

When moving from WSL1 to WSL2 many things change; apparently this applies to X11 forwarding as well.
What steps do I need to make in order to use X11 forwarding with WSL

14条回答
  •  余生分开走
    2020-12-12 12:43

    I'm not sure why but none of the above answers worked for me. I'm running on an ROG Zephyrus with AMD and Nvidia graphics which I'm sure caused issues.

    The firewall settings described by whme are important, but the linux environment variables did not work for me. I had several entries in the config file labeled as nameserver, non of which allowed connections.

    I ended up setting them to:

    export DISPLAY=$HOSTNAME:0.0
    export LIBGL_ALWAYS_INDIRECT=
    

    I'm using VcXsrv as the X-server. I had to also set the parameters to -nowgl

提交回复
热议问题