Download windows 7 from wim image. Creating and configuring a Windows PE image

16.06.2010 20:41

Files installed Windows 7 may be damaged or deleted by mistake or as a result of infection of the computer with viruses, trojans and other dangerous programs. Instead of reinstalling Windows 7 for one or two damaged files, you can extract the necessary files from the Windows 7 installation DVD.

All Windows files 7 compressed and packed into an image file install.wim located in the folder sources installation disk Windows 7. There are two ways to open a WIM file and extract the data you need from it:

Mounting the image using DISM

1. Insert the Windows 7 installation disc into the DVD drive, open it and copy the file install.wim from a folder sources to drive D.

2. Create a folder on drive D and name it, for example, wseven. The install.wim image will be included in this folder. Please note that you CANNOT use the root of drive C as the folder for connecting the install.wim image.

3. Open Start > All Programs > Accessories .

4. Run the command:

dism /Mount-Wim /WimFile:D:\install.wim /name:"Windows 7 Ultimate" /MountDir:D:\wseven

Explanations:

  • dism is a command-line utility built into Windows 7 that allows you to mount and manage WIM images.
  • The /Mount-Wim option mounts the WIM file.
  • The /WimFile option allows you to specify the location and name of the WIM file to mount.
  • The /name option allows you to specify the name of the edition of Windows 7 that will be mounted.
  • The /MountDir: parameter specifies the folder where the WIM image will be mounted.

6. Wait for the image to mount. This may take several minutes.

7. Open the D:\wseven folder, find the desired file in it and copy it to any location on your hard drive (for example, replace the damaged Windows 7 file).

Disable an image in DISM

After copying the necessary files, the image can be disabled.

1. Close all folders and files.

2. Open Start > All Programs > Accessories, click right click mouse over the command line icon and select Run as administrator.

3. Run the command:

dism /Unmount-Wim /MountDir:D:\wseven /discard

Explanations:

  • The /Unmount-Wim option unmounts the image.
  • The /MountDir: parameter specifies the folder where the image to be mounted is mounted.
  • The /discard option discards all changes made to the image.

4. Wait until the image is disabled.

5. Delete the folder wseven and file install.wim from disk D.

Opening a WIM file with 7-zip

1. Download and install free archiver 7zip.

2. Insert the Windows 7 installation disc into the DVD drive, open the folder Sources and find the file in it install.wim.

3. Right click on the file install.wim and in the appeared context menu select To open with.

4. In the window that opens, select 7zip file manager and press OK.

5. The archiver window can display from one to five folders, depending on the edition of Windows 7. The installation images of 32-bit Windows 7 include all editions except Enterprise, so there will be five folders:

  • folder "1" contains all the folders and files of Windows 7 Starter (Initial);
  • in folder "2" - all folders and files Windows 7 Home Basic (Home Basic);
  • in folder "3" - Windows 7 Home Premium (Home Extended);
  • in folder "4" - Windows 7 Professional (Professional);
  • in folder "5" - Windows 7 Ultimate (Maximum).

Windows 7 64-bit installation images do not include Starter Edition, so there will only be four folders:

  • folder "1" contains all folders and files Windows 7 Home Basic (Home Basic);
  • in folder "2" - Home Premium (Home Extended);
  • in the folder "3" - Professional (Professional);
  • in folder "4" - Ultimate (Maximum).

In the installation images of Windows 7 Enterprise (Corporate) there is only one folder - with the "Corporate" itself, other editions are not included in the distribution.

General information

For replication typical configuration on several computers, it is rational to use the image of a once installed operating system.

Detailed instructions are available on the Microsoft website: Creating and applying Windows images

Since with a large set of additional software, the partition image file can easily exceed 4GB, then write such a distribution kit to DVD disc fail. However, this is not required to install the OS. It will be enough for us to get an image of the partition on which the OS is installed. Then it can be included in the distribution on a bootable Flash disk or simply transferred to new computer by booting from any live-CD/DVD/USB. In this article, we will look at both options.

Having prepared the partition once, we will be able to deploy a working OS on new computers with all installed software, connected peripherals and necessary shortcuts in less than half an hour.

According to Microsoft: "When creating an image, keep in mind that the partition layout on the source and target computers must be identical. For example, if Windows image saved on the D drive, you must also deploy this image to the D drive of the destination computer, the following parameters sections():

  1. Partition types (primary, secondary, or logical) must match
  2. If a partition is made active on the reference computer, it must also be active on the destination computer"

However, if we add a prepared partition to the distribution, then these restrictions do not matter.

Step-by-step instructions for deploying Windows 7 from an image

1. Making a template installation of Windows in audit mode

5. Write the created partition image to the local hard drive

E:\tools\imagex.exe /apply E:\images\win7image.wim 1 C: WITH:- section where we will deploy the image 1 - number (or name) of the image, default = 1

If the OS images are on network resource, then connect it first with the command:

Net use E:\\server\share /user:domain_name\username password

6. Completion

If you create a separate system partition, then you need to transfer boot files to it system files(assuming OS is on drive C:):

bcdboot C:\Windows

Exit Windows PE:

or close the window Windows Installer 7. The computer will go into reboot. We take out the CD / DVD disk and boot from the newly installed OS.

7. Complications

  • If you have problems loading the transferred OS, you can try to restore the bootloader. To do this, you need to download Windows distribution 7 (you can open the console by pressing Shift+F10) or Windows PE and run the command:
bcdboot C:\Windows /l ru-RU /s C: Read more in the article "Restoring the Windows and Linux bootloader".

Repository of various Windows images

You can create several images of partitions with different sets of software using the same template OS, then place them in one place, for example, on a flash drive, and install each time exactly the image that will be suitable in each individual case. The process of adding software can be carried out sequentially, making a new image of the partition after installing each required set. The algorithm is as follows (see details above):

  1. Loading the OS in audit mode
  2. Install/remove software, connect printers, create shortcuts, etc.
  3. Preparing the system for deployment sysprep and turn off the computer
  4. Downloading from live CD or Windows7 distribution, go to console
  5. Create a partition image with imagex by placing it on a flash drive or network share
  6. Repeat the above until all required sets have been created.

Building Your Own Windows Distribution

Having an image Windows partition(wim file), you can create your own distribution, that is, an installation DVD / Flash disk. To do this, it is enough to replace the \sources\install.wim file with your own image in the original distribution, renaming it accordingly to install.wim.

To automate the installation, you can prepare an autounattend.xml answer file by creating it with WIAK

Not so long ago, I ran into a situation that, in principle, does not cause any special problems for system administrators. There was a need to update the OS on numerous computers of the organization, which in turn still caused a number of some problems, the solutions of which had to be collected in parts, as well as finish most of the whole process myself, which I actually want to tell you about.

These problems were the limitations in the availability of one DVD-ROM drive, one day of free time, as well as about twenty computers on which it was necessary to install Windows 7 with the entire set of necessary drivers, programs, etc.
When searching for information on Google this issue there was nothing that would work without jambs or work at all. But let's start in order.

Preparing an operating system image

For ease of preparation of the combat OS, Oracle VirtualBox was taken as the basis latest version, as well as Windows 7 x64 Professional. The first thing to do is install and configure Windows 7 on a virtual machine. To do this, in the process of adding a VM, we create two virtual hard drives. One for installing and configuring Windows 7 on it, the second for subsequently saving the image of the configured system on it. It is also necessary to install the Virtualbox guest OS add-on - Virtual Machine Additions and create a shared folder for further copying the created image to a physical machine.
After installing all the stuffing on the VM, we proceed to the stage of system preparation using the utility sysprep, located in the system root of our VM: %windir%\system32\sysprep\sysprep.exe
To prepare the system for creating a customized image, you need to set the utility parameters:
  1. Go to the system welcome window (OOBE) - this mode will be activated the next time the system starts. Starts the computer in welcome screen mode.
  2. Check the box "Preparing for use" - prepares the installation of Windows before creating the image. The security identifier (SID) is reset, system restore points are reset, and event logs are deleted.
  3. Shutdown options "Shutdown" - when the utility is finished, the system will shut down.
You should not start the OS before saving the system image, because the next time you start the computer, a specialized configuration step begins to work. A new security identifier (SID) is generated and the Windows activation clock is reset.

The utility also removes installed drivers. To save them, you need to sysprep from the command line with the parameter: /unattend: specify the path to the answer file In the answer file, you must specify the PersistAllDeviceInstalls parameter (starting with Windows 8 there is also the DoNotCleanUpNonPresentDevices parameter):
true After cleaning is completed, the system will automatically turn off. Let's move on to the next step.

Installing and configuring Windows AIK + PE

Download and install the package automatic installation Windows (AIK) for Windows 7. After launching setup.exe, select the item "Install Windows AIK". There should not be any particular problems during installation.
Creating and configuring a Windows PE image
Windows PE- the pre-installation environment used to prepare for the installation of the OC. WITH Windows PE we will capture the system volume into a wim image using the utility imagex and them save it to another partition hard drive.
In this case, we are considering creating a disk with a 64-bit Windows version PE. If you are creating a disk with a 32-bit version of Windows PE, you will need to change the architecture (amd64 to x86) in all commands.

From the Start menu, run All Programs > Microsoft Windows AIK > Deployment Tools Command Prompt- all subsequent commands will be entered into this command line window. Requires running as administrator.
Copying the Windows PE Image Files
copype.cmd amd64 d:\winpe_image
To change the copied Windows PE image, you must connect it with the command
dism /Mount-Wim /WimFile:d:\winpe_image\winpe.wim /index:1 /MountDir:d:\winpe_image\mount
Now that we have included the image, we can install packages into it and add our own files.
Let's add a utility to our image imagex.
xcopy "%ProgramFiles%\Windows AIK\Tools\amd64\imagex.exe" d:\winpe_image\iso\
Also, if desired, you can immediately prepare a list of exclusions - files and folders that will not be included in the saved image. Create in any text editor file Wimscript.ini and specify in it the files and folders that you want to exclude from the image. The Wimscript.ini file is located in the same folder as imegex.
Default imagex uses the following exceptions:
\$ntfs.log \hiberfil.sys \pagefile.sys "\System Volume Information" \RECYCLER \Windows\CSC *.mp3 *.zip *.cab \WINDOWS\inf\*.pnf
Now you need to save the image with the command:
dism /unmount-Wim /MountDir:d:\winpe_image\mount /Commit
All preparatory work was carried out with the winpe.wim file, and for boot disk Windows PE uses the boot.wim file located in the winpe_x86\ISO\sources folder. Therefore, you need to replace the boot.wim file with the winpe.wim file and rename it.
xcopy /y d:\winpe_image\winpe.wim d:\winpe_image\ISO\sources\boot.wim
To create an image, run the command:
oscdimg -n -bd:\winpe_image\etfsboot.com d:\winpe_image\ISO d:\winpe_image\winpe_image.iso

Create an image of Windows 7
It is necessary to save the image of our OS using the utility imagex. We boot into the VM from the winpe_image.iso image that we created earlier. After a successful download, a command line window opens in front of us, in which we will just work.
Capturing and saving an image is done with one command
F:\imagex.exe /capture E: D:\install.wim "Windows 7 x64" /compress maximum
/captureE:- section E capture:
D:\install.wim- the location and name of the saved WIM file.
Windows 7 x64- image name. The name must be enclosed in quotation marks.
/compress maximum- type of file compression in the image (optional). For parameter /compress valid values maximum(maximum compression), fast(fast compression) and none(without compression). If the parameter is not specified, fast compression is used. Maximum compression allows you to reduce the size of the image, but capture takes longer than fast compression. The speed of decompressing an image is practically independent of the type of compression. It remains to wait 20-30 minutes and the image will be ready.

After saving the image on the second disk virtual machine, For further work it needs to be ported to a physical OS. We start the virtual machine again and complete the Windows installation that was interrupted at the OOBE stage. If you have already installed Virtual Machine Additions, now you need to copy the file from the virtual machine to the physical one using the shared folder, which can be specified in the virtual machine settings.

Customizing the Windows 7 Boot Image
On this stage run the Deployment Tools Command Prompt again and copy the Windows PE image files:
copype.cmd amd64 d:\winpe
Mounting the image
imagex /mountrw winpe.wim 1 mount Windows PE is mounted and in the d:\winpe folder you can find the winpe.wim file.
Autorun settings Windows installation.
In order not to manually create a virtual disk and start the installation manually, you can edit the startnet.cmd and startnet2.cmd files. They are located d:\winpe\mount\windows\system32.

Startnet.cmd
wpeinit %windir%\system32\startnet2.cmd
startnet2.cmd
chcp 1251 netsh interface ip set address name="Connect via local network"source=dhcp chcp 866 pause net use z:\\192.168.0.1\win7 /user:install install cd /d Z:\sources setup.exe
The net use command connects to a computer with an IP address of 192.168.0.1 (our server computer) to a shared directory named win7 as the install user with the same password.
You can create the user we need with this command in cmd
net user install install /add /passwordchg:no
We execute the following instructions:

  • On the server computer, we create a root directory for booting (I have it d: \ win7 \), and in it the boot folder.
  • We share the win7 folder, that is, we give general access to all users.
  • Copy the entire sources folder from the installation Windows disk 7 in d:\win7.
  • We replace the install.wim file in the d:\win7\sources directory with the file that we copied earlier from the virtual machine (ready-made Windows 7 image)
Now you need to copy additional files to install Windows 7.
Mount the WinPE image:
imagex /mountrw winpe.wim 1 mount
Copy:
xcopy d:\winpe\mount\windows\boot\pxe\pxeboot.n12 d:\win7 xcopy d:\winpe\mount\windows\boot\pxe\bootmgr.exe d:\win7 xcopy d:\winpe\winpe. wim d:\win7\boot xcopy d:\winpe\iso\boot\boot.sdi d:\win7\boot
Unmount the image with the command:
imagex.exe /unmount d:\winpe\mount

Next, you need to create a BCD (boot configuration data) file in the d:\win7\boot directory. To simplify this process, we will use the createbcd.cmd file. Create a file d:\winpe\createbcd.cmd and enter into it:
bcdedit -createstore %1\BCD bcdedit -store %1\BCD -create (ramdiskoptions) /d "Ramdisk options" bcdedit -store %1\BCD -set (ramdiskoptions) ramdisksdidevice boot bcdedit -store %1\BCD -set (ramdiskoptions) ) ramdisksdipath \boot\boot.sdi for /F "tokens=2 delims=()" %%i in ("bcdedit -store %1\BCD -create /d "MyWinPE Boot Image" /application osloader") do set guid =(%%i) bcdedit -store %1\BCD -set %guid% systemroot \Windows bcdedit -store %1\BCD -set %guid% detecthal Yes bcdedit -store %1\BCD -set %guid% winpe Yes bcdedit -store %1\BCD -set %guid% device ramdisk=\Boot\winpe.wim,(ramdiskoptions) bcdedit -store %1\BCD -set %guid% device ramdisk=\Boot\winpe.wim,(ramdiskoptions) bcdedit -store %1\BCD -create (bootmgr) /d "Windows BootManager" bcdedit -store %1\BCD -set (bootmgr) timeout 30 bcdedit -store %1\BCD -set (bootmgr) displayorder %guid%
Run the command with administrator rights:
createbcd.cmd d:\win7\boot
If you have problems with the drivers, then they can also be added to the " command line deployment tools":
Mounting an Image to Add Drivers
dism /mount-wim /wimfile:winpe.wim /index:1 /mountdir:mount
To integrate drivers into an already mounted image, use the command
dism /image:mount /add-driver /driver:<каталог с драйверами либо файл с расширением inf>
After all work with the image is completed, it must be unmounted
dism /unmount-wim /mountdir:mount /commit

Setting up a TFTP and DHCP server

To create these servers, you need to download the TFTPD32 program.
task DHCP servers is to provide information remote computer about the free IP address, netmask, as well as the name of the downloaded file and the address of the TFTP server where this file is located. The task of the TFTP server is to ensure the transfer of files necessary for downloading to a remote computer.

We launch the program and first select the folder d:\win7, and a little lower - IP network card. In my case, the computer has an IP of 192.168.0.1.
We go into the settings (the Settings button in the middle at the bottom) and gradually fill in the tabs:

  • GLOBAL tab - tick only opposite TFTP Server, DHCP Server and Enable IPv6.
  • TFTP tab - select the folder d:\win7.
  • TFTP Security Standard.
  • TFTP configuration - leave as is.
  • Advanced TFTP Options - there should be ticks next to: Option negotiation, Show Process bar and Translate Unix file names.
  • DHCP Tab
  • IP pool starting address specifies from which IP address to start issuing addresses. In my example, the issuance of IP addresses will start from 192.168.0.2.
  • Size of pool specifies the number of IP addresses that will be dynamically allocated. I set the value to 30.
  • Boot File tells the remote computer the name of the file to use as the bootloader. Set the value in pxeboot.n12.
  • Mask, specifies the network mask. In our case, this is 255.255.255.0. The rest of the parameter values ​​are left as default.
  • Ping address before assignment - uncheck (if you have a computer-to-computer connection without switches and routers).
Now you need to include BIOS boot from the network card and boot from it. After that, an IP address will be obtained via DHCP and pxeboot.n12 will be executed - which will start Windows PE from the winpe.wim file. Right after Windows boot PE will automatically mount the win7 directory and start the installation from there. Further installation proceeds exactly as well as from a disk.

Tags:

Add tags

Hi all! Today I decided to touch on the topic of restoring the installed operating system. It will be, of course, about Windows.

I think many users have encountered a problem when Windows suddenly stops starting.

The reasons for such a nuisance can be very different - penetration into the system, corrupted hard disk blocks, hardware problems, jambs of one of the users ...

In many cases, an image of an existing operating system can help. I will tell you how to create a system image.

Standard Windows tools

When using the method provided by the operating system itself, you will not need any additional program. The only thing you need is administrator rights, an external hard drive is also desirable.

Let's consider all the details using the example of the "seven", so far the most popular system from the Windows family.

So. First you need to prepare the computer for the upcoming operation. To reduce the size of the image you will use for recovery, remove all unnecessary programs and files from the system partition (usually drive C).

But be careful, delete only what you know for sure that it is superfluous, do not touch the files of Windows itself!

And by the way, be sure to think about which programs should be installed so that they are already in the image and reduce the number of additional actions in the future (after recovery procedures). Then it is better to restart the computer.

On the left in the window, click "Create a system image." You will have to wait for some time - the system will evaluate the system partition and scan local drives. The next window will prompt you to select a device to save the archive.

Choosing the Right Media

There are other options, but I do not advise you to save to a disk that is a system one, moreover, Windows in some cases may not provide such an opportunity at all.

The volume of a DVD disc is not enough for such needs, and splitting a complete image into a dozen pieces, each of which is recorded on a separate DVD disc, is clearly not the best solution.

In general, choose what is more suitable for your case, connect all the necessary devices and click "Next".

In the next window, check if everything is really assigned correctly - disks for archiving and location backup(the window is called so: “Confirmation of archiving parameters”) - and click the “Archive” button.

Until the process is completed, you must leave the computer alone - do not turn off, do not run any programs, do not interrupt the archiving process.

In addition to the saved image, you can make a bootable disk by selecting "Create a system recovery disk". You may need it if you do not have an installation disk that contains the Windows distribution kit and all the necessary utilities. Go to the same place - to the "Control Panel", then to "Backup and Restore".

How it works

Now let's look at how to apply the archive image file. In case of serious failures of the operating system, a boot disk is used - the one from which Windows was installed, or created, as I described above.

You just need to insert it into the DVD drive and start your computer from it. A menu will appear on the screen - select "Restore from a previously created image."

Then you will need to specify the location of the image file - the external hard drive with the file must already be connected. Specify the file and the restore operation will begin. The result will be a working, serviceable Windows in the form in which it was at the time the image was created.

Sincerely! Abdullin Ruslan

Not so long ago, I encountered a situation that, in principle, does not cause any special problems for system administrators. There was a need to update the OS on numerous computers of the organization, which in turn still caused a number of some problems, the solutions of which had to be collected in parts, as well as finish most of the whole process myself, which I actually want to tell you about.

These problems were the limitations in the availability of one DVD-ROM drive, one day of free time, as well as about twenty computers on which it was necessary to install Windows 7 with the entire set of necessary drivers, programs, etc.
When searching for information on Google on this issue, there was nothing that would work without jambs or work at all. But let's start in order.

Preparing an operating system image

For ease of preparation of the combat OS, the latest version of Oracle VirtualBox was taken as the basis, as well as Windows 7 x64 Professional. The first thing to do is install and configure Windows 7 on a virtual machine. To do this, in the process of adding a VM, we create two virtual hard disks. One for installing and configuring Windows 7 on it, the second for subsequently saving the image of the configured system on it. It is also necessary to install the Virtualbox guest OS add-on - Virtual Machine Additions and create a shared folder for further copying the created image to a physical machine.
After installing all the stuffing on the VM, we proceed to the stage of system preparation using the utility sysprep, located in the system root of our VM: %windir%\system32\sysprep\sysprep.exe
To prepare the system for creating a customized image, you need to set the utility parameters:
  1. Go to the system welcome window (OOBE) - this mode will be activated the next time the system starts. Starts the computer in welcome screen mode.
  2. Check the box "Preparing for use" - prepares the installation of Windows before creating the image. The security identifier (SID) is reset, system restore points are reset, and event logs are deleted.
  3. Shutdown options "Shutdown" - when the utility is finished, the system will shut down.
You should not start the OS before saving the system image, because the next time you start the computer, a specialized configuration step begins to work. A new security identifier (SID) is generated and the Windows activation clock is reset.

The utility also removes installed drivers. To save them, you need to sysprep from the command line with the parameter: /unattend: specify the path to the answer file In the answer file, you must specify the PersistAllDeviceInstalls parameter (starting with Windows 8 there is also the DoNotCleanUpNonPresentDevices parameter):
true After cleaning is completed, the system will automatically turn off. Let's move on to the next step.

Installing and configuring Windows AIK + PE

Download and install the Windows Automated Installation Kit (AIK) for Windows 7. After launching setup.exe, select the item "Install Windows AIK". There should not be any particular problems during installation.
Creating and configuring a Windows PE image
Windows PE- the pre-installation environment used to prepare for the installation of the OC. Using Windows PE, we will capture the system volume into a wim image using the utility imagex and have them save it to another hard drive partition.
In this case, we consider creating a disk with a 64-bit version of Windows PE. If you are creating a disk with a 32-bit version of Windows PE, you will need to change the architecture (amd64 to x86) in all commands.

From the Start menu, run All Programs > Microsoft Windows AIK > Deployment Tools Command Prompt- all subsequent commands will be entered into this command line window. Requires running as administrator.
Copying the Windows PE Image Files
copype.cmd amd64 d:\winpe_image
To change the copied Windows PE image, you must connect it with the command
dism /Mount-Wim /WimFile:d:\winpe_image\winpe.wim /index:1 /MountDir:d:\winpe_image\mount
Now that we have included the image, we can install packages into it and add our own files.
Let's add a utility to our image imagex.
xcopy "%ProgramFiles%\Windows AIK\Tools\amd64\imagex.exe" d:\winpe_image\iso\
Also, if desired, you can immediately prepare a list of exclusions - files and folders that will not be included in the saved image. Create a Wimscript.ini file in any text editor and specify in it the files and folders that you want to exclude from the image. The Wimscript.ini file is located in the same folder as imegex.
Default imagex uses the following exceptions:
\$ntfs.log \hiberfil.sys \pagefile.sys "\System Volume Information" \RECYCLER \Windows\CSC *.mp3 *.zip *.cab \WINDOWS\inf\*.pnf
Now you need to save the image with the command:
dism /unmount-Wim /MountDir:d:\winpe_image\mount /Commit
All preparatory work was carried out with the winpe.wim file, and for the Windows PE boot disk, the boot.wim file located in the winpe_x86\ISO\sources folder is used. Therefore, you need to replace the boot.wim file with the winpe.wim file and rename it.
xcopy /y d:\winpe_image\winpe.wim d:\winpe_image\ISO\sources\boot.wim
To create an image, run the command:
oscdimg -n -bd:\winpe_image\etfsboot.com d:\winpe_image\ISO d:\winpe_image\winpe_image.iso

Create an image of Windows 7
It is necessary to save the image of our OS using the utility imagex. We boot into the VM from the winpe_image.iso image that we created earlier. After a successful download, a command line window opens in front of us, in which we will just work.
Capturing and saving an image is done with one command
F:\imagex.exe /capture E: D:\install.wim "Windows 7 x64" /compress maximum
/captureE:- section E capture:
D:\install.wim- the location and name of the saved WIM file.
Windows 7 x64- image name. The name must be enclosed in quotation marks.
/compress maximum- type of file compression in the image (optional). For parameter /compress valid values maximum(maximum compression), fast(fast compression) and none(without compression). If the parameter is not specified, fast compression is used. Maximum compression allows you to reduce the size of the image, but capture takes longer than fast compression. The speed of decompressing an image is practically independent of the type of compression. It remains to wait 20-30 minutes and the image will be ready.

After saving the image on the second disk of the virtual machine, for further work it needs to be transferred to a physical OS. We start the virtual machine again and complete the Windows installation that was interrupted at the OOBE stage. If you have already installed Virtual Machine Additions, now you need to copy the file from the virtual machine to the physical one using the shared folder, which can be specified in the virtual machine settings.

Customizing the Windows 7 Boot Image
At this stage, we launch the Deployment Tools Command Prompt again and copy the Windows PE image files:
copype.cmd amd64 d:\winpe
Mounting the image
imagex /mountrw winpe.wim 1 mount Windows PE is mounted and in the d:\winpe folder you can find the winpe.wim file.
Configuring Windows Setup Autorun.
In order not to manually create a virtual disk and start the installation manually, you can edit the startnet.cmd and startnet2.cmd files. They are located d:\winpe\mount\windows\system32.

Startnet.cmd
wpeinit %windir%\system32\startnet2.cmd
startnet2.cmd
chcp 1251 netsh interface ip set address name="Local Area Connection" source=dhcp chcp 866 pause net use z: \\192.168.0.1\win7 /user:install install cd /d Z:\sources setup.exe
The net use command connects to a computer with an IP address of 192.168.0.1 (our server computer) to a shared directory named win7 as the install user with the same password.
You can create the user we need with this command in cmd
net user install install /add /passwordchg:no
We execute the following instructions:

  • On the server computer, we create a root directory for booting (I have it d: \ win7 \), and in it the boot folder.
  • We share the win7 folder, that is, we give public access to it to all users.
  • Copy the entire sources folder from the Windows 7 installation disk to d:\win7.
  • We replace the install.wim file in the d:\win7\sources directory with the file that we copied earlier from the virtual machine (ready-made Windows 7 image)
Now you need to copy additional files to install Windows 7.
Mount the WinPE image:
imagex /mountrw winpe.wim 1 mount
Copy:
xcopy d:\winpe\mount\windows\boot\pxe\pxeboot.n12 d:\win7 xcopy d:\winpe\mount\windows\boot\pxe\bootmgr.exe d:\win7 xcopy d:\winpe\winpe. wim d:\win7\boot xcopy d:\winpe\iso\boot\boot.sdi d:\win7\boot
Unmount the image with the command:
imagex.exe /unmount d:\winpe\mount

Next, you need to create a BCD (boot configuration data) file in the d:\win7\boot directory. To simplify this process, we will use the createbcd.cmd file. Create a file d:\winpe\createbcd.cmd and enter into it:
bcdedit -createstore %1\BCD bcdedit -store %1\BCD -create (ramdiskoptions) /d "Ramdisk options" bcdedit -store %1\BCD -set (ramdiskoptions) ramdisksdidevice boot bcdedit -store %1\BCD -set (ramdiskoptions) ) ramdisksdipath \boot\boot.sdi for /F "tokens=2 delims=()" %%i in ("bcdedit -store %1\BCD -create /d "MyWinPE Boot Image" /application osloader") do set guid =(%%i) bcdedit -store %1\BCD -set %guid% systemroot \Windows bcdedit -store %1\BCD -set %guid% detecthal Yes bcdedit -store %1\BCD -set %guid% winpe Yes bcdedit -store %1\BCD -set %guid% device ramdisk=\Boot\winpe.wim,(ramdiskoptions) bcdedit -store %1\BCD -set %guid% device ramdisk=\Boot\winpe.wim,(ramdiskoptions) bcdedit -store %1\BCD -create (bootmgr) /d "Windows BootManager" bcdedit -store %1\BCD -set (bootmgr) timeout 30 bcdedit -store %1\BCD -set (bootmgr) displayorder %guid%
Run the command with administrator rights:
createbcd.cmd d:\win7\boot
If you have problems with drivers, you can also add them in the "Deployment Tools Command Line":
Mounting an Image to Add Drivers
dism /mount-wim /wimfile:winpe.wim /index:1 /mountdir:mount
To integrate drivers into an already mounted image, use the command
dism /image:mount /add-driver /driver:<каталог с драйверами либо файл с расширением inf>
After all work with the image is completed, it must be unmounted
dism /unmount-wim /mountdir:mount /commit

Setting up a TFTP and DHCP server

To create these servers, you need to download the TFTPD32 program.
The task of the DHCP server is to provide information to the remote computer about the free IP address, network mask, as well as the name of the downloaded file and the address of the TFTP server where this file is located. The task of the TFTP server is to ensure the transfer of files necessary for downloading to a remote computer.

We launch the program and first select the d: \ win7 folder, and a little lower - the IP of the network card. In my case, the computer has an IP of 192.168.0.1.
We go into the settings (the Settings button in the middle at the bottom) and gradually fill in the tabs:

  • GLOBAL tab - tick only opposite TFTP Server, DHCP Server and Enable IPv6.
  • TFTP tab - select the folder d:\win7.
  • TFTP Security Standard.
  • TFTP configuration - leave as is.
  • Advanced TFTP Options - there should be ticks next to: Option negotiation, Show Process bar and Translate Unix file names.
  • DHCP Tab
  • IP pool starting address specifies from which IP address to start issuing addresses. In my example, the issuance of IP addresses will start from 192.168.0.2.
  • Size of pool specifies the number of IP addresses that will be dynamically allocated. I set the value to 30.
  • Boot File tells the remote computer the name of the file to use as the bootloader. Set the value in pxeboot.n12.
  • Mask, specifies the network mask. In our case, this is 255.255.255.0. The rest of the parameter values ​​are left as default.
  • Ping address before assignment - uncheck (if you have a computer-to-computer connection without switches and routers).
Now you need to enable the boot from the network card in the BIOS and boot from it. After that, an IP address will be obtained via DHCP and pxeboot.n12 will be executed - which will start Windows PE from the winpe.wim file. Immediately after loading Windows PE, the win7 directory will be automatically mounted and the installation will start from it. Further installation proceeds exactly as well as from a disk.

Tags:

  • windows system administration
  • windows aik
  • windows pe
  • imagex
  • dism
  • windows7
Add tags

Loading...
Top