
To enable WSL 2, run the following commands (based on these instructions). Start a terminal as an administrator (right click on the application in the start menu and choose “Run as administrator”). If you don’t care to install this, all the instructions will work in PowerShell too. Ironically, this does require some pointing and clicking, using the Microsoft Store: So the first thing I’m going to do is install it. I like to work from the command line as far as possible, and Windows 10 recently got a new terminal, (Although WSL 2 involves a virtualized linux kernel “under the hood”, if I don’t need to create it and maintain it, that’s

On Windows without requiring a Linux virtual guest. This post describes setting up a Python development environment of Visual Studio Code and WSL 2 in combination, to see if it can provide a satisfactory experience This improves performance and, vitally for me, supports running Docker. This limitation is removed with the newest version of Windows Subsystem for Linux, WSL 2. So some applications, including Docker, do not work since they rely on system calls to the kernel). (WSL 1 does not include an actual Linux kernel, Of Windows Subsystem for Linux (WSL 1) in its original form since it didn’t support Docker. For several months I’ve been using the SSHįlavour of this feature for Python development, using a Linux guest running without a GUI on Hyper-V as the remote machine. This could be a remote machine accessed via SSH, a container, or Windows Subsystem for Linux. In short, it allows the Visual Studio Code IDE, running on a Windows workstation, to execute and debug code in some remoteĮnvironment.

Therefore I was excited when Visual Studio Code released their Remote Development feature.

Of the guest OS’s UI never quite feels native. However this brings its own drawbacks, not least when running an IDE in a virtual Linux host, where the performance and latency Most of the time, I haveīeen able to run a Linux virtual machine on the Windows host and work from there. I’d estimateĪround 80% of my career has been spent in environments where using a Windows workstation was mandatory. However in corporate environments the workstations available to developers are often exclusively Windows. Only reinforced by the rise of Docker and containerisation which are primarily Linux based. (usually Linux in my experience, especially with the advent of cloud computing). In Visual Studio Code, create a new file called package.Python development using WSL 2 and Visual Studio Codeįor years I have been in the Linux-on-the-desktop camp because I find it superior as a development environment.īoth because of the tooling (high quality shells such as bash, and integrated package managers like apt and yum), andīecause of the productivity that comes from having a development environment similar to the target production environment
