Skip to content
This repository has been archived by the owner on Sep 26, 2021. It is now read-only.

Host needs VT-x/AMD-v enabled for docker-machine to work on virtualbox #1983

Closed
dgageot opened this issue Oct 14, 2015 · 9 comments
Closed

Comments

@dgageot
Copy link
Member

dgageot commented Oct 14, 2015

If VT-x or AMD-v are not enabled on the host machine, the vm won't boot boot2docker properly and the whole creation process will hang forever.

To reproduce:

docker-machine create -d virtualbox default

, on a host without VT-x/AMD-v

We need to:

  • Detect that VT-x/AMD-v is not enabled and fail as early as possible
  • Understand why the start command hangs for what it looks forever
@thaJeztah
Copy link
Member

Also see docker-archive/toolbox#166

@jeanlaurent
Copy link
Member

Got this one which explain for windows and linux how to detect it.

http://stackoverflow.com/questions/840873/how-to-determine-if-hardware-virtualization-is-available-via-code-c-c

@nathanleclaire
Copy link
Contributor

I think my main concern in the immediate future is to detect this case for Windows users (the most likely to have it disabled), so maybe we can focus on that. I don't see any reliable way to find the information in the links referenced without assuming something like Powershell, though. Maybe I'm overlooking something.

At any rate, can VBoxManage itself detect whether virtualization is enabled through the command line? I know that it complains if you attempt to run it in Xen, so there might be something there we can try and parse.

@dgageot
Copy link
Member Author

dgageot commented Oct 15, 2015

We should be able to detect that VT-x/AMD-v is enabled on windows with this command:

> wmic cpu get VirtualizationFirmwareEnabled
VirtualizationFirmwareEnabled
TRUE

(edit) This only works on windows 8, not 7

If wmic is not available then we could create the vm anyway and then find a way to see if it's enabled.

@dgageot dgageot self-assigned this Oct 15, 2015
@dgageot
Copy link
Member Author

dgageot commented Oct 15, 2015

The only way I found to detect afterwards is to look at the vm's log in ~/.docker/machine/machines/default/default/Logs/VBox.log

When is works, it says:

00:00:00.121781 HM: HMR3Init: VT-x w/ nested paging and unrestricted guest execution hw support

Otherwise it says:

00:00:00.121781 HM: HMR3Init: Falling back to raw-mode: VT-x is disabled in the BIOS for both all CPU modes

@dgageot
Copy link
Member Author

dgageot commented Oct 20, 2015

Closed by #1990

@serjN
Copy link

serjN commented Mar 24, 2016

@dgageot, you can check if virtualization enabled on windows 7 by utility Microsoft® Hardware-Assisted Virtualization Detection Tool. It has console mode, but needs admin rights.

@xhchrn
Copy link

xhchrn commented Jun 4, 2018

It seems a problem that the core isolation in Windows is enabled. See here:
https://stackoverflow.com/a/50403200/8585276

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants