DEV Community

Cover image for The Ultimate Guide πŸš€ To Use VS Code With Windows Subsystem for Linux (WSL)πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

The Ultimate Guide πŸš€ To Use VS Code With Windows Subsystem for Linux (WSL)πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Ajeet Yadav on February 16, 2020

Originally published on my blogging site ajeet.dev Don't forget to subscribe to my weekly Newsletter πŸ“§ I am a newbie in tech. I have been u...
Collapse
 
thomasferro profile image
Thomas Ferro

I'm looking forward to try this all out! Tomorrow will be my first day of work in a Windows environment since two years and I think it is a great opportunity to use this feature.

Thanks for the article, good read :)

Collapse
 
ajeet profile image
Ajeet Yadav

Thank you for your comment Thomas πŸ™‚
Hope my post help you get started with WSL. All the best

Collapse
 
timolesanmann profile image
Tim-Ole Sanmann

Nice article! Thank you!
I used to do it in a different way. After installing WSL, I created a soft link from www folder to my local project folder via /mnt/d/, what made it possible to work on my local folder without doing any connections. Does your way have any adventages compared to my way?

Greeting, Tim :)

Collapse
 
jeikabu profile image
jeikabu

The differences can be subtle and depend on your toolchains and plugins. Probably the most obvious thing is the VSCode integrated terminal is WSL instead of cmd/pwsh. Running/debugging is also effectively β€œremoting” into WSL instead of running under Windows.

Basically, if you’re using VSCode as just a text editor they’re likely comparable, but the more it becomes an IDE the more differences there are.

Collapse
 
redhoodjt1988 profile image
Jonathan Reeves

Thank you for that awesome article. Keep up the good work. If you use C++ at all I would love to see how to setup VS Code with C++, G++ and WSL. As well as how to implement SDL with it.

Collapse
 
ajeet profile image
Ajeet Yadav

Thank you 😊. I Will try to write a post about that too. Thanks again

Collapse
 
redhoodjt1988 profile image
Jonathan Reeves

Awesome. Sounds good. It seems like a great topic to cover. I love C++ and I love how fast VS Code starts up. So being able to use VS Code instead of Visual Studio to write my games would be awesome.

Collapse
 
jeikabu profile image
jeikabu

Windows Terminal also has good support for working with WSL. I tend to use it when I don't particularly need an IDE.

Collapse
 
ajeet profile image
Ajeet Yadav

Windows terminal is β™₯️. I am planning to write about it this weekend. Thank you for your comment Jeikabu

Collapse
 
devanghingu profile image
Devang Hingu

what is advantage of running that kind of configuration instead of all into linux desktop?

Collapse
 
ajeet profile image
Ajeet Yadav

Hi Devang, this post will explain why I use wsl on Windows

dev.to/ajeet/hello-newbies-in-tech...

Collapse
 
devanghingu profile image
Devang Hingu • Edited

umm i working on linux since i was in first year of my graduation. and installed linux along side of my windows but after one year i become pro on linux and left my windows license and started debian as core os for my machine. till now i doesn't have any problem. now days KDE-plasma and gnome provide great user-interface to do all stuff over machine. so i didn't find any useful thing to use WSL.

Collapse
 
velcis profile image
velcis

When i type 'code' or 'code .' inside WSL window terminal, nothing occurs, only works inside VSCode WSL Window, do you know why?

Collapse
 
ajeet profile image
Ajeet Yadav

Here is what the official docs says:

When doing this for the first time, you should see VS Code fetching components needed to run in WSL. This should only take a short while, and is only needed once. If this command does not work, you may need to restart your terminal or you may not have added VS Code to your path when it was installed.