Skip to content

Instantly share code, notes, and snippets.

@tautomer
Last active November 3, 2019 02:43
Show Gist options
  • Save tautomer/bdc703c33e271919d708a8b33fe37448 to your computer and use it in GitHub Desktop.
Save tautomer/bdc703c33e271919d708a8b33fe37448 to your computer and use it in GitHub Desktop.
Launch VcXsrv from WSL at Startup

Add the following line of Python code to you dot files, like .profile, .bashrc, .bash_profile, .zshrc, etc.

python -c 'import subprocess as sp; p=sp.Popen(["/mnt/c/Program Files/VcXsrv/vcxsrv.exe", ":0", "-ac", "-terminate", "-lesspointer", "-multiwindow", "-clipboard", "-wgl", "-silent-dup-error"])' 2>/dev/null
  • VcXsrv.exe is assumed to be installed in C:\Porgam Files. Change it if it is not the case.
  • For safety, I am using Python 2 here. Feel free to change it to Python 3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment