2016-08-27

Added instructions for using windows installation media instead of WEIK; Added section on installing Windows; added a link to a comprehensive guide.

← Older revision

Revision as of 07:03, 27 August 2016

Line 16:

Line 16:

* you need to run a Windows environment to run Win32 programs, you do not have a Windows machine available, and you do not want to use [[Wine]] or the programs will not run correctly with [[Wine]].

* you need to run a Windows environment to run Win32 programs, you do not have a Windows machine available, and you do not want to use [[Wine]] or the programs will not run correctly with [[Wine]].



== Creating a bootable Windows PE
ISO
==

+

== Creating a bootable Windows PE
image
==



+



Download the Windows Automated Installation Kit (WAIK) from [http://www.microsoft.com/en-us/download/details.aspx?id=5753 Microsoft's website].

+



{{Warning|The entire download, {{ic|KB3AIK_EN.iso}}, is 1.7GB.}}

+



{{Tip|

+



* It may be possible to use [http://httpfs.sourceforge.net/ httpfs] to avoid downloading the entire file.  Only around 118MB of it is actually needed.

+



* If you have an installation media of Windows 7 or later versions, you can use that iso file / optical disc instead of WAIK. {{ic|mkwinpeimg}} accepts both WAIK image and Windows installation media. Note that different versions of Windows installation media contains different versions of Windows PE. For the relationship between Windows versions and Windows PE versions, refer to [[wikipedia:Windows_Preinstallation_Environment#Versions|Wikipedia]].

+



* WAIK has been renamed to WADK since Windows 8 and is now distributed via {{ic|adksetup.exe}}. In order to get Windows PE 4.0 and later versions, you have to use installation media of Windows 8 and later versions. The installation media iso files are avaiable for MSDN subscribers, but you can download otherwhere and compare the hash value with the those published on MSDN.

+



}}

+

[[Install]] {{Pkg|fuse}}, {{Pkg|cdrkit}}, and {{Pkg|cabextract}} from [[official repositories]].

[[Install]] {{Pkg|fuse}}, {{Pkg|cdrkit}}, and {{Pkg|cabextract}} from [[official repositories]].

Line 30:

Line 22:

Install {{AUR|wimlib}} from the [[AUR]].

Install {{AUR|wimlib}} from the [[AUR]].



Mount
the
WAIK ISO:

+

=== Configure
the
Windows PE image ===



# mkdir /media/waik

+

To boot into a command prompt, create a startup script, which will be included into the bootable image in the next step:



# mount KB3AIK_EN.iso /media/waik

+



Use the
{{
ic
|
mkwinpeimg}} script provided with {{AUR|wimlib}} to create a bootable Windows PE ISO {{ic
|
winpe
.
iso
}}
:

+

{{
hc
|
start.cmd
|
<nowiki>

+

cmd
.
exe

+

pause</nowiki>

+

}}



$ mkwinpeimg --iso --
waik
-dir=/media/waik winpe.iso

+

The {{ic|mkwinpeimg}} script supports making further modifications to Windows PE using {{ic|--overlay}} option.  See the manual page for {{ic|mkwinpeimg}} for more information. You may want to do this to add additional Windows applications that you want to run in Windows PE, or to add any additional drivers that Windows PE needs (drivers can be loaded using the {{ic|drvload}} command within Windows PE).

+

+

=== Make the bootable Windows PE ISO ===

+

+

{{ic|mkwinpeimg}} can create a bootable Windows PE ISO from either Windows installation image / disk for Windows 7 or later or from Windows Automated Installation Kit (WAIK) image. In order to get Windows PE 4.0 and later versions, you have to use installation media of Windows 8 and later versions. Earlier versions of Windows PE can be obtained from [http://www.microsoft.com/en-us/download/details.aspx?id=5753 standalone WAIK distribution from Microsoft].

+

Since Windows 8, WAIK has been renamed to WADK and is distributed via {{ic|adksetup.exe}}.

+

+

The installation media iso files are avaiable for MSDN subscribers, but you can download otherwhere and compare the hash value with the those published on MSDN. Different versions of Windows installation media contains different versions of Windows PE. For the relationship between Windows versions and Windows PE versions, refer to [[wikipedia:Windows_Preinstallation_Environment#Versions|Wikipedia]].

+

+

{{Tip|It may be possible to use [http://httpfs.sourceforge.net/ httpfs] to avoid downloading the entire image file. Windows PE occupies only around 118MB of the image.

+

}}

+

+

Mount the source ISO, either Windows installation image or WAIK/WADK, named winimg.iso:

+

+

# mkdir /media/winimg

+

# mount winimg.iso /media/winimg

+

+

Use the {{ic|mkwinpeimg}} script provided with {{AUR|wimlib}} to create a bootable Windows PE ISO {{ic|winpe.iso}}, with the startup script created in the previous section:

+

+

'''Option A''': source image is Windows installation media

+

+

$ mkwinpeimg --iso --
windows
-dir=/media/
winimg --start-script=start.cmd winpe.iso

+

+

'''Option B''': source image is WAIK/WADK:

+

+

$ mkwinpeimg --iso --
waik
-dir=/media/winimg --start-script=start.cmd
winpe.iso

See the {{ic|man mkwinpeimg}} for more information.

See the {{ic|man mkwinpeimg}} for more information.



Unmount the
WAIK
ISO:

+

Unmount the
source
ISO:

+

+

# umount /media/winimg



# umount /media/waik

== Booting Windows PE ==

== Booting Windows PE ==

Line 88:

Line 108:

LABEL      localboot

LABEL      localboot

MENU LABEL Boot from local disk

MENU LABEL Boot from local disk



LOCALBOOT  0

+

LOCALBOOT  0</nowiki>



</nowiki>

+

}}

}}

Line 100:

Line 119:

{{Note|With the given PXELINUX configuration file, Windows PE will start by default after 5 seconds.}}

{{Note|With the given PXELINUX configuration file, Windows PE will start by default after 5 seconds.}}



=== Network boot performance ===

+

{{Tip|TFTP is not designed to be used to transfer large files, such as {{ic|winpe.iso}}, which may be 118MB or more and take about 30 seconds to load.  Performance may be improved by using the {{ic|gpxelinux.0}} bootloader instead of {{ic|pxelinux.0}} and loading {{ic|winpe.iso}} using HTTP rather than TFTP.}}



TFTP is not designed to be used to transfer large files, such as {{ic|winpe.iso}}, which may be 118MB or more and take about 30 seconds to load.  Performance may be improved by using the {{ic|gpxelinux.0}} bootloader instead of {{ic|pxelinux.0}} and loading {{ic|winpe.iso}} using HTTP rather than TFTP.

+

== Installing Windows from Windows PE ==



== Customizing
Windows PE ==

+

Once booted into
Windows PE
, you can install Windows from an installation media.

+

+

The installation media can be a network share (Samba). See [[Samba]] for seting up a Samba server on another machine on the LAN. To share the installation image mounted at {{ic|/media/winimg}}, add the following share definition to {{ic|/etc/samba/smb.conf}}:

+

+

{{hc|/etc/samba/smb.conf|<nowiki>

+

[REMINST]

+

browsable = true

+

read only = no

+

guest ok
=
yes

+

path
=
/media/winimg</nowiki>

+

}}



The {{ic|mkwinpeimg}} script provided with {{AUR|wimlib}} supports making modifications
to Windows PE
using
the
{{ic|--start-script}} or {{ic|--overlay}} options.  See
the
manual page for {{ic|mkwinpeimg}} for more information.

+

Once booted into Windows PE command prompt, run the following command
to
initialize the network interface, obtain the IP of the Samba server (assuming
Windows PE
was booted over PXE from a machine that runs the DHCP, TFTP, and Samba server, the server IP will usually be the Gateway IP), mount
the
share, and launch
the
GUI setup:



You may want to do this to add additional Windows applications that you want to run in Windows PE, or to add any additional drivers that Windows PE needs (drivers can be loaded using the {{ic|drvload}} command within Windows PE)
.

+

> wpeinit

+

> ipconfig

+

> net use I: \\IP
.
ADDRESS.OF.SAMBA.SERVER\REMINST

+

> I:\setup.exe

==See also==

==See also==

Line 114:

Line 146:

* [http://technet.microsoft.com/en-us/library/cc766093(v=ws.10).aspx Microsoft's documentation for Windows PE]

* [http://technet.microsoft.com/en-us/library/cc766093(v=ws.10).aspx Microsoft's documentation for Windows PE]

* [http://www.thinkwiki.org/wiki/Windows_PE Another article about making Windows PE images on Linux]

* [http://www.thinkwiki.org/wiki/Windows_PE Another article about making Windows PE images on Linux]

+

* [http://www.ultimatedeployment.org/win7pxelinux1.html A guide with scripts for unattended installation of Windows 7 from Linux using Windows PE]

Show more