DEV Community

Cover image for Hello Newbies in Tech! Try This Powerful Tool by Microsoft to use Linux Effortlessly with Windows OS

Hello Newbies in Tech! Try This Powerful Tool by Microsoft to use Linux Effortlessly with Windows OS

Ajeet Yadav on February 04, 2020

Originally published on my blogging site ajeet.dev I am a newbie in tech. I have been using Linux and Windows side by side for quite some time ...
Collapse
 
erebos-manannan profile image
Erebos Manannán

WSL2 is a massive mistake. It is build on Hyper-V, Microsoft's own hypervisor. It causes significant issues of many kinds - not least of which, that it's incompatible with VirtualBox, the hypervisor with which all other systems are compatible with.

Want to boot up a random Linux VM to try out things? Tough, you can't, Hyper-V is preventing Virtualbox from starting, and the Linux ISO won't boot in Hyper-V.

It's also been known to cause performance reductions for gaming, as well as triggering anti-cheat systems, and other such things.

I really tried to like Hyper-V for a while, but I had to give up on it. Still the best way to get most Linux utilities on Windows is Cygwin.

I wrote a bit about the setup I use for these things in dev.to/lietux/developing-like-a-pr...

Collapse
 
joedotnot profile image
joedotnot

This comment is totally alarmist, i've used hyper-v with a few linux ISO and had no problem booting, you just have to read some instructions carefully. e.g. Disable secure boot, Gen 1 vs Gen 2, etc...

Collapse
 
erebos-manannan profile image
Erebos Manannán

Yeah, so because a year later you tested a few ISOs and YOU ran into no issues nobody could ever have had any issues with it?

You just have to read some documentation that is likely nowhere to be found by mere mortals. Gotcha.

Even when it "works" Hyper-V is terribly slow compared to VMware Workstation or VirtualBox for e.g. Docker builds.

Thread Thread
 
laazik profile image
Marek Laasik

Ended up in this thread on a related search on DB speed comparisons under Hyper-V and WSL2. And found it a bit misleading.

The Linux ISO-s have been working on Hyper-V since 2014 (Debian. Redhat. I've run Oracle DB on Oracle Linux on Hyper-V), the fact that you have to turn off secure boot is also well documented, and pretty much the first result in the google search for linux iso not booting on hyper-v gen 2 gives in a preview a solution on how to fix it (by turning off secure boot). Btw. the MacBook Pro has a nasty feature where the CPU has some virtualisation bits left in "UNDEFINED" state, and debugging that was definitely a challenge (really nice hardware though).

As for performance, I can't complain, it's performant enough to boot up a complete dev env with several clusters of elastic, rabbit etc. and the throughput numbers (even for rabbit running in java VM-s inside the Hyper-V container) are very ok. Also docker builds both from command line and VS (which has it's own build system built around Docker, should you want to use it for .NET core, is very fast). Even on laptop systems.

So all in all, running Linux on Hyper-V is reasonable and well working. I do understand the personal dislike of some specific systems, or vendors, that's fine, I personally just don't use them at that point, instead of complaining how bad they are, but that is a matter of personal taste. Though it would be good to not mix up facts and subjective opinions.

Thread Thread
 
erebos-manannan profile image
Erebos Manannán

Well you say that, and then mix up facts and subjective opinions. I don't have an opinion about Hyper-V being bad. I've tested it and unfortunately found it to be very bad, while hoping it wouldn't be.

Thread Thread
 
kikonen profile image
Kari Ikonen

Performance of vmware and virtualbox with WSL2 enabled (aka. hyper-v) is just too poor. Running linux in virtualbox with VB 6.1.18 is slow, it's not unsably slow, thus someone can claim that "it works!", however, it's slower than without WSL2, slowing it down into uncomfortable level.

VMWare, well, commercial solution has also problems, with their latest version, which is claimed to be "hyper-v & WSL2" compatible: communities.vmware.com/t5/VMware-W...
Tried it also myself, and running windows 10 in vmware with WSL2 enabled, is too slow (with virtualbox comically slow, that's reason for trying out vmware); with either case, not usable (i.e. comparable to sticking needles under the fingernails).

Yes. reason for experimenting with wsl2 was attempt of trying to run docker in windows (and so far it seems that I've to abandon it due to these performance problems caused by hyper-v in vmware & virtualbox).

Collapse
 
wolfhoundjesse profile image
Jesse M. Holmes

I was such a huge fan of WSL that I even bought a distro from the Windows Store. I came to Windows from years of Linux/BSD, and I wanted to bridge the gap. I even managed to get Arch on WSL.

Honestly, it has been a long time since I've fired up anything but PowerShell Core in my Windows Terminal. At this point, unless I need to reach for jupyter notebooks again, I'm not sure what I will use WSL for, and it kind of makes me sad.

It's inspiring that you can have Linux in your Windows environment, and you can run PowerShell Core on Linux. We live in an exciting time!

Collapse
 
ajeet profile image
Ajeet Yadav

Hi Jesse,

I did not know that one can purchase any distro and that too optimized for WSL. 😀 Thanks for the info.

And honestly I think, people using MacOs or a Linux will rarely switch to Windows. I think never ever. Windows is for newbies like me 😁 . I use Excel, and a data visualization software Tableau, that's why I need to use Windows.

And I am sure you have heard of Kaggle Kernels and Google Colabs for Jupyter notebooks. I have used in the past but for basic exploratory data analysis. They look promising.

Collapse
 
wolfhoundjesse profile image
Jesse M. Holmes

Ooo, I'm actually fairly new to python and data science, so those are brand new tools for me to check out. Thanks!

Never say never! I made the switch. 😊

Mac users, though … they're probably the toughest sell of all.

Thread Thread
 
ajeet profile image
Ajeet Yadav

Definitely check Kaggle and Google ones. They are extremely useful.

Mac users, though … they're probably the toughest sell of all.

Couldn't agree more 😁

Thread Thread
 
mateiadrielrafael profile image
Matei Adriel • Edited

I use linux for programming but dual boot windows for games, linux is just not as good in terms of gaming performance

Collapse
 
jef profile image
Jef LeCompte

Great article. I also think it's worth mentioning the new Microsoft Terminal project. Works well with WSL.

I'd also like to see some information based around connecting an IDE (like IntelliJ or CLion) to WSL for native code compilation.

Other than that, thanks again for taking the time to write this one up! Great for anyone starting.

Collapse
 
ajeet profile image
Ajeet Yadav

Thank you Jef for your comment 🙂
And yes, the new MS terminal looks cool. I cab create new tabs which is great. I used it a couple of months ago but it lacked the copy paste feature. I just hope they add this functionality.

Collapse
 
ricoet22 profile image
Kamil Pawlak

You don't have to install specified version package from the store, the standard one "Ubuntu" (without anything more) is better than version packages as it downloads the latest LTS version of Ubuntu and allows upgrades to future releases unlike the others.

Collapse
 
ajeet profile image
Ajeet Yadav

Oh i did not know that. Thank you Kamil

Collapse
 
nijeesh4all profile image
Nijeesh Joshy

great read, one question though. how do you make those cool terminal snapshots ? is it a theme ?

Collapse
 
ajeet profile image
Ajeet Yadav

Hey, Thanks :)

I use this website.

carbon.now.sh/

It is open source: github.com/carbon-app/carbon

Collapse
 
joseluisrnp profile image
José Luis Recio

Hi again Ajeet! Great post, you're doing more easy mix the Windows world and Linux world, greetings

Collapse
 
ajeet profile image
Ajeet Yadav

Thank you 😊 Jose. You are very kind

Collapse
 
filiplaurentiu profile image
Filip Laurentiu

why we need to run the Ubuntu with administrative privilege ?

Collapse
 
ajeet profile image
Ajeet Yadav

Hi Filip :)

I trust the Ubuntu app (downloaded from app store), that's why I run it as admin. As far as I remember, I could not recall any step that required admin privileges during the installation.

Collapse
 
saulonunesdev profile image
Saulo Nunes

Hello @ajeet nice post, do u know if wsl2 supports docker volume and electron js? i droped wsl because of this conflicts on wsl1 and didnt had time to test on wsl2

Collapse
 
ajeet profile image
Ajeet Yadav

Hi Saulo,

I will have to check about docker.
For electron, plz check this guide

gist.github.com/wsargent/072319c21...