Understanding ImageX
认识
ImageX
Before you can perform image-based deployment, you first need to understand the ImageX tool, which is included in the Windows AIK (and which we copied onto our Windows PE CD in the previous article). ImageX is a command-line utility for capturing, servicing and applying Windows Imaging Format (WIM) files, which are file-based Windows disk images used by Windows Vista and later. Table 1 shows the different command-line options available when using ImageX.
在实施基于镜像的部署之前,你应当先了解
ImageX
工具。
ImageX
是一个命令行工具,用于抓取、配置和应用
WIM
文件。下表显示了
ImageX
的可用命令行选项。
Option
|
Description
|
/append
|
Used to append an image to an existing WIM file
|
/apply
|
Used to apply an image to a specified volume
|
/capture
|
Used to capture an image from a volume to a new WIM file
|
/delete
|
Used to delete the specified image from a WIM file containing multiple images
|
/dir
|
Used to view a list of the files and folders within a specified image
|
/export
|
Used to export a copy of the specified WIM file to another WIM file.
|
/info
|
Displays the total file size, image index number, directory count, file count, description and other information for the specified WIM file
|
/mount
|
Used to mount a WIM file to a specified directory with read-only permission, which lets you to view but not change the information contained in the directory
|
/mountrw
|
Used to mount a WIM file to a specified directory with read/write permission, which lets you to view and change the information in the directory.
|
/unmount
|
Used to dismount a mounted image from a specified directory
|
We’ll see examples of how to use ImageX when we walk through image-based deployment in a moment.
下面我们举例说明如何使用
ImageX
来进行基于镜像的部署。
Steps for Image-Based Deployment
基于镜像的部署步骤
Before we walk through performing a simple image-based deployment of VistaSP1, let’s step back and take a high-level view of how the deployment process works. Image-based deployment is the process of creating a master image, capturing that image, and then applying the captured image to one or more destination computers. In more detail, the steps for performing image-based deployment look like this (see Figure 1):
在我们开始执行基于镜像的
Vista SP1
部署前,先让我们退一步从更高的视角看看部署步骤如何进行。基于镜像的部署包括:创建母镜像、抓取镜像应用镜像、把镜像应用到其他计算机上。入下图所示:
Step 1: Install Vista on a reference computer that will server as the model for the other computers you want to deploy Vista onto. This reference computer is known as the master computer because it contains the master installation of Vista which you plan to duplicate onto multiple destination computers across your enterprise. You can install your reference computer manually, or you can do it using the unattended install from DVD method outlined in Part 8 of this series.
步骤
1
:在参考计算机上安装
Vista
。你可以手动安装,也可以参照前面的方法无人职守安装。
Step 2: Customize your master installation by adding drivers, turning on Windows features, installing applications, and performing other kinds of customizations needed by your users.
步骤
2
:订制你的计算机,安装所需要的软件、驱动,配置
Windows
的功能等等,直到满足你的企业用户的需求
Step 3: Now sysprep your master installation to remove any machine-specific information from it such as security identifiers (SIDs).
使用
Sysprep
移除你的计算机信息,例如
SIDs
Short aside: Step 3 is necessary whenever you want to duplicate an image and apply it to other machines because if you have two or more computers on your network that have the same SIDs, you’re in trouble. By design, each Windows installation has a unique machine SID that includes a randomly-generated 96-bit number. This machine SID is used as a prefix for the SIDs of any user and group accounts created on the computer. Specifically, the unique machine SID is concatenated with the relative ID (RID) of the user or group account to create a unique identifier for the account. So if you duplicate an image onto another computer without removing the SIDs first, you’ll end up with two computers that have identical SIDs, and one of the consequences of this is that user accounts on one computer will have access to files stored on removable media on the other computer even if NTFS permissions are configured to deny access. In other words, security breaks down when you duplicate installations that haven’t been sysprepped. Even worse security issues will occur if you have computers with duplicate SIDs in a domain including login problems, trust issues, problems accessing resources, roaming profile failures, and more.
步骤
3
是必须的,因为两台计算机不能拥有相同的
SIDs
,不然会有麻烦的。一般情况下,每台计算机在安装过程中生成一个
96
位的随机数字。关于
SID
的知识,还是上
Google
搜索吧,不翻译了
….
Step 4: Boot your sysprepped master installation using the bootable Windows PE CD you created in the previous article in this series.
步骤
4
:用之前创建的
PE
引导你刚
sysprep
的机器
Step 5: Once the Windows PE command prompt is displayed, capture a Windows image of your master installation. Your captured image is called your base image because you will base your deployment on it.
步骤
5
:当命令行出现时,用
imagex
工具抓取镜像,抓取的镜像则称为基本镜像,将来会用于大规模部署
Step 6: Copy your base image to a network share.
步骤
6
:把创建的镜像拷贝到网络共享上
Step 7: You’re now ready to deploy your base image to your destination computers which currently have no operating system installed. To deploy the base image to a destination computer, use your bootable Windows PE CD to boot your bare-metal destination computer. Once the Windows PE command prompt appears, partition and format your hard drive using the Diskpart command. Then map a drive to the network share where your based image (the captured image of your master installation) is stored. Then use ImageX to apply the base image to your destination computer. Repeat as needed for as many destination computers as you need to deploy.
步骤
7
;你现在已经准备好,剩下的就是开始部署。用
PE
启动那些要部署系统的裸机,当命令行出现后,用
diskpart
创建分区并格式化,连接共享,接着用
imageX
把镜像应用到磁盘上,这就完成了安装。
Variations on Image-Based Deployment
验证基于镜像的部署
The above seven-step procedure outlines how to perform a simple, basic image-based installation of Vista onto multiple bare-metal systems starting from a customized reference installation you created. In the next article of this series we’ll walk through these steps and see in detail how to perform each step. There are two other ways of performing image-based deployment you should know about however. These include the following variations on the above process:
上述七个步骤概述了如何执行一个简单的、基于镜像的
Vista
安装。我们还会探讨这些步骤中的细节。据我所知还有两种方法来进行基于镜像的安装。
Image-based deployment using Windows Setup. In this approach, you create your master installation and capture it to a network share as described above. Then you use Windows System Image Manager (Windows SIM) on your technician computer to create an answer file for unattended installation of your master installation by opening the captured WIM file in Windows SIM, creating your answer file, and saving the answer file to the same network share where the captured WIM file resides. Then you boot your destination computers using Windows PE, connect to the network share where the captured WIM file and answer file are located, and run Windows Setup by typing <mapped drive>\setup.exe /unattend:unattend.xml. Windows Setup then copies the captured image onto your destination computer and installs it using the options you’ve specified in your answer file. For more information concerning this scenario, see the Windows AIK Help file.
使用
Windows
安装程序的基于镜像安装。在这种方法里,你把抓取的镜像放在网络共享上。接下来你使用
Windows SIM
创建无人安装的应答文件。接下来你从目标计算机用
PE
引导,连接网络共享,运行
Setup.exe /unattend:unattend.xml
启动安装,
Windows
安装程序会把镜像拷贝到计算机上并进行安装。
Image-based deployment using Windows Deployment Services. In this approach, you create your master installation and capture it from a server running Windows Deployment Services (Windows DS). Windows DS is a server role in Windows Server 2008 that represents the next evolutionary version of Remote Installation Services (RIS) which first appeared in Windows 2000 Server. The nice thing about this approach is that you don’t need to use a Windows PE CD to boot each destination computer. Instead, you simply turn them on and they use PXE to obtain an IP address from a DHCP server, then they use TFTP to download a boot client from the Windows DS server, then the boot client applies the captured image. We’ll see how to use Windows DS soon in future articles in this series.
使用
Windows Deployment Services
进行基于镜像的部署。
WDS
用于取代老旧的
RIS
服务,使用
WDS
后就不需要将
PE
烧录到光盘里,可以直接通过网络进行
PXE
引导,用
TFTP
获得
PE
镜像来进行你需要的操作。