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

Hyperv/Windows10 - Error creating machine: Error in driver during machine creation: exit status 1 #2267

Closed
j4fm opened this issue Nov 12, 2015 · 22 comments

Comments

@j4fm
Copy link

j4fm commented Nov 12, 2015

On Windows 10 with Hyper V driver, I receive "Error creating machine: Error in driver during machine creation: exit status 1" most of the time. Occasionally, it succeeds but I can find nothing reliable to make it succeed every time.

The new VM fails to start when instructed by the Docker Hyper V driver. I can always start it manually successfully but then the certificates are invalid in docker for the VM because it never completed the creation.

Windows Event Log for Hyper V Worker shows:

Microsoft Emulated IDE Controller (Instance ID 83F8638B-8DCA-4152-9EDA-2CA8B33039B4): Failed to Power on with Error 'The process cannot access the file because it is being used by another process.' (0x80070020). (Virtual machine ID 4F21E751-1C17-462E-B659-97BD9FBE2783)

and

Failed to open attachment 'C:\Users\user.docker\machine\machines\dockerhost1\boot2docker.iso'. Error: 'The process cannot access the file because it is being used by another process.' (7864368). (Virtual machine ID 4F21E751-1C17-462E-B659-97BD9FBE2783)

The ISO file is not mounted by the system or any other VM.

I have disabled antivirus and indexing for the entire docker folder and confirmed that neither are causing the lock by using Process Monitor.

This was installed using Docker Toolbox 1.9.0b. I never had this problem with the previous version of Docker.

Client:
Version: 1.9.0
API version: 1.21
Go version: go1.4.3
Git commit: 76d6bc9
Built: Tue Nov 3 19:20:09 UTC 2015
OS/Arch: windows/amd64

Server:
Version: 1.9.0
API version: 1.21
Go version: go1.4.3
Git commit: 76d6bc9
Built: Tue Nov 3 19:20:09 UTC 2015
OS/Arch: linux/amd64

Thanks

James

@sebfia
Copy link

sebfia commented Nov 13, 2015

Exactly the same here!

@j4fm
Copy link
Author

j4fm commented Nov 13, 2015

I currently work around the problem by:

  1. After the failure, running "docker-machine start [machinename]"
  2. Wait for the machine to start fully
  3. Running "docker-machine regenerate-certs [machinename]"

James

@JigSawFr
Copy link

Confirmed, W10 & HyperV

@dubrowgn
Copy link

I'm seeing this on windows 8.1 with HyperV as well

@DraconPern
Copy link

Same problem on a Windows 2012 R2 cluster

@DraconPern
Copy link

I did some test with --debug. I think the problem is that Set-VMDvdDrive and Add-VMHardDiskDrive return before the operation is actually done since the commands just queues up the operation in the hyper-v service queue. What needs to be added is a loop that calls Get-VM and look for "Operating normally" in the status. Then when the status is 'normal', call Start-VM

@j4fm
Copy link
Author

j4fm commented Jan 24, 2016

This was fixed from Docker Machine v0.5.5 onwards

@j4fm j4fm closed this as completed Jan 24, 2016
@DraconPern
Copy link

Can you reference the patch that fixed this? I had this issue running docker-machine and not with docker-compose.

@j4fm
Copy link
Author

j4fm commented Jan 24, 2016

There is no reference to the issue number on the Machine 0.5.5 release notes. If you look on the release notes, it is mentioned.

"Close handle after copying boot2docker.iso into vm folder - will otherwise keep hyper-v from starting vm"

(Compose was a mistake which I corrected in previous comment. I meant Machine)

@dgageot
Copy link
Member

dgageot commented Jan 24, 2016

This is fixed in 1cd6a37

@mrcaron
Copy link

mrcaron commented Jun 2, 2016

I'm using docker-machine v0.7.0 and it still persists. :(

Here's the debug output of create command:

PS C:\Windows\system32> docker-machine --debug create -d hyperv dev
Docker Machine Version: 0.7.0, build a650a40
Found binary path at C:\ProgramData\chocolatey\lib\docker-machine\bin\docker-machine.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:52639
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(flag-lookup) Calling .GetMachineName
(flag-lookup) Calling .DriverName
(flag-lookup) Calling .GetCreateFlags
Found binary path at C:\ProgramData\chocolatey\lib\docker-machine\bin\docker-machine.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:52643
() Calling .GetVersion
Using API Version 1
() Calling .SetConfigRaw
() Calling .GetMachineName
(dev) Calling .GetMachineName
(dev) Calling .DriverName
(dev) Calling .GetCreateFlags
(dev) Calling .SetConfigFromFlags
Running pre-create checks...
(dev) Calling .PreCreateCheck
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @(Ge
t-Command Get-VM).ModuleName
(dev) DBG | [stdout =====>] : Hyper-V
(dev) DBG |
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole("Hyper-V Administrators")
(dev) DBG | [stdout =====>] : False
(dev) DBG |
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
(dev) DBG | [stdout =====>] : True
(dev) DBG |
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (Get-VMSwitch).Name
(dev) DBG | [stdout =====>] : External
(dev) DBG |
(dev) DBG | [stderr =====>] :
(dev) DBG | local Boot2Docker ISO version: v1.11.2
(dev) Calling .GetConfigRaw
Creating machine...
(dev) Calling .Create
(dev) DBG | local Boot2Docker ISO version: v1.11.2
(dev) Copying C:\Users\mrc.docker\machine\cache\boot2docker.iso to C:\Users\mrc.docker\machine\machines\dev\boot2docker.iso...
(dev) Creating SSH key...
(dev) Creating VM...
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive (Get
-VMSwitch).Name
(dev) DBG | [stdout =====>] : External
(dev) Using switch "External"
(dev) DBG |
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive @([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")
(dev) DBG | [stdout =====>] : True
(dev) Creating VHD
(dev) DBG |
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive New-VHD -Path 'C:\Users\mrc.docker\machine\machines\dev\fixed.vhd' -SizeBytes 10MB -Fixed
(dev) DBG | [stdout =====>] :
(dev) DBG |
(dev) DBG | ComputerName : DESKTOP-HINMSEO
(dev) DBG | Path : C:\Users\mrc.docker\machine\machines\dev\fixed.vhd
(dev) DBG | VhdFormat : VHD
(dev) DBG | VhdType : Fixed
(dev) DBG | FileSize : 10486272
(dev) DBG | Size : 10485760
(dev) DBG | MinimumSize :
(dev) DBG | LogicalSectorSize : 512
(dev) DBG | PhysicalSectorSize : 512
(dev) DBG | BlockSize : 0
(dev) DBG | ParentPath :
(dev) DBG | DiskIdentifier : cfccf860-a8ee-48cd-bad9-045edf3fa4a0
(dev) DBG | FragmentationPercentage : 0
(dev) DBG | Alignment : 1
(dev) DBG | Attached : False
(dev) DBG | DiskNumber :
(dev) DBG | Number :
(dev) DBG |
(dev) DBG |
(dev) DBG |
(dev) DBG |
(dev) DBG | [stderr =====>] :
(dev) DBG | Writing magic tar header
(dev) DBG | Writing SSH key tar header
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Convert-VHD -Path 'C:\Users\mrc.docker\machine\machines\dev\fixed.vhd' -DestinationPath 'C:\Users\mrc.docker\machine\machines\dev\disk.vhd' -VHDType Dynamic -DeleteSource
(dev) DBG | [stdout =====>] :
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Resize-VHD -Path 'C:\Users\mrc.docker\machine\machines\dev\disk.vhd' -SizeBytes 20000MB
(dev) DBG | [stdout =====>] :
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive New-VM dev -Path 'C:\Users\mrc.docker\machine\machines\dev' -SwitchName 'External' -MemoryStartupBytes 1024MB
(dev) DBG | [stdout =====>] :
(dev) DBG | Name State CPUUsage(%) MemoryAssigned(M) Uptime Status Version
(dev) DBG | ---- ----- ----------- ----------------- ------ ------ -------
(dev) DBG | dev Off 0 0 00:00:00 Operating normally 6.2
(dev) DBG |
(dev) DBG |
(dev) DBG |
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Set-VMDvdDrive -VMName dev -Path 'C:\Users\mrc.docker\machine\machines\dev\boot2docker.iso'
(dev) DBG | [stdout =====>] :
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Add-VMHardDiskDrive -VMName dev -Path 'C:\Users\mrc.docker\machine\machines\dev\disk.vhd'
(dev) DBG | [stdout =====>] :
(dev) Starting VM...
(dev) DBG | [stderr =====>] :
(dev) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Start-VM dev
(dev) DBG | [stdout =====>] :
(dev) DBG | [stderr =====>] : Start-VM : 'dev' failed to start.
(dev) DBG | 'dev' could not initialize.
(dev) DBG | Not enough memory in the system to start the virtual machine dev.
(dev) DBG | 'dev' failed to start. (Virtual machine ID 45C83904-38D7-4147-BF52-3F0BDD887409)
(dev) DBG | 'dev' could not initialize. (Virtual machine ID 45C83904-38D7-4147-BF52-3F0BDD887409)
(dev) DBG | Not enough memory in the system to start the virtual machine dev with ram size 1024 megabytes. (Virtual machine ID
(dev) DBG | 45C83904-38D7-4147-BF52-3F0BDD887409)
(dev) DBG | At line:1 char:1
(dev) DBG | + Start-VM dev
(dev) DBG | + ~~~~~~~~~~~~
(dev) DBG | + CategoryInfo : FromStdErr: (:) [Start-VM], VirtualizationException
(dev) DBG | + FullyQualifiedErrorId : OutOfMemory,Microsoft.HyperV.PowerShell.Commands.StartVM
(dev) DBG |
(dev) DBG |
Error creating machine: Error in driver during machine creation: exit status 1
open : The system cannot find the file specified.
notifying bugsnag: [Error creating machine: Error in driver during machine creation: exit status 1]

@mrcaron
Copy link

mrcaron commented Jun 2, 2016

even after maxxing memory out, it doesn't work :( My machine has 4GB... is that a limitation?

@javafun
Copy link

javafun commented Dec 6, 2016

@mrcaron
I have having the same issue on windows 10 Aniversary, my machine have 8gb ram, still not enought

(vm) DBG | [stderr =====>] :
(vm) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Add-VMHardDiskDrive -VMName vm -Path 'C:\Users\admin.docker\machine\machines\vm\disk.vhd'
(vm) Starting VM...
(vm) DBG | [stdout =====>] :
(vm) DBG | [stderr =====>] :
(vm) DBG | [executing ==>] : C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Start-VM vm
(vm) DBG | [stdout =====>] :
(vm) DBG | [stderr =====>] : Start-VM : 'vm' failed to start.
(vm) DBG | Not enough memory in the system to start the virtual machine vm.
(vm) DBG | Could not initialize memory: Ran out of memory (0x8007000E).
(vm) DBG | 'vm' failed to start. (Virtual machine ID 9BE6C5CA-A7F4-4048-ACE3-7B8E42FF2674)
(vm) DBG | Not enough memory in the system to start the virtual machine vm with ram size
(vm) DBG | 1024 megabytes. (Virtual machine ID 9BE6C5CA-A7F4-4048-ACE3-7B8E42FF2674)
(vm) DBG | 'vm' could not initialize memory: Ran out of memory (0x8007000E). (Virtual
(vm) DBG | machine ID 9BE6C5CA-A7F4-4048-ACE3-7B8E42FF2674)
(vm) DBG | At line:1 char:1
(vm) DBG | + Start-VM vm
(vm) DBG | + ~~~~~~~~~~~
(vm) DBG | + CategoryInfo : FromStdErr: (:) [Start-VM], VirtualizationExcept
(vm) DBG | ion
(vm) DBG | + FullyQualifiedErrorId : OutOfMemory,Microsoft.HyperV.PowerShell.Commands
(vm) DBG | .StartVM
(vm) DBG |
(vm) DBG |
Error creating machine: Error in driver during machine creation: exit status 1
notifying bugsnag: [Error creating machine: Error in driver during machine creation: exit status 1]

@TheOtherRealm
Copy link

Same issue

@ronycohen
Copy link

Does anyone found the solution ?
I encounter the same issue on testing docker-machine create new VM with hyper-v.

@mrcaron
Copy link

mrcaron commented May 19, 2017

@ronyrun not yet... still in limbo 👎

@blaylockbk
Copy link

same here

@stzyx14
Copy link

stzyx14 commented Jun 16, 2017

I found my problem is lacking of memory

@aaronmorgan
Copy link

Cycling the Windows Management Instrumentation service fixed the issue for me (Windows 10).

@jeanphilippefortin
Copy link

Running docker-machine -D start vmname show you the error. Mine was lack of memory... Added RAM to host VM and everything ran fine after...

@chenhailun2006
Copy link

Running docker-machine -D start vmname show you the error. Mine was lack of memory... Added RAM to host VM and everything ran fine after...

After run docker-machine -D start myvm2, debug info as follows:


PS D:\> docker-machine -D start myvm2
Docker Machine Version:  0.16.2, build bd45ab13
Found binary path at C:\Program Files\Docker\Docker\Resources\bin\docker-machine.exe
Launching plugin server for driver hyperv
Plugin server listening at address 127.0.0.1:64401
() Calling .GetVersion
Using API Version  1
() Calling .SetConfigRaw
() Calling .GetMachineName
command=start machine=myvm2
Starting "myvm2"...
(myvm2) Calling .GetState
(myvm2) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive ( H
yper-V\Get-VM myvm2 ).state
(myvm2) DBG | [stdout =====>] : Off
(myvm2) DBG |
(myvm2) DBG | [stderr =====>] :
(myvm2) Calling .Start
(myvm2) DBG | [executing ==>] : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive Hyp
er-V\Start-VM myvm2
(myvm2) DBG | [stdout =====>] :
(myvm2) DBG | [stderr =====>] : Hyper-V\Start-VM : “myvm2”无法启动。
exit status 1

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