loading...

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

Collapse
lietux profile image
Janne "Lietu" Enberg

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
mavaddat profile image
Mavaddat Javid

If you have Windows Pro or Enterprise, then you can use the Hyper-V manager to set up your own VM's. There is even a "Quick Create" tool to download and install pre-configured disk images, Canonical Multipass is also a nice solution to any hiccup in installing Linux in Hyper-V.

Collapse
lietux profile image
Janne "Lietu" Enberg

Yes, I used Hyper-V manager to try and boot up some basic Linux images that boot in literally every other environment, they failed to launch a GUI and froze.

If it says "Canonical" it is basically guaranteed to only support Ubuntu.

Collapse
somerb profile image
Somer B.

Hi Janne,
It seems there are some workarounds about it. At docs.microsoft.com/en-us/windows/w... it says:
Some 3rd party applications cannot work when Hyper-V is in use, which means they will not be able to run when WSL 2 is enabled, such as VMware and VirtualBox. However, recently both VirtualBox and VMware have released versions that support Hyper-V and WSL2! You can learn more about VirtualBox's changes here and VMware's changes here.

Collapse
lietux profile image
Janne "Lietu" Enberg

It seems that page has been last updated about a year ago. The updates they refer to are things that I've already found to be broken.

6.0.0 from 2018 was supposed to fix VirtualBox with Hyper-V, it doesn't, it's really broken, and the entire VirtualBox community seems to know this as they typically suggest removing Hyper-V as the only solution to getting VirtualBox to work when your computer has Hyper-V enabled.

It seems you're only spreading old marketing propaganda from Microsoft without doing any actual research on it.

Yes, at some point they thought they could make it work, Windows implemented some APIs that were supposed to make it possible, but those have repeatedly broken and VirtualBox has not worked with Hyper-V enabled a little while after the initial successful beta tests.

Thread Thread
somerb profile image
Somer B.

Spreading old marketing propaganda? Easy please..

virtualbox.org/wiki/Changelog:
VirtualBox 6.1.4 (released February 19 2020)
This is a maintenance release. The following items were fixed and/or added:
Windows host: Restore the ability to run VMs through Hyper-V, at the expense of performance

Changelog is VirtualBox's own changelog, their own promise! so how come it is Microsoft's old propaganda? If VirtualBox is broken it is not Microsoft's responsibility but Oracle's.

Thread Thread
lietux profile image
Janne "Lietu" Enberg

If Microsoft breaks their APIs likely to intentionally break the compatibility with 3rd party virtualization software, how is that Oracle's fault?

And you linked to docs.microsoft.com/en-us/windows/w... a page last updated a year ago. A page which still made invalid claims about "recently both VirtualBox and VMware have released versions that support Hyper-V and WSL2" - out of date propaganda. The links on that page also link to VirtualBox 6.0 changelog - and all versions of VirtualBox 6.0 still fail to work under Hyper-V.

It's interesting that maybe VirtualBox has finally managed to fix the compatibility even without Microsoft's help using their proprietary intentionally broken APIs, but this might not be a long-lived solution and there is no sense in building any of your systems to depend now on Hyper-V since there are no guarantees it will not break again in the future.

Also this is far from the only issue with Hyper-V, though it was the most significant one to my work.

Thread Thread
lietux profile image
Janne "Lietu" Enberg

People are also reporting that the performance hit is severe, which is unlikely to be accidental.

Thread Thread
macdub profile image
John McDowell

Yeah, I can confirm the performance hit is severe. Had WSL2 setup and VirtualBox 6.1.6 I was able to start my Win7 VM, but since VirtualBox was forced to use Hyper-V the VM never made it past the Win7 start up animation after 10-15 minutes.

Ended up reverting back to WSL1 to get the performance back on my VMs.

Thread Thread
lietux profile image
Janne "Lietu" Enberg

Oh wow, that's worse than I thought .. I was just considering testing it out in the coming weeks for myself - thanks for saving me the effort!

Collapse
kaodome profile image
KaoDome

It is kind of expected for 3rd party virtualization products not to work when Hyper-V is enabled, after all it's a type 1 hypervisor (native, like Xen or ESXi) and not a type 2 one (hosted, like VirtualBox or VMware Workstation).

When it's enabled the whole OS goes through it, so virtualization extensions aren't exposed and since they're required for some of not all type 2 virtualization offerings they won't work. Nested virtualization can be tricky, but I think there are some solutions out there that implement it (either by exposing virtualization extensions or by virtualizing without hardware assistance (with the performance penalty it entails)).

However, as it was stated before, both VMware Workstation and VirtualBox can now work when Hyper-V is enabled and I'm sure their implementation will continue to improve (at least VMware's being a commercial product and all).

As for WSL2, I find it useful, a great improvement from what SUA used to be and a step into the right direction in regards to WSL (it has to be easier to maintain for sure). I'm still using MSYS2 when it comes to Windows, but I'll certainly give WSL2 a try soon. I hope they keep working on it.

Collapse
lietux profile image
Janne "Lietu" Enberg

It is expected for them to have issues because of the way it's implemented. Which makes the way it's been implemented bad for everyone, and the fact that e.g. Docker's default Windows installation depends on it pretty distasteful.

No, VirtualBox does not work in an acceptable way. I don't care about VMWare because it's not widespread, affordable, and manageable with vagrant and other such tools, so it may or may not work but it doesn't change my ability to use Hyper-V at all. No it will not keep getting better when Microsoft is actively working against that goal.

This is basically Microsoft trying to kill all other virtualization options in favor of Hyper-V - in a sensible world this should land Microsoft in yet another antitrust lawsuit.

Collapse
ajeet profile image
Ajeet Author

Hi Janne,
Bookmarked you post. I will definitely check out the issues you have mentioned.
Windows WSL team is amazing btw 🙂. Hope they fix the issues you mentioned

Collapse
lietux profile image
Janne "Lietu" Enberg

Well, the issue with WSL is that it's built on Hyper-V - the WSL team has nothing to do with Hyper-V's issues and the only thing they can do to help with that is to choose to not use Hyper-V.

Collapse
dguhl profile image
D. Guhl

If you have issues booting a Linux ISO with a Hyper-V machine, try to switch "Safe Boot" to "Microsoft UEFI Certification Authority" and enable TPM.

Hyper-V is a hardware abstraction layer, exclusively claiming your processor's virtualization and providing an API for Type-2-virtualizers running on Windows. It's a feature Microsoft sells, true, but on the other hand it provides a layer of management and security for sysops to control when, what and how virtualization on a Windows system takes place in order to comply to ISO certification. After all, the hypervisor runs in ring 0 of the processor and you would like to have a restricted and safe environment to manage such applications with care and caution, especially on Windows...! You can change VirtualBox' para-virtualization to Hyper-V.

I don't defend Microsoft and how it is implementing hardware-accelerated virtualization in Windows, but they have architectural reasons for how they make hardware-accelerated virtualization available in Windows, even though I personally believe to pack Hyper-V with the higher-priced Enterprise and Pro editions while blocking any other access to the processor's hardware accelerated virtualization is some sort of robbery - almost every processor made and sold within the last decade enables some sort of hardware-accelerated virtualization.