Using TexStudio with Texlive from Ubuntu on WSL

TexStudio is a flexible Latex editor that can integrate with different tex distributions. In the past, I have used TexStudio with the Texlive distribution from Cygwin. Since Windows 10 is now providing native support for Linux through WSL, it seems only natural to try to use Ubuntu's Texlive distribution instead. This, however, requires a little bit of manual configuration:

1. After enabling WSL and getting Ubuntu from the Microsoft Store, open a shell and install texlive with sudo apt install texlive-latex-recommended.

2. Find the paths of the bash.exe in your Windows folder, i.e. cd \Windows and dir /s bash.exe. This should deliver two results, one under \Windows\System32 and one under \Window\WinSxs.

3. Copy the path name under \Windows\WinSxs and open the TexStudio settings page to configure the tex distribution.

4. On the settings page wrap every tex command used by TexStudio as follows: c:\Windows\WinSxs\...\bash.exe -c "<command>"

5. Check whether everything is working as expected, e.g. by compiling a document.

6. In case you are receiving errors due to missing packages, you might want to install the texlive-latex-extra package as well by running sudo apt install textlive-latex-extra in Ubuntu's bash.


Bash Location

TexStudio Setup