创建一台拉倒服务器

创建一台拉倒服务器

把光盘上的 H:\NanoServer\NanoServerImageGenerator 复制到本地
加载模块 NanoServerImageGenerator

New-NanoServerImage -Edition Standard -DeploymentType Guest -MediaPath h:\ -BasePath .\BaseVHD -TargetPath .\Nano1\Nano.vhd -ComputerName Nano1

位于命令管道位置 1 的 cmdlet New-NanoServerImage
请为以下参数提供值:
AdministratorPassword: ********

Windows(R) Image to Virtual Hard Disk Converter for Windows(R) 10
Copyright (C) Microsoft Corporation.  All rights reserved.
Version 10.0.14300.1000.amd64fre.rs1_release_svc.160324-1723

INFO   : Looking for the requested Windows image in the WIM file
INFO   : Image 1 selected (ServerStandardNano)...
INFO   : Creating sparse disk...
INFO   : Attaching VHD...
INFO   : Initializing disk...
INFO   : Creating single partition...
INFO   : Formatting windows volume...
INFO   : Windows path (F:) has been assigned.
INFO   : System volume location: F:
INFO   : Applying image to VHD. This could take a while...
INFO   : Image was applied successfully.
INFO   : Making image bootable...
INFO   : Fixing the Device ID in the BCD store on VHD...
INFO   : Drive is bootable.  Cleaning up...
INFO   : Closing VHD...
INFO   : Closing Windows image...
INFO   : Done.
Done. The log is at: C:\Users\XX\AppData\Local\Temp\NanoServerImageGenerator.log

创建的服务器很小,大概只有五百兆左右。
日志实际上就是一条命令:

New-NanoServerImage -Edition:Standard -DeploymentType:Guest -MediaPath:h:\ -BasePath:.\BaseVHD -TargetPath:.\Nano1\Nano.vhd -ComputerName:Nano1 -AdministratorPassword:System.Security.SecureString
& '.\BaseVHD\Tools\dism.exe' /Mount-Image /ImageFile:'C:\vhdx\Nano1\Nano.vhd' /MountDir:'C:\vhdx\BaseVHD\Temp\w1273885050' -Index:1 /LogLevel:2 /LogPath:'C:\Users\xx\AppData\Local\Temp\NanoServerImageGenerator (DISM).log'
& '.\BaseVHD\Tools\dism.exe' /Add-Package /PackagePath:'C:\vhdx\BaseVHD\Packages\Microsoft-NanoServer-Guest-Package.cab' /Image:'C:\vhdx\BaseVHD\Temp\w1273885050' /LogLevel:2 /LogPath:'C:\Users\xx\AppData\Local\Temp\NanoServerImageGenerator (DISM).log'
& '.\BaseVHD\Tools\dism.exe' /Add-Package /PackagePath:'C:\vhdx\BaseVHD\Packages\zh-cn\Microsoft-NanoServer-Guest-Package_zh-cn.cab' /Image:'C:\vhdx\BaseVHD\Temp\w1273885050' /LogLevel:2 /LogPath:'C:\Users\xx\AppData\Local\Temp\NanoServerImageGenerator (DISM).log'
& '.\BaseVHD\Tools\dism.exe' /Image:'C:\vhdx\BaseVHD\Temp\w1273885050' /Apply-Unattend:'.\BaseVHD\Temp\Unattend.xml' /LogLevel:2 /LogPath:'C:\Users\xx\AppData\Local\Temp\NanoServerImageGenerator (DISM).log'
& '.\BaseVHD\Tools\dism.exe' /Unmount-Image /MountDir:'C:\vhdx\BaseVHD\Temp\w1273885050' /Commit /LogLevel:2 /LogPath:'C:\Users\xx\AppData\Local\Temp\NanoServerImageGenerator (DISM).log'
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值