Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simple instructions needed for enabling and disabling Hyper V Docker

I have asked something similar before, but I was wondering if someone could give me some very simple instructions for how I can turn off HyperV Container features so that I can use Virtual Box and then turn them back on to use Docker for Windows

At present I have the following message from Docker for Windows

"Hyper-V and Containers features are not enabled. Do you want to enable them for Docker to be able to work properly? Your computer will restart automatically. Note: VirtualBox will no longer work."

I do NOT need both at the same time

I really need clear instructions as I do not want to be in a position where I get docker working then can never use Virtual Box again!

I have a requirement for using my existing Virtual Box VMs every now and then and I cannot be in a position where I cannot use them

Paul

like image 604
Paul Avatar asked Nov 02 '17 17:11

Paul


People also ask

Do I need to disable Hyper-V for Docker?

Docker Desktop on Windows 10 supports two backends: HyperV and WSL2. WSL2 in turn also uses Hyper-V — so without having Hyper-V enabled Docker Desktop fails to start and can't be used.

Should Hyper-V be enabled for Docker?

Docker requires Hyper-V enabled options for Windows 10. Without an enabled option, Docker can not run after installation. Therefore, the Hyper-V option must be enabled.

How do I use Hyper-V in Docker?

Install Docker for Windows After reboot, Docker will be started. Docker requires that the Hyper-V feature is enabled, so if necessary will ask you to enable it and restart. Click OK for Docker to enable Hyper-V and restart your system.


1 Answers

You can do below to disable

dism.exe /Online /Disable-Feature:Microsoft-Hyper-V
bcdedit /set hypervisorlaunchtype off

and below to enable

dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All
bcdedit /set hypervisorlaunchtype auto 

From PowerShell

To Disable

Disable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All

To Enable

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V –All

PS: Source threads

https://superuser.com/questions/540055/convenient-way-to-enable-disable-hyper-v-in-windows-8

How to disable Hyper-V in command line?

like image 135
Tarun Lalwani Avatar answered Sep 17 '22 18:09

Tarun Lalwani