Is there a world where we can get the benefits of Windows and Ubuntu/Linux?

As an engineer or data scientist during your work flow you usually have to set up your machine with your IDE and tools, and also with programming languages and packages. Typically some of these require Linux, so you end up faced with a choice either dual boot or run a virtual machine. Each has its down sides. The cost of switching - rebooting between both OSs in dualboot or starting the virtual machine - can be significant. In addition, accessing files is not straightforward as tools in OS are not available in the other.

This brings me to my earlier question: Is there a world where we can capitalize on both?

Yes! Finally, WSL2 is the answer.

What is WSL2? 

It is a Windows Subsystem for Linux 2. A complete Linux kernel running as a virtual machine inside Windows or on top of Windows kernel. Giving developers the ability to run GNU/Linux environments including command line tools and applications without any overhead of a virtual machine or dual-boot.

What is new about it?

The number 2 in the name stands for the version. The new version is a completely new and full kernel that utilizes virtualization rather than translation. It also gives the ability to use GPUs, which is extremely important for data science and machine learning and the main reason I am so excited about  it. Other new features include that it is a managed virtual machine which means it is faster to boot and start, and it is a complete linux kernel with full system calls compatibility which means a lot of things -the most relevant one is that it is faster read and write files. To read more about the technical details of this reference the release blog by Microsoft.

Why I like it?

I like the fact that it is really fast to run and start. In a matter of seconds I am in Ubuntu. I like that it is managed by Windows which means I do not need to copy files between systems or switch operating systems. And the most of all, I can use the GPU for training and modeling. Also I still get to use all the tools that I have on Windows without having to reboot!

How do I get it on my device? 

Here are the simple steps to get WSL2 on your machine:

  • Prerequisite: you need to have a Windows device running Windows 10 version 2004 and higher (Build 19041 and higher) or Windows 11.

  • With admin privileges open PowerShell or command prompt and run:

  • ‘wsl - - install’

  • This will enable everything required. Then install Ubuntu and make WSL2 the default version.

  • Then install all the packages and tools you need!
    The last step is the time consuming one. Another choice is to do as I did, and get ZbyHp devices. These devices do not just have extremely powerful hardware specifically designed for data science/ML workloads, but also have the full software stack with everything installed. Check it out here: Z by HP for Data Science | HP® United Kingdom . OR here: WSL 2 | HP® Official Site

Disclaimer: I got my devices as part of ZbyHP Global Data Science Ambassador. Since I received them I have been very impressed. As part of the program I use the devices and generate content for the community, such as this blog.

After you have done all of the previous steps, it’s time to set up your favorite IDE and write some code. Check my coming blogs for the steps.

Further reading: