Created
March 28, 2022 14:02
-
-
Save irizwaririz/6ac50dc20f22836a8bb48422973c8bbc to your computer and use it in GitHub Desktop.
Batch script to instantiate Xserver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
start "" "C:\Program Files\VcXsrv\vcxsrv.exe" :0 -multiwindow -ac |
You might also encounter firewall issues when doing this with WSL2, refer to this on one way to solve the firewall issue:
https://www.youtube.com/watch?v=4SZXbl9KVsw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE: For WSL2, it might already use WSLg. So to disable it, add the following entry in the .wslconfig file (located at
c:\users\MyUser\.wslconfig
). This will turn off support for GUI applications in WSL.Sources:
https://github.com/microsoft/wslg#wslg-system-distro
https://www.reddit.com/r/bashonubuntuonwindows/comments/tc42tq/comment/i0daxht/?utm_source=share&utm_medium=web2x&context=3
Then we will need to set the
DISPLAY
environment variable as such:Source:
https://stackoverflow.com/a/66398613