官术网_书友最值得收藏!

Injecting unattend.xml into VHD(X)

After creating the unattend.xml file which includes your customized settings, we need to inject it into the image.

To create a VHD(X) image, please refer to the Building and customizing a Nano Server image Using Windows PowerShell and Building and customizing a Nano Server image using Nano Server Image Builder sections covered earlier.

Injecting the unattend.xml into a VHD(X) basically involves mounting the image first.

There are four steps involved to inject the unattend.xml file, as follow:

  1. Before we inject the unattend.xml file, we should create a mount directory.

From an elevated command prompt, run the following command:

dism /Mount-Image /ImageFile:.\NanoServer.vhdx /Index:1 /MountDir:.\mountdir 

Please update the extension of the image VHD(X) according to the image created earlier.

  1. Apply the unattend.xml file that you already created and customized by running the following command:
dism /image:.\mountdir /Apply-Unattend:.\unattend.xml 
  1. Create a Panther folder under C:\Windows\ (this folder is used by Windows systems for storing files during setup). Copy the unattend.xml file to it using the following two commands:
md .\mountdir\windows\panther
copy .\unattend.xml .\mountdir\windows\panther

What this does is basically, when the image is booting, the offline servicing section of the unattend.xml file will execute without any reboot. However, with oobeSystem and specialize, the content of those two sections of the unattend.xml will execute on boot, so as the Nano Server boots, they will execute.

  1. Unmount the VHD with /commit which is very important to keep these changes by running the following command:
    dism /Unmount-Image /MountDir:.\mountdir /Commit

We would prefer to use Windows PowerShell that we covered earlier to create and customize a Nano image using the Nano PowerShell module.

主站蜘蛛池模板: 呼玛县| 秭归县| 万全县| 都江堰市| 磴口县| 织金县| 都安| 乐清市| 房产| 桑日县| 漠河县| 五原县| 南昌县| 伊吾县| 鄂州市| 分宜县| 资阳市| 甘南县| 辰溪县| 芮城县| 高青县| 佳木斯市| 霞浦县| 沾益县| 紫阳县| 龙门县| 柞水县| 庆云县| 鄂托克旗| 重庆市| 台南县| 丰都县| 凤阳县| 永城市| 洛扎县| 环江| 宜都市| 荃湾区| 乌兰县| 金山区| 河间市|