|
|
[这个贴子最后由微软破解中心在 2005/08/06 01:10pm 第 3 次编辑]
XImage Technical Reference
XImage is a command-line tool that uses a set of APIs, known as Windows Imaging API (WIMGAPI), to perform tasks with the Microsoft Windows Imaging (.wim) files. The .wim files contain one or more volume images for a Windows operating system, while a volume image represents the captured volume or partition of a Windows operating system. The primary purpose of XImage is to capture, modify, and apply images for deployment in a manufacturing or corporate IT environment.
You typically use XImage with the Windows Imaging File System Filter (WIM FS Filter) driver. The WIM FS Filter driver enables you to mount an image to a directory, where you can browse, copy, paste, and edit the files from a file management tool, such as Windows Explorer, without extracting or recreating the image.
In this Section
What is XImage?
How XImage Works
XImage Command-Line Options
Related Sections
Configuration File Creation
Walkthrough: Capture an Image
Walkthrough: Compress an Image
Walkthrough: Mount and Modify an Image
Walkthrough: Apply a Deployment Image
What is XImage?
XImage is a command-line tool that enables Original Equipment Manufacturers (OEMs) and corporations to capture, modify, and apply file-based disk images for rapid deployment. XImage works with Windows Imaging (.wim) images for copying to a network, or it can work with other technologies that use the .wim images, such as Setup for Windows code-named "Longhorn," Windows Deployment Services (WDS), and the SMS Operating System Feature Deployment Pack.
Corporations that do not require the capture functionality or the low-level features included in XImage can still use related technologies such as unattended Setup, Group Policy, and Systems Management Server (SMS).
This topic includes:
Benefits of XImage
Common XImage Scenarios
Limitations of XImage
Dependencies of XImage
Technologies Related to XImage
Related Information
Benefits of Ximage
Many OEMs and corporations need to deploy and install Windows as rapidly as possible, including all relevant updates, applications, and settings. Reduced deployment and installation time lower manufacturing costs for OEMs, and can decrease cost and scheduling risk for corporate deployments. In the past, if OEMs and corporations wanted to minimize the amount of time required to install Windows, they had to use sector-based imaging formats, or the MS-DOS xcopy command, to copy an installation of Windows onto new hardware.
The sector-based imaging format and the MS-DOS xcopy command can have a number of limitations:
Sector-based imaging requires that the destination computer use the same Hardware Abstraction Layer (HAL) as the master computer.
Sector-based imaging requires that the destination computer boot from the same mass-storage controller as the master computer.
Sector-based imaging destroys the existing contents of the destination computer’s hard drive, complicating Windows deployment scenarios.
Sector-based imaging duplicates the hard drive exactly; therefore, the image can deploy only on partitions that are the same type as the master computer, and are at least as large as the partition on the master computer.
Sector-based imaging does not enable direct modification of imaged files.
Sector-based imaging may require the purchase of third-party applications and services.
The limitations of sector-based imaging led Microsoft to develop XImage and the accompanying Windows Image file-based image format. You can use XImage to create an image, modify the image without going through the extraction and re-creation process, and finally deploy the image to your environment, all from within the same tool. Because XImage works at the file level, it provides the following capabilities:
More flexibility and control over the deployed media.
Rapid extraction of images to decrease setup time.
A reduction in image size due to "single instancing," which means that the file data is stored separately from the path information. This enables files that exist in multiple paths or in multiple images to be stored once, and shared across the images.
Non-destruction application of images. XImage does not perform an all-inclusive overwrite of the contents of your drive. You can selectively add and remove information.
The ability to work across any platform supported by Windows.
Two different compression algorithms, Fast and Maximum, to further reduce your image size.
The ability to treat an image file like a directory. For example, you can add, copy, paste, and delete files from a file management tool, such as Windows Explorer.
Common XImage Scenarios
XImage is a command-line tool that enables the creation, modification, and deployment of images, by using a shared imaging format across operating system images, including applications. The following scenarios are particularly compatible with the XImage process.
Creating an Image for Rapid Deployment
The most common scenario for XImage is capturing and applying an image from a network location for rapid deployment. This scenario requires booting your technician computer into Windows PE, capturing the image using XImage, putting the image on a network share, and then applying the image to the destination computers.
Modifying an Image File
Another common scenario for XImage is customizing an existing image, including updating files and folders. This scenario involves adding, removing, editing, and copying files from your image using the WIM FS Filter driver and a file management tool, such as Windows Explorer.
Limitations of XImage
Ximage has the following limitations:
You can use XImage only to capture and apply a full version of the operating system and software applications. You cannot use XImage to capture and apply upgrades to the operating system or applications.
You can use only Windows Imaging formatted images to interact with XImage. Previous images, created with third-party imaging tools, cannot be used with XImage.
You can use only a single compression type for a .wim file. Appended image files must use the same compression type as the initial capture.
You can mount an image only from Microsoft® Windows XP® with Service Pack 2 (SP2), Microsoft® Windows Server 2003® with Service Pack 1 (SP1), or Microsoft® Windows code-named "Longhorn."
Note Although XImage cannot mount an image from a computer running any other operating system, it can capture and apply images for any version of Microsoft Windows code-named "Longhorn," Microsoft Windows Server 2003, Microsoft Windows XP, and Microsoft Windows 2000.
You can mount a .wim file with read/write permissions only on an NTFS file system. This avoids the 2-gigabyte (GB) barrier imposed by FAT file systems and prevents data loss that is possible with FAT or other non-NTFS file systems.
Note Although XImage can mount a .wim file with read/write permissions only from an NTFS file system, you can mount your image as read-only from NTFS, FAT, ISO, and UDF file systems. You cannot save changes to the image file while it is mounted as read-only.
You must use other Microsoft tools, such as Diskpart and Format, to prepare your disks for volume images.
Dependencies of XImage
XImage has the following dependencies.
Using the Setup Manager, you may create an installation image, which will you will capture later using XImage.
Using the Sysprep tool, you may prepare and clean your data for capture by XImage. Running Sysprep on your master computer removes all user-specific and computer-specific settings and data, resets the product activation clock to 30 days, and enables the creation of a new security identifier (SID) upon restart. Once you have run Sysprep, you can boot your master computer into the Windows Preinstallation Environment (Windows PE) to capture the image.
You must boot your technician computer into the Windows PE environment. From Windows PE, you may run XImage to capture your image. After you create the image, boot your technician computer, install the Windows Imaging File System Filter (WIM FS Filter) driver, edit your image, and apply it from a network location.
Technologies Related to XImage
XImage is related to the following technologies:
Windows Deployment Services (WDS)
If you do not use XImage for deployment, you may use Microsoft Windows Deployment Services (WDS). WDS enables companies to remotely administer and deploy the latest operating system and other .wim files, using Windows PE and WDS Server. This deployment scenario can be fully unattended, and is customizable and scalable.
Note Windows Deployment Services replaces the existing Remote Operating System Installation (RIS) deployment technology.
Systems Management Server (SMS) Operating System Deployment Feature Pack
If you do not use XImage for deployment, you may use the Systems Management Server (SMS) Operating System Deployment Feature Pack. The SMS Operating System Deployment Feature Pack enables companies to deploy the latest operating systems and applications in a customizable, centralized, and scalable way. For more information, refer to http://www.microsoft.com/smserver.
See Also
How XImage Works
XImage Command-Line Options
Configuration File Creation
Walkthrough: Capture an Image
Walkthrough: Compress an Image
Walkthrough: Mount and Modify an Image
Walkthrough: Apply a Deployment Image
How XImage Works
XImage is a command-line tool that uses a set of APIs, known as Windows Imaging API (WIMGAPI), to perform many tasks with the Microsoft Windows Imaging (.wim) files. The primary purpose of XImage is to capture, modify, and apply images for deployment in a manufacturing or corporate IT environment.
You typically use XImage with the Windows Imaging File System Filter (WIM FS Filter) driver. The WIM FS Filter driver enables you to mount an image as if it were a directory and browse, copy, paste, and edit the files from a file management tool, such as Windows Explorer, without extracting or recreating the image.
This topic includes:
XImage Terms and Definitions
XImage Architecture
XImage Terms and Definitions
The following table presents the most common terms and definitions used by XImage.
TermDefinition
XImageA command-line tool utilizing the Windows Imaging file structure to capture, modify, and apply an image to your network or destination computers.
Volume ImageThe captured image file. One or more volume image(s) constitute a Windows Imaging (.wim) file.
Windows Imaging File (.wim)A file-based imaging format, which contains one or more volume images.
Split Windows Imaging Files (.swm)A collection of read-only files, which contain one or more volume images of a Windows system, captured using XImage.
Windows Imaging APIs (WIMGAPI)An API set used by XImage for capturing and applying images to your network or destination computers.
File-based ImagingThe process of capturing information at the file level into a single volume, with metadata describing the files. Also known as single instancing.
Sector-based ImagingThe process of capturing every non-blank sector into a physical file. This is not the process used by XImage.
Single InstancingThe process of storing the file data separately from the path information, with the path information stored as image metadata.
WIM File System Filter (WIM FS Filter) DriverA driver that enables you to mount your image file and work with it through a file management tool, such as Windows Explorer.
XImage Architecture
XImage relies on several components, including the XImage executable (ximage.exe), the WIM File System Filter (wimfltr.inf), the WIM API set (WIMGAPI), and the .wim file format. The following diagram shows the interaction between these components.
ComponentDescription
XImage.exeAn executable that uses an API layer to support interaction with the .wim file. This interaction includes capturing your image, compressing your image, mounting and unmounting your image, applying your image, and so on.
WIM File System FilterOnce you install the WIM FS Filter driver, the WIM File System Filter handles the browsing and editing capabilities for the .wim file. After you mount a .wim file to a directory, the filter monitors all file system requests for files or data and maps the requests to the appropriate data within the .wim file. This enables you to view the contents of your image file from any standard file management tool, such as Windows Explorer.Additionally, the offline servicing of your image enables you to view and edit your .wim files without having to reapply and recapture the image. To mount and edit the contents of your .wim file, a user-mode tool and a kernel-mode file system filter interact with each other using a communication protocol and the WIM API set.
WIM API Set (WIMGAPI)The API layer that interacts with both the XImage executable and the WIM FS Filter driver. It is also the primary interface for third party tools and setup technology. The APIs can be categorized into the following groups:Add/update/remove file dataAdd/update/remove image dataExtract image dataMounting an Image using the WIM File System FilterSpanning of imagesMessaging status and progress
Windows Imaging (.wim) fileA collection of image files that contain an operating system and its components. XImage uses the .wim file format for the capture, offline servicing, and the deployment process, providing a comprehensive imaging solution for your deployment scenarios.
See Also
What is XImage?
XImage Command-Line Options
Configuration File Creation
Walkthrough: Capture an Image
Walkthrough: Compress an Image
Walkthrough: Mount and Modify an Image
Walkthrough: Apply a Deployment Image
XImage Command-Line Options
XImage is a command-line tool in Windows code-named “Longhorn,” that you can use to create and manage Microsoft Windows Imaging (.wim) files. A .wim image file contains one or more volume images, disk volumes that contain images of an installed Windows operating system.
To modify your volume images, you must install the Windows Imaging File System Filter (WIM FS Filter) driver on a computer running Microsoft Windows XP with Service Pack 2 (SP2), Microsoft Windows Server 2003 with Service Pack 1 (SP1), or Windows code-named "Longhorn." Installing the WIM FS Filter driver enables you to mount a .wim file as if it were a directory and to browse, copy, paste, and edit the volume images from a file management tool, such as Windows Explorer, without extracting or recreating the image.
Important You must run each of these command-line options individually. Additionally, if you do not provide a location for your captured .wim file, the process automatically creates it in your XImage directory. For example, if you enter data.wim instead of d:\imaging\data.wim while using the /capture option, the data.wim file appears in your XImage directory.
XImage Command-Line Options
The following command-line options are available for XImage:
ximage [/append directory image_file "description" [/verify]]
ximage [/apply image_file directory index_number [/verify]]
ximage [/boot image_file index_number {/capture directory image_file "description"} | {/append directory image_file "description"} | {/export destination.wim_file source.wim_file index_number}]
ximage [/capture directory image_file "description" [/verify]]
ximage [/compress {maximum | fast | none} /capture directory image_file "description"]
ximage [/config configuration_file.ini {/capture directory image_file "description"} | {/append directory image_file "description"}]
ximage [/delete image_file index_number]
ximage [/dir[image_file] index_number]
ximage [/export destination.wim_file source.wim_file index_number]
ximage [/info image_file]
ximage [/mount [directory] image_file index_number [/verify]]
ximage [/mountrw [directory] image_file index_number [/verify]]
ximage [/ref splitwim2.swm /apply splitwim.swm drive index_number]
ximage [/split image_file destination.wim_size]
ximage [/unmount [/commit][directory]]
Option Description
/append directory image_file "description" [/verify]
Appends a volume image to an existing image (.wim) file. Creates a single instance of the file, comparing it against the resources that already exist in the .wim file, so you do not capture the same file twice.Important You must run this option from the Windows Preinstallation Environment (Windows PE). Additionally, you must ensure that you have enough disk space for the /append option to run. If you run out of disk space during the /append option, you may corrupt the appended .wim file.Important The .wim file can have only one assigned compression type; therefore, you can append only files with the same compression type.directoryThe name and location of the existing .wim file to append.image_fileThe name and location of the volume image that appends the existing file."description" The text that provides additional reference information. The straight quotation marks are required.You may also use the /verify option, which enables file verification, checking for errors and file duplication.Example: ximage /append d: d:\imaging\data.wim "Drive D" /verify
/apply image_file directory index_number [/verify]
Applies a volume image to a specified drive.Important You must run this option from Windows PE.image_fileThe name and location of the volume image applied to the directory.directoryThe name and location where to apply the image.index_numberThe number that references the specific volume within the .wim file.You must create all hard disk partitions before beginning this process, unless you run this option using a script. If you use the /apply option for a directory structure, the option will include the specified directory, including all subdirectories and files.Important You must include the parent directory for the /apply option; otherwise, when the image is applied, the image will overwrite everything in that location. For example, if you apply the image to drive C, the /apply option can overwrite everything that exists in drive C with your image files.To automate the creation of a directory, you must add the mkdir <target_directory> command to your script, before XImage performs the /applyoption.Example: ximage /apply d:\imaging\data.wim d:\New_Directory 1 /verify
ximage /boot image_file index_number {/capture directory image_file "description"} | {/append directory image_file "description"} | {/export destination.wim_file source.wim_file index_number}
Defines the .wim and volume image from which to boot Windows PE. Only one volume image can be marked as bootable within a .wim file.Important You must run this option from Windows PE.image_fileThe name and location of the .wim file, which contains the volume image to make bootable.index_numberThe number that references the specific volume to boot within the .wim file.Example: ximage /boot d:\imaging\data.wim 1 /verify /capture d: d:\imaging\data.wim "Drive D"
/capture directory image_file "description" [/verify]
Captures a volume image from a drive to a new .wim file. Captured directories include all subfolders and data.Important You must run this option from Windows PE.During the capture operation, fast compression is automatically applied. If you require a different compression type, you must use the /compress option.directoryThe name and location of the volume image for capture.image_fileThe name and location of the new .wim file."description" The text that provides additional reference information. The straight quotation marks are required.You may also use the /verify option, which enables file verification, checking for errors and file duplication.Note The /capture option is only capable of creating a single .wim file; however, you may split this image file by using the /split option, as necessary.Example: ximage /capture d: d:\imaging\data.wim "Drive D" /verify
/compress {maximum | fast | none} /capture directory image_file "description"Specifies the type of compression used for the initial capture operation. You can use only one type of compression for each .wim file; therefore, this option is valid only on the initial capture. You must use this option with the /capture option.Important You must run this option from Windows PE.maximumProvides the best compression; however, it also takes the longest time to capture the image.fast Provides faster image compression, but provides less compression than that provided by maximum. This is also the default compression type, used if you leave this parameter blank.none Provides no compression to the captured image.Note While the compression type that you choose affects the capture time, it slightly affects the apply time.Example: ximage /compress fast /capture d: d:\imaging\data.wim "Drive D"
/config configuration_file.ini {/capture directory image_file "description"} | {/append directory image_file "description"}
Enables you to create and use a configuration file, defining the following for the captured or appended .wim file:Folders and files that must be excluded from the /capture operation.Folders, files, and file types that must be excluded from the /compress operation.Whether the .wim file must align on a 64K boundary.Important You must run this option from Windows PE. Additionally, you must use either the /capture or /append option with the /config option.configuration_file.ini The name and location of the configuration file. You can rename this file, as necessary.Important If you name your configuration_list.ini file Wimscript.ini, and store it in your XImage directory (where the XImage.exe file is located); it will automatically run when you run the /capture option, without requiring you to use the /config option.Example: ximage /config c:\configuration.ini /capture d: d:\imaging\data.wim "Drive D"
/delete image_file index_number
Deletes the specified volume image from a .wim file with multiple volume images. This option deletes only the metadata entries and XML entries; it does not delete the stream data and does not optimize the .wim file. Once the file is mounted, you may view, but not modify, all the information contained in the directory. If you do not specify the parameters to mount, this option will list all mounted images.image_fileThe name and location of the .wim file specified for deletion.index_numberThe number that references the specific volume within the .wim file.Important You must run this option from Windows PE. Additionally, there must always be at least one volume image in a .wim file; therefore, you can delete a volume image only if more than one image exists.Example: ximage /delete d:\imaging\data.wim 1
/dir [image_file] index_number
Displays a list of the files and folders within a specified volume image.image_fileThe name and location of the volume image for review. If you do not provide a volume image, this option returns a directory listing for all volume images in the .wim file.index_numberThe number that references the specific volume within the .wim file.Example: ximage /dir d:\imaging\data.wim 1
/exportdestination.wim source.wim index_number
Exports a copy of the specified .wim file (Source.wim) to another .wim file (Destination.wim). The Source.wim and Destination.wim files must use the same compression type.Important You must run this option from Windows PE. Additionally, you must ensure that you have enough disk space for the /export option to run. If you run out of disk space while the /export option runs, you might corrupt the Destination.wim file.destination.wim_fileThe name and location of the .wim file, appended with the source.wim_file data.source.wim_fileThe name and location of the .wim file that appends the destination.wim_file data.index_numberThe number that references the specific volume within the .wim file.Example: ximage /export d:\imaging\data.wim d:\imaging\sample.wim 1
/info image_file
Returns the stored XML descriptions for the specified .wim file, including but not limited to the total file size, the image index number, the directory count, file count, and a description.image_fileThe name and location of the .wim file for XML data review.Example: ximage /info d:\imaging\data.wim
/mount [directory] image_file index_number
Mounts a .wim file from Microsoft Windows XP with Service Pack 2 (SP2), Microsoft Windows Server 2003 with Service Pack 1 (SP1), or Windows code-named "Longhorn," with read-only permission, to a specified directory.Once the file is mounted, you may view, but not modify, all the information contained in the directory.Important You must install the WIM FS filter before you can mount an image.directoryThe complete directory location to mount the files. If you do not specify a directory, this option will list all mounted images.image_fileThe name and location of the .wim file to mount with read-only permission.Note The image_file must be a valid .wim file. You cannot mount .swm files using XImage.index_numberThe number that references the specific volume within the .wim file.Example: ximage /mount c:\mounted_images d:\imaging\data.wim 2
/mountrw [directory] image_file index_number
Mounts a .wim file from Microsoft Windows XP with Service Pack 2 (SP2), Microsoft Windows Server 2003 with Service Pack 1 (SP1), or Windows code-named "Longhorn," with read/write permission, to a specified directory.Once the file is mounted, you may view and modify all the information contained in the directory.Important You must install the WIM FS filter before you can mount an image.The /mountrw option requires exclusive access to the .wim file; therefore, you cannot use the /mountrw option if an image is currently mounted using either the /mount or /mountrw options.Important You must not mount an image to the parent or subdirectories of an already mounted directory. Upon mounting an image to a directory that contains files, the existing files will be masked until you run the /unmount option. Additionally, you must not mount your image to Windows reserved folders.directoryThe complete directory location to mount the .wim file. If you do not specify a directory, this option will list all mounted images.image_fileThe name and location of the .wim file to mount with read/write permission.Note The image_file must be a valid .wim file. You cannot mount .swm files using XImage.index_numberThe number that references the specific volume within the .wim file.Example: ximage /mountrw c:\mounted_images d:\imaging\data.wim 2
/refsplitwim2.swm /apply splitwim.swm drive index_number
Enables the reference of split .wim files (SWMs).Important You must run this option from Windows PE. Additionally, you must run this option with the /apply option.splitwim2.swmThe name and location of the split .wim files. These may be specified with wildcard characters (for example, *) or exact names. Split .wim files always contain a number within the file name, for example, Data2.swm, Data3.swm, and so on.Important You must specify all .swm files. If file resources are not located for the specified image in the supplied set, the option will fail.splitwim.swmThe name and location of the initial split .wim file, typically displayed without a number in the file name, for example, Data.wim.index_numberThe number that references the specific volume within the .wim file.Note You may use multiple /ref options with the /apply option.Example: ximage /ref d:\imaging\data2.swm /apply d:\imaging\data.swm D: 1
/split image_file destination.wim_size
Splits an existing .wim file into multiple read-only split .wim files (.swm).Important You must run this option from Windows PE.image_fileThe name and location of the .wim file to split.destination.wim_sizeDetermines the size in megabytes (MB) for each created file.This option generates the .swm files into the specified directory; naming the files the same as the specified image_file, but with an additional number and the .swm file name extension. For example, if you choose to split a file named Data.wim, this option creates a Data.swm file, a Data2.swm file, a Data3.swm file, and so on, defining each portion of the split .wim file.Example: ximage /split d:\imaging\data.wim 600
/unmount [/commit][directory]
Unmounts the mounted image from a specified directory.Important Confirm that you have enough hard disk space to add the files for your image. You must account for the size of the files that you add to the .wim file, plus any increase in file size due to the modification of existing files, minus any files that you deleted, before performing the /commit option. If you do not have enough hard disk space, an error will occur.directoryThe complete directory location to unmount the files. If you do not specify a directory, this option will list all mounted images.If you use the /unmount option without the /commit option, your changes will be discarded. To save your changes, you must meet both of the following conditions:1.You used the /commit option with the /unmount option.2.You mounted the image using the /mountrw option.Example: ximage /unmount /commit c:\mounted_images
See Also
What is XImage?
How XImage Works
Configuration File Creation
Walkthrough: Capture an Image
Walkthrough: Compress an Image
Walkthrough: Mount and Modify an Image
Walkthrough: Apply a Deployment Image
|
|