在KVM上无人参与安装Windows Server 2012

我正在尝试使用virt-install将Windows Server 2012无人参与安装到KVM虚拟机中。 安装程序抱怨说:“Windows无法从无人参与应答文件中读取<ProductKey>设置,我一直无法弄清楚如何继续这一点。

我从下面的autounattend.xml文件开始:

 <unattend xmlns="urn:schemas-microsoft-com:unattend" xmlns:ms="urn:schemas-microsoft-com:asm.v3" xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State"> <settings pass="windowsPE"> <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86"> <UserData> <AcceptEula>true</AcceptEula> <ProductKey> <Key>XXXXX-XXXXX-XXXXX-XXXXX-XXXXX</Key> <WillShowUI>OnError</WillShowUI> </ProductKey> </UserData> <ImageInstall> <OSImage> <WillShowUI>Never</WillShowUI> <InstallTo> <DiskID>0</DiskID> <PartitionID>1</PartitionID> </InstallTo> <InstallFrom> <MetaData> <Key>/IMAGE/Name</Key> <Value>Windows Longhorn SERVERSTANDARDCORE</Value> </MetaData> </InstallFrom> </OSImage> </ImageInstall> </component> </settings> </unattend> 

我使用mkisofs将其烘焙成ISO映像:

 $ ls config/ autounattend.xml $ mkisofs -o config.iso -J -r config 

然后我开始像这样安装:

 virt-install -n ws2012 -r 2048 -w network=default,model=virtio \ --disk path=ws2012.qcow2,device=disk,bus=virtio \ --cdrom en_windows_server_2012_r2_with_update_x64_dvd_4065220.iso \ --disk path=virtio-win-0.1-81.iso,device=cdrom \ --disk path=config.iso,device=cdrom \ --os-type windows --os-variant win2k8 

看看x:\windows\panther\setupact.log ,我可以看到安装程序确实find了无人参与文件:

 2014-11-14 12:29:43, Info [0x060114] IBS Callback_Productkey_Validate_Unattend:User specified an unattend xml file 

指定的产品密钥是有效的(我可以将其从此文件复制并粘贴到产品密钥对话框中,安装将正确进行)。

你知道如何使这个安装工作​​?

我们用于为OpenStack生成官方Windows Server 2012 R2评估映像的过程在此处详述:

https://github.com/cloudbase/windows-openstack-imaging-tools

Windows OpenStack映像(KVM和Hyper-V):

http://www.cloudbase.it/ws2012r2/

在这种情况下,答案很简单。 我有:

 <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="x86"> 

当我需要时:

 <component name="Microsoft-Windows-Setup" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS" processorArchitecture="amd64"> 

也就是说,我在我的XML中有错误的processorArchitecture (我之前完全应该看到)。

我知道有一个工作,完全自动化的过程,导致Windows映像适合部署在OpenStack。 我正在使用的脚本和configuration在github上可用 。