Windows Server TP3之N

发布时间:2019-07-05 09:51:46编辑:auto阅读(1905)

    其实之前在TP2的时候,写过一篇如何去制作NanoServer,最近TP3发布出来,我们就简单看一下跟TP2的一些改进。

    下载TP3之后,我挂载ISO,发现NanoServer文件夹内置两个脚本了。

    p_w_picpath

    convert-windowsp_w_picpath脚本是用于将WIM转换VHD的。

    new-nanoserverp_w_picpath脚本可以作于自定义NanoServer镜像(wim转换VHD,加载package包、加入域等等)

    具体可以参考链接:http://blogs.technet.com/b/nanoserver/archive/2015/06/16/powershell-script-to-build-your-nano-server-p_w_picpath.aspx

    下面我简单的演示下

    1.安装tp3系统,并安装hyper-v角色;

    p_w_picpath

    2.从iso复制NanoServer文件夹到C盘;

    p_w_picpath

    3.用管理员运行powershell,切换到nanoserver文件夹,并运行new-nanoserverp_w_picpath脚本;

    p_w_picpath

    PS:这个要注意是. .\new-nanoserverp_w_picpath.ps1,点与点之前有个空格哦。

    4.输入脚本

    New-NanoServerImage -MediaPath d:\ -BasePath C:\NanoServer\ -TargetPath C:\vm\NanoServerVM  -GuestDrivers -ComputerName NanoServerVM-AdministratorPassword (convertto-securestring -string "P@ssw0rd" -asplaintext -force)

    p_w_picpath

    p_w_picpath

    5.创建虚拟机,输入

    New-VM -Name NanoServerVM -MemoryStartupBytes 512MB -SwitchName vnet -VHDPath C:\vm\NanoServerVM\NanoServerVM.vhd -Path C:\vm\NanoServerVM\ -Generation 1

    p_w_picpath

    p_w_picpath

    6.启动虚拟机

    p_w_picpathp_w_picpath

关键字