# Can I use julia from Windows Subsystem for Linux in VS Code Julia Extension

**URL:** <https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106>\
**Category:** Tooling\
**Tags:** vscode\
**Created:** [November 13, 2020, 6:26pm UTC](https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106 "2020-11-13T18:26:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![peregrinrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peregrinrm/32/6441_2.png) [@peregrinrm](https://discourse.julialang.org/u/peregrinrm)\
**Post date:** [November 13, 2020, 6:26pm UTC](https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106/1 "2020-11-13T18:26:21Z")

</div>

Hello there,

Is there a way to make the julia vscode extension use the julia from the WSL? I have already setup the integrated terminal so that it opens the zsh in the WSL Ubuntu, but the julia extension seems to find only the windows julia.

TIA,

Rodrigo

---

<div class="post-metadata">

**Author:** ![affans](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/affans/32/11911_2.png) [@affans](https://discourse.julialang.org/u/affans)\
**Post date:** [November 13, 2020, 6:33pm UTC](https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106/2 "2020-11-13T18:33:24Z")

</div>

Yes, this is how my workflow is setup. First, obviously install Julia on WSL2 and make sure your julia binary is in `PATH`. I would also get rid of your Windows Julia installation as to avoid any conflicts. From the vscode side (assuming its installed on windows), simply download the WSL extension and configure it (basically just open up a folder on your WSL 2 instance). Once you have vscode successfully configured with WSL2, download the Julia extension. Make sure to install this julia extension on the "remote " instance of vscode – see my image example below. This should pretty much be it.

Here’s how my extensions look like in VS Code:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/c/9ce4f26cbadad35c9d29e02b1af7fae762562456.png)

---

<div class="post-metadata">

**Author:** ![peregrinrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peregrinrm/32/6441_2.png) [@peregrinrm](https://discourse.julialang.org/u/peregrinrm)\
**Post date:** [November 14, 2020, 5:07pm UTC](https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106/3 "2020-11-14T17:07:17Z")

</div>

It worked like a charm. Thank you very much!

Best,

Rodrigo

---

<div class="post-metadata">

**Author:** ![eliassno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eliassno/32/18917_2.png) [@eliassno](https://discourse.julialang.org/u/eliassno)\
**Post date:** [February 19, 2021, 1:16pm UTC](https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106/4 "2021-02-19T13:16:40Z")

</div>

Thanks for the solution @affans!  
Now I need to take it a step further.

From a laptop at work, I need to remotely use Julia on WSL2 on my Windows desktop at home.  
I’ve managed to set the integrated terminal to use bash (WSL Ubuntu) when using [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh), but the Julia extension is searching for the executable on the Windows side.

The julia binary is in PATH (`/mnt/c/Users/elias/Software/julia-1.5.3/bin`) on WSL, but I haven’t done the same on the Windows side.

How should I approach this? Can I configure which platform (WSL vs Windows) the Julia extension is run on when using Remote - SSH?

---

<div class="post-metadata">

**Author:** ![eliassno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eliassno/32/18917_2.png) [@eliassno](https://discourse.julialang.org/u/eliassno)\
**Post date:** [February 23, 2021, 11:40am UTC](https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106/5 "2021-02-23T11:40:01Z")

</div>

The issue was that the default shell for OpenSSH wasn’t configured properly (the VS code extension still used CMD instead of bash after connecting to the server). Apparently, setting `RemoteCommand bash` in `.ssh/config` is not enough 🤦‍♂️

I resolved the issue by following [these instructions](https://gist.github.com/mattbell87/f5bd7b78c8d0ad7f0dfc3addae4f4897). They are inspired by [this short blog post](https://www.hanselman.com/blog/the-easy-way-how-to-ssh-into-bash-and-wsl2-on-windows-10-from-an-external-machine), which is worth a read.

* * *

**TL** ; **DR** : Run

```nohighlight
New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\WINDOWS\System32\bash.exe" -PropertyType String -Force

```

in a Powershell session on the Windows server.
