Running chefdk
on Windows 10 with hyperv
.
I can use kitchen create
to create Windows VMs and it works fine but I just tried a Linux VM and I'm getting this errror:
PS> kitchen create
-----> Starting Kitchen (v1.10.0)
-----> Creating <default-centos-72>...
Creating differencing disk for default-centos-72.
Created differencing disk for default-centos-72.
Checking for existing virtual machine.
Creating virtual machine for default-centos-72.
Created virtual machine for default-centos-72.
QBiA...AA== -outputformat Text ----
STDOUT:
STDERR: #< CLIXML
---- End output of c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -noprofile -executionpolicy bypass -encodedcommand LgAg...AA== -outputformat Text ----
ProcessId: 18780
app_name: c:\windows\sysnative\windowspowershell\v1.0\powershell.exe
command_line: c:\windows\sysnative\windowspowershell\v1.0\powershell.exe -noprofile -executionpolicy bypass -encodedcommand LgAgAEM...BjADC0ASgBzAG8AbgAKAA== -outputformat Text
timeout: 600] on default-centos-72
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration
Now it does create a VM which I can manually ssh
into via PuTTY or from cmd via openssh for Windows so I don't know why its hanging- looks like it can't access it.
This is my .kitchen.yml
:
---
driver:
name: hyperv
parent_vhd_folder: c:\HyperV\VHDs\
parent_vhd_name: CentOS-7.vhdx
vm_switch: NAT
memory_startup_bytes: 2GB
provisioner:
name: chef_zero
transport:
password: MyPassw1!@#
platforms:
- name: centos-7.2
suites:
- name: default
run_list:
- recipe[myrecipe::default]
attributes:
Edit- More info: The server is configured for DHCP When I look in .kitchen folder the logs are empty .kitche\default-centos-72.yml only lists an id (don't know if thats supposed to have the admin name and IP in it like with rdp files? I also tried pointing to a static IP in .kitchen.yml
OK Steven was right, should have look into to this sooner.
This looks like it might be related to this bug.
As he suggested I found Hyper-V wasn't reporting the IP on the guest and I see this:
Disabling SELinux and rebooting seems to solve this error, I can see the guest's IP in Hyper-V and kitchen create works.
Is there a way to allow this service access without completely disabling selinux?