学习PowerShell并致力于使用Hyper-v创build虚拟机。 我想知道有没有一种方法或一个理想的方式来安装/设置客户操作系统呢?
到目前为止,我唯一的结论是复制.vhd / .vhdx并将它们附加到新的虚拟机上。 但是,我知道用* nix这可能会导致整个networking设置的问题,需要手动修复,但我认为这将是很好的Windows明智吗?
编辑:是的,我知道用于Hyper-V的cmdlet。 这不是我所要求的。 有没有办法将操作系统安装到新创build的虚拟机 ?
有关创buildVM并从头开始安装操作系统的示例,请参阅http://technet.microsoft.com/en-us/magazine/jj933287.aspx 。
步骤是创build虚拟机,configuration虚拟机,添加源ISO和软盘与unmattend.xml,然后启动虚拟机
是。 PowerShell可以在Hyper-V虚拟机上做很多事情。 从你的select表单下面的CMDlets:
Add-VMDvdDrive Add-VMFibreChannelHba Add-VMHardDiskDrive Add-VMMigrationNetwork Add-VMNetworkAdapter Add-VMNetworkAdapterAcl Add-VMNetworkAdapterExtendedAcl Add-VmNetworkAdapterRoutingDomainMapping Add-VMRemoteFx3dVideoAdapter Add-VMScsiController Add-VMStoragePath Add-VMSwitch Add-VMSwitchExtensionPortFeature Add-VMSwitchExtensionSwitchFeature Checkpoint-VM Compare-VM Complete-VMFailover Connect-VMNetworkAdapter Connect-VMSan Convert-VHD Copy-VMFile Debug-VM Disable-VMEventing Disable-VMIntegrationService Disable-VMMigration Disable-VMRemoteFXPhysicalVideoAdapter Disable-VMResourceMetering Disable-VMSwitchExtension Disconnect-VMNetworkAdapter Disconnect-VMSan Dismount-VHD Enable-VMEventing Enable-VMIntegrationService Enable-VMMigration Enable-VMRemoteFXPhysicalVideoAdapter Enable-VMReplication Enable-VMResourceMetering Enable-VMSwitchExtension Export-VM Export-VMSnapshot Get-VHD Get-VM Get-VMBios Get-VMComPort Get-VMConnectAccess Get-VMDvdDrive Get-VMFibreChannelHba Get-VMFirmware Get-VMFloppyDiskDrive Get-VMHardDiskDrive Get-VMHost Get-VMHostNumaNode Get-VMHostNumaNodeStatus Get-VMIdeController Get-VMIntegrationService Get-VMMemory Get-VMMigrationNetwork Get-VMNetworkAdapter Get-VMNetworkAdapterAcl Get-VMNetworkAdapterExtendedAcl Get-VMNetworkAdapterFailoverConfiguration Get-VmNetworkAdapterIsolation Get-VMNetworkAdapterRoutingDomainMapping Get-VMNetworkAdapterVlan Get-VMProcessor Get-VMRemoteFx3dVideoAdapter Get-VMRemoteFXPhysicalVideoAdapter Get-VMReplication Get-VMReplicationAuthorizationEntry Get-VMReplicationServer Get-VMResourcePool Get-VMSan Get-VMScsiController Get-VMSnapshot Get-VMStoragePath Get-VMSwitch Get-VMSwitchExtension Get-VMSwitchExtensionPortData Get-VMSwitchExtensionPortFeature Get-VMSwitchExtensionSwitchData Get-VMSwitchExtensionSwitchFeature Get-VMSystemSwitchExtension Get-VMSystemSwitchExtensionPortFeature Get-VMSystemSwitchExtensionSwitchFeature Grant-VMConnectAccess Import-VM Import-VMInitialReplication Measure-VM Measure-VMReplication Measure-VMResourcePool Merge-VHD Mount-VHD Move-VM Move-VMStorage New-VFD New-VHD New-VM New-VMReplicationAuthorizationEntry New-VMResourcePool New-VMSan New-VMSwitch Optimize-VHD Remove-VM Remove-VMDvdDrive Remove-VMFibreChannelHba Remove-VMHardDiskDrive Remove-VMMigrationNetwork Remove-VMNetworkAdapter Remove-VMNetworkAdapterAcl Remove-VMNetworkAdapterExtendedAcl Remove-VMNetworkAdapterRoutingDomainMapping Remove-VMRemoteFx3dVideoAdapter Remove-VMReplication Remove-VMReplicationAuthorizationEntry Remove-VMResourcePool Remove-VMSan Remove-VMSavedState Remove-VMScsiController Remove-VMSnapshot Remove-VMStoragePath Remove-VMSwitch Remove-VMSwitchExtensionPortFeature Remove-VMSwitchExtensionSwitchFeature Rename-VM Rename-VMNetworkAdapter Rename-VMResourcePool Rename-VMSan Rename-VMSnapshot Rename-VMSwitch Repair-VM Reset-VMReplicationStatistics Reset-VMResourceMetering Resize-VHD Restart-VM Restore-VMSnapshot Resume-VM Resume-VMReplication Revoke-VMConnectAccess Save-VM Set-VHD Set-VM Set-VMBios Set-VMComPort Set-VMDvdDrive Set-VMFibreChannelHba Set-VMFirmware Set-VMFloppyDiskDrive Set-VMHardDiskDrive Set-VMHost Set-VMMemory Set-VMMigrationNetwork Set-VMNetworkAdapter Set-VMNetworkAdapterFailoverConfiguration Set-VmNetworkAdapterIsolation Set-VmNetworkAdapterRoutingDomainMapping Set-VMNetworkAdapterVlan Set-VMProcessor Set-VMRemoteFx3dVideoAdapter Set-VMReplication Set-VMReplicationAuthorizationEntry Set-VMReplicationServer Set-VMResourcePool Set-VMSan Set-VMSwitch Set-VMSwitchExtensionPortFeature Set-VMSwitchExtensionSwitchFeature Start-VM Start-VMFailover Start-VMInitialReplication Stop-VM Stop-VMFailover Stop-VMInitialReplication Stop-VMReplication Suspend-VM Suspend-VMReplication Test-VHD Test-VMNetworkAdapter Test-VMReplicationConnection
一般来说,pipe理程序不是安装操作系统的工作。 使用你的powershell来configuration虚拟机,然后开始你的构build过程,也可以脚本化。 在我开始使用pxe启动MDT映像之前,我会安装无人值守的iso文件。 一旦系统启动,就运行安装指导。 我猜这样的事情是你会在之后。
正如其他人所说,创build,configuration和pipe理虚拟机可以通过PowerShell轻松完成。
但是,如果您想要更多地控制VM生命周期,例如创build/部署模板和克隆磁盘,则应该查看System Center Virtual Machine Manager ; 它的操作当然是通过PowerShell完全脚本化的。
除了使用无人参与文件从媒体进行安装之外,完全有可能更快地将最新版本的Windowsconfiguration为完全脱机。 您将使用Hyper-V PowerShell cmdlet创buildVHD。 然后你会在其中安装一个Windows映像。 然后你将VHD连接到一个虚拟机并启动它。
也许最简单的方法是使用WIM2VHD脚本:
http://www.bing.com/search?q=Convert-WindowsImage.ps1%20%E2%80%94%20WIM2VHD%20for%20Windows%208%20and%20Windows%208.1&qs=n&form=QBRE&pq=convert-windowsimage的.ps1%20%E2%80%94%20wim2vhd%20for%20windows%208%20于是%20windows%208.1&SC = 0-7& SP = -1&SK =&CVID = cd83b480e637456090505eefa3fbc5f2
如果您想深入挖掘,上面的脚本是从OPK / AIK / MDT技术中的基元构build的:
http://www.bing.com/search?q=Deploy%20Windows%208.1%20with%20the%20Microsoft%20Deployment%20Toolkit&qs=n&form=QBRE&pq=deploy%20windows%208.1%20with%20the%20microsoft%20deployment%20toolkit&sc= 0-0& SP = -1&SK =&CVID = e821766decfe449381a60f13de482664