hashicorp / otto-getting-started

The repository used for Otto getting started guide.
26 stars 25 forks source link

Can't boot VM on Windows #5

Closed mikesigs closed 8 years ago

mikesigs commented 8 years ago

The first time I ran otto dev I got the warning about installing VirtualBox. I told it to go ahead and install it, but then it failed anyways because installing otto can't do that on Windows yet. That's not the issue though.

I installed VirtualBox 5 then tried again. This time it got much further, even creating the VM. However, it failed once more with the following output. image

The error in the VirtualBox log said VT-x is not available. (VERR_VMX_NO_VMX). Some quick googling showed this to be a hardware virtualization issue. I checked my BIOS settings, and Virtualization was enabled. Some of the other search results showed that this happens with 64-bit guest OSes. That can't be the case because the VM is using Ubuntu 32-bit.

I started tinkering with the VM settings and managed to get things a bit further. I bumped up the Video Memory to 16MB and Base Memory to 512MB and booted the VM directly from VirutalBox. This time there were no errors, but the boot just froze on a black screen with a non-blinking cursor in the top left.

At this point if I try to run otto dev I get the following output (lots of "Connection timeout" messages.) I can see that the VBoxHeadless process indeed starts up, but then it does nothing. image

I am very new to both Vagrant and Otto. Any help would be great.

mikesigs commented 8 years ago

Okay, so here's an update. After learning more about Vagrant today and creating a new VagrantFile and trying to use the precise64 box, I ran into the same issue about VT-x is not available. My BIOS certainly showed settings enabled having to do with Virtualization, but I figured perhaps this is not specifically VT-x. I downloaded the Intel Processor Identification Utility here and sure enough it says "Intel(R) Virtualization Technology..... no"

Basically this means I cannot use the precise64 box. So now I need to find a way to configure otto to generate a VagrantFile that uses precise32 instead. I don't see anything in the docs that indicate how to do that....

I'm hoping this stream of consciousness will help someone (and perhaps someone can help me). But I will keep digging...

mikesigs commented 8 years ago

After manually editing the VagrantFile, setting config.vm.box = "hashicorp/precise32", deleting the existing VM, then running otto dev again, I've got a running VM!

mikesigs commented 8 years ago

I kept digging into this today because it still didn't feel right. Why would my BIOS say virtualization was enabled, but the Intel util say otherwise. I won't profess to understand all of this hardware virtualization stuff, but I did find a few sources indicating that there may be some other software installed that was using virtualization, making it unavailable to other things (in my case VirtualBox). Some of the culprits were Android/Windows Phone emulators, Antivirus, etc. In my case, it turned out to be Hyper-V.

Here's what I did to fix this.

  1. Control Panel | Programs | Turn Windows features on or off
  2. Uncheck Hyper-V
  3. Reboot

After that I recompiled with otto compile to get rid of the manual edit to the VagrantFile, and voila! otto dev worked.

Hope this helps someone in the future.

powareverb commented 8 years ago

Hey @mikesigs. So you've already found the root cause - you can't have Hyper-V enabled and run other Hypervisors. Just thought I'd mention for others - if you do still need to run Hyper-V, Hanselman has a nice write up on using BCDEdit to enable/disable HyperV on bootup: http://www.hanselman.com/blog/SwitchEasilyBetweenVirtualBoxAndHyperVWithABCDEditBootEntryInWindows81.aspx