<p>A few years later this thread is still the first result in Google, but running Docker+Vagrant (<strong>with VirtualBox</strong>) on Windows isn't a challenge anymore. You can easily run them both, as described <a href="https://kubut.medium.com/it-is-2021-running-docker-and-vagrant-parallel-on-windows-isnt-impossible-anymore-a8ea7de0536c" rel="noreferrer">here</a></p>
<p>If for some reason you want to use Vagrant with VirtualBox as a provider you should update to VB 6.x - after that, you can run VirtualBox, Vagrant, and Docker at the same time. Just configure your VM to use Hyper-V as Paravirtualization Interface. You can do it by VirtualBox GUI (VM's Settings -&gt; System -&gt; Acceleration -&gt; Paravirtualization Interface) or by using Vagrantfile:</p>
<pre><code>Vagrant.configure(&quot;2&quot;) do |config|
  # your config (…)
  config.vm.provider &quot;virtualbox&quot; do |vb|
    vb.customize [
      &quot;modifyvm&quot;, :id,
       &quot; - paravirtprovider&quot;, &quot;hyperv&quot;
    ]
  end
  # your config (…)
end
</code></pre>
<p>This will work not only for Windows Enterprise/Pro/Edu but also for Home Edition (with WSL2 as Docker Backend). This solution shouldn't break your VirtualBox's machine, so you <strong>don't have to switch hypervisorlaunchtype</strong> over and over again.</p>

CC BY-SA 4.0
2021-03-16T20:35:03.290Z
Aww, nice one, I totally missed it was still using virtualbox when reading the blog post.I see value for the home edition of Windows where the Hyperv api is not complete.
Tensibai
CC BY-SA 4.0
2021-03-16T15:29:07.490Z
2021-03-16T18:30:40.093Z
2021-03-16T18:30:40.093Z
kubut
<p>Alongside Vagrant, you could use the old school Legacy 'Docker Toolbox' instead of 'Docker for Windows'. That means Docker will be slow since its running in a Linux VM I believe.
<a href="https://docs.docker.com/toolbox/toolbox_install_windows/" rel="nofollow noreferrer">https://docs.docker.com/toolbox/toolbox_install_windows/</a>
Other than that, yes I have been restarting my computer everything i need HyperV for Docker or remove it when i want vagrant.</p>

CC BY-SA 4.0
2018-09-17T21:22:16.210Z
2018-09-17T21:22:16.210Z
armyofda12mnkeys
<p>Confirmed by <a href="https://stackoverflow.com/a/38111013/3627607">this answer on SO</a> referencing  <a href="https://social.technet.microsoft.com/Forums/windows/en-US/118561b9-7155-46e3-a874-6a38b35c67fd/hyperv-disables-vtx-for-other-hypervisors?forum=w8itprogeneral" rel="noreferrer">Microsoft technet</a> once Hyper-V is activated it mask the VT-X instructions of the processor to the OS on top of it and windows run like a guest.</p>

<p>Docker for Windows need hyper-V to work, so disabling it is not really an option.</p>

<p>There's no way to have virtual box running on top of Hyper-V and that's quite normal, you should not run an hypervisor within an hypervisor, they'll fight to orchestrate hardware acces.</p>

<p>The best workaround in my opinion is to create hyper-V virtual machine from vagrant with the <a href="https://www.vagrantup.com/docs/hyperv/" rel="noreferrer">hyper-V provider</a> instead of virtual box machines, this way you can create VM or container on the same session.</p>

<p>Side note, vagrant already have a note about this in the hyper-v provider documentation page (found while searching the link to add above):</p>

<blockquote>
  <p><strong>Warning</strong>: Enabling Hyper-V will cause VirtualBox, VMware, and any other virtualization technology to no longer work. See <a href="http://www.hanselman.com/blog/SwitchEasilyBetweenVirtualBoxAndHyperVWithABCDEditBootEntryInWindows81.aspx" rel="noreferrer">this blog post</a> for an easy way to create a boot entry to boot Windows without Hyper-V enabled, if there will be times you will need other hypervisors.</p>
</blockquote>

CC BY-SA 3.0
2017-12-22T08:53:14.210Z
2017-12-22T08:53:14.210Z
Tensibai
<p>Back in the day, I was using <a href="https://www.virtualbox.org/" rel="noreferrer">VirtualBox (VB)</a> and <a href="https://www.vagrantup.com/" rel="noreferrer">Vagrant (V)</a> to run VMs. Since I installed <a href="https://docs.docker.com/docker-for-windows/" rel="noreferrer">docker-for-windows (DfW)</a> and run V, VB complains about <a href="https://en.wikipedia.org/wiki/Hyper-V" rel="noreferrer">Hyper-V (HV)</a>.</p>

<pre><code>[user@localhost ~]$ vagrant up
Stderr: VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component
ConsoleWrap, interface IConsole
</code></pre>

<p>Although <a href="https://www.vagrantup.com/docs/hyperv/" rel="noreferrer">this link</a> indicates that V supports HV, the above error message is contradictive. Why does VB look incompatible with HV, why V says that it supports HV and how to prevent that HV needs to be disabled in order to use V again.</p>

<pre><code>| Product    | Version |
|:-----------|--------:|
| Vagrant    |   2.0.1 |
| VirtualBox |   5.2.4 |
| Windows    |      10 | 
</code></pre>

<p><strong>Discussion</strong></p>

<p><a href="http://www.hanselman.com/blog/SwitchEasilyBetweenVirtualBoxAndHyperVWithABCDEditBootEntryInWindows81.aspx" rel="noreferrer">The suggestion to switch Hyper-V on and off</a> is not the preferred solution as it is time consuming.</p>

<p>If it would be possible to run V and DfW on the same system by replacing VB this could be an option.</p>

<windows><vagrant><virtualbox>
How to use Vagrant and Docker-for-Windows on a Hyper-V system?
030
# How to use Vagrant and Docker-for-Windows on a Hyper-V system?

(Asked by: username_0 on 2017-12-19)

Back in the day, I was using VirtualBox (VB) and Vagrant (V) to run VMs. Since I installed docker-for-windows (DfW) and run V, VB complains about Hyper-V (HV).
[user@localhost ~]$ vagrant up
Stderr: VBoxManage.exe: error: VT-x is not available (VERR_VMX_NO_VMX)
VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component
ConsoleWrap, interface IConsole

Although this link indicates that V supports HV, the above error message is contradictive. Why does VB look incompatible with HV, why V says that it supports HV and how to prevent that HV needs to be disabled in order to use V again.
| Product    | Version |
|:-----------|--------:|
| Vagrant    |   2.0.1 |
| VirtualBox |   5.2.4 |
| Windows    |      10 | 

Discussion
The suggestion to switch Hyper-V on and off is not the preferred solution as it is time consuming.
If it would be possible to run V and DfW on the same system by replacing VB this could be an option.

**Tags:** windows, vagrant, virtualbox


---

## 3 answers

### Answer by username_2 on 2017-12-22. Score: 9 | Accepted answer

Confirmed by [this answer on SO](https://stackoverflow.com/a/38111013/3627607) referencing [Microsoft technet](https://social.technet.microsoft.com/Forums/windows/en-US/118561b9-7155-46e3-a874-6a38b35c67fd/hyperv-disables-vtx-for-other-hypervisors?forum=w8itprogeneral) once Hyper-V is activated it mask the VT-X instructions of the processor to the OS on top of it and windows run like a guest.

Docker for Windows need hyper-V to work, so disabling it is not really an option.

There's no way to have virtual box running on top of Hyper-V and that's quite normal, you should not run an hypervisor within an hypervisor, they'll fight to orchestrate hardware acces.

The best workaround in my opinion is to create hyper-V virtual machine from vagrant with the [hyper-V provider](https://www.vagrantup.com/docs/hyperv/) instead of virtual box machines, this way you can create VM or container on the same session.

Side note, vagrant already have a note about this in the hyper-v provider documentation page (found while searching the link to add above):

> **Warning**: Enabling Hyper-V will cause VirtualBox, VMware, and any other virtualization technology to no longer work. See [this blog post](http://www.hanselman.com/blog/SwitchEasilyBetweenVirtualBoxAndHyperVWithABCDEditBootEntryInWindows81.aspx) for an easy way to create a boot entry to boot Windows without Hyper-V enabled, if there will be times you will need other hypervisors.


---

### Answer by username_1 on 2021-03-16. Score: 5

A few years later this thread is still the first result in Google, but running Docker+Vagrant (with VirtualBox) on Windows isn't a challenge anymore. You can easily run them both, as described here
If for some reason you want to use Vagrant with VirtualBox as a provider you should update to VB 6.x - after that, you can run VirtualBox, Vagrant, and Docker at the same time. Just configure your VM to use Hyper-V as Paravirtualization Interface. You can do it by VirtualBox GUI (VM's Settings -> System -> Acceleration -> Paravirtualization Interface) or by using Vagrantfile:
Vagrant.configure("2") do |config|
  # your config (…)
  config.vm.provider "virtualbox" do |vb|
    vb.customize [
      "modifyvm", :id,
       " - paravirtprovider", "hyperv"
    ]
  end
  # your config (…)
end

This will work not only for Windows Enterprise/Pro/Edu but also for Home Edition (with WSL2 as Docker Backend). This solution shouldn't break your VirtualBox's machine, so you don't have to switch hypervisorlaunchtype over and over again.

> **Comments:**
> **username_2**: Aww, nice one, I totally missed it was still using virtualbox when reading the blog post.I see value for the home edition of Windows where the Hyperv api is not complete.  

---

### Answer by username_3 on 2018-09-17. Score: 0

Alongside Vagrant, you could use the old school Legacy 'Docker Toolbox' instead of 'Docker for Windows'. That means Docker will be slow since its running in a Linux VM I believe.
<https://docs.docker.com/toolbox/toolbox_install_windows/>
Other than that, yes I have been restarting my computer everything i need HyperV for Docker or remove it when i want vagrant.


---

