Learn how to install Windows 10 over PXE Linux server with this comprehensive guide. Follow step-by-step instructions to set up and deploy Windows 10 seamlessly over your network. #centlinux #linux #pxe
Table of Contents
Problem Statement
In our previous posts, we have configured a PXE boot server for automated installation of RHEL 7.5 operating system that supports both BIOS and UEFI based clients. Later on, we added RHEL 6 and Ubuntu 18.10 installation options in our PXE boot server. We have also written Kickstart files for automated installations of both operating systems.
Before concluding our PXE configuration series, we decided to write an article to add the installation option of a Microsoft’s operating system. Therefore, we have selected the Microsoft Windows 10 (the latest OS at the time of this writeup) as the candidate for our PXE boot server.
Note: In this article, we are performing everything from CLI, therefore, it is highly recommended that, you should have Linux Pocket Guide: Essential Commands (PAID LINK) by O’Reilly Media for quick reference.
Linux Server Specification
In this article, we will install Windows 10 over PXE Server.
We use the same Linux server that we have configured as PXE Boot Server in our previous article. These specifications have been re-mentioned below for convenience of the readers.
- CPU – 2 Core (2.4 Mhz)
- Memory – 2 GB
- Storage – 50 GB
- Operating System – RHEL 7.5
- Hostname – pxe-server.itlab.com
- IP Address – 192.168.116.41/24
Furthermore, we need a client system to create Windows PE iso file. Here, we are using a MS Windows 8.1 machine for this purpose, however, you can use other versions of MS Windows as well (be noted that configurations are slightly different in MS Windows versions prior to 8.1).
Read Also: How to install Linux over PXE Server
Install Samba Server on Linux
We used Samba server to share installation media of MS Windows 10 Operating System with PXE clients.
Connect to pxe-server.itlab.com using ssh and install Samba server.
# yum install -y samba
Create a directory to share Windows 10 installation media.
# mkdir /smbshare
Adjust SELinux permissions.
# semanage fcontext -a '/smbshare(/.*)?' -t samba_share_t # restorecon -Rv /smbshare
Create an user to control access to Samba share.
# useradd -s /sbin/nologin ahmer # smbpasswd -a ahmer
Change owner of the shared directory with user ahmer.
# chown ahmer:ahmer /smbshare/
Allow Samba service in Linux Firewall.
# firewall-cmd --permanent --add-service=samba success # firewall-cmd --reload success
Add directives in /etc/samba/smb.conf to share the directory /smbshare with clients.
# cat >> /etc/samba/smb.conf << EOF > [install] > comment = Installation Media > path = /smbshare > public = yes > writable = no > printable = no > browseable = yes > EOF
Start and enable Samba services.
# systemctl start smb nmb # systemctl enable smb nmb
Attach MS Windows 10 ISO/DVD and mount it at /mnt/iso (you can use any mountpoint, according to your choice).
# mount -t iso9660 /dev/cdrom /mnt/iso mount: /dev/sr0 is write-protected, mounting read-only
Copy contents of /mnt/iso to /smbshare/windows10 directory.
# cp -rf /mnt/iso /smbshare/windows10
Create a Customized Windows PE ISO
Connect to MS Windows 8.1 client.
We required Windows ADK (Assessment and Deployment Kit) to create our Windows PE iso. Therefore, we have downloaded it from Microsoft’s website and installed it on our Windows 8.1 client.
After installation, run Deployment and Imaging Tools Environment as Administrator.
Run the following command to create working directories for Win PE. (Command output has been trimmed to show only success status)
C:Program Files (x86)Windows Kits8.0Assessment and Deployment KitWindows Pr einstallation Environment> copype x86 c:WinPE_x86 --- 186 File(s) copied 1 file(s) copied. 1 file(s) copied. 1 file(s) copied. Success c:WinPE_x86>
We will customize the startup script startcmd.net, so MS Windows 10 setup will start automatically. Therefore, mount the image file and customize it accordingly.
c:WinPE_x86> Dism /Mount-Image /ImageFile:"c:WinPE_x86mediasourcesboot.wim" /index:1 /MountDir:"c:WinPE_x86mount" Deployment Image Servicing and Management tool Version: 6.2.9200.16384 Mounting image [==========================100.0%==========================] The operation completed successfully.
Now, edit startnet.cmd.
c:WinPE_x86> notepad c:WinPE_x86mountWindowsSystem32Startnet.cmd
And add following lines therein.
wpeinit net use z: \192.168.116.41installwindows10 /user:ahmer 123 z:setup.exe
Save and unmount the image file.
c:WinPE_x86> Dism /Unmount-Image /MountDir:"c:WinPE_x86mount" /commit Deployment Image Servicing and Management tool Version: 6.2.9200.16384 Saving image [==========================100.0%==========================] Unmounting image [==========================100.0%==========================] The operation completed successfully. c:WinPE_x86>
Generate winpe.iso file.
c:WinPE_x86> MakeWinPEMedia /ISO c:WinPE_x86 c:winpe.iso Creating c:winpe.iso... 100% complete Success c:WinPE_x86>
Transfer winpe.iso file to pxe-server-itlab.com and copy it to /var/lib/tftpboot/networkboot/windows10/ directory.
Add MS Windows 10 installation option to PXE boot menu
Now, connect to pxe-server.itlab.com again using ssh.
Copy Kernel boot image for MS Windows in tftpboot directory.
# cp /usr/lib/syslinux/memdisk /var/lib/tftpboot/
Edit PXE boot menu for BIOS based clients.
# vi /var/lib/tftpboot/pxelinux.cfg/default
And add following menu option at the end of file.
label Install MS Windows 10 menu label Install MS Windows 10 kernel memdisk initrd /networkboot/windows10/winpe.iso append iso raw
Connect a new client to your network and turn it on. It should get the IP address from DHCP server and display our PXE boot Menu as follows:
Select Install MS Windows 10 option and press <ENTER>.
We have successfully added the MS Windows 10 installation option in our Linux based PXE server.
Recommended Online Training: Learn Bash Shell in Linux for Beginners
Final Thoughts
If you found this guide on installing Windows 10 over a PXE Linux server helpful and need further assistance, I’m here to help. I offer professional services to ensure your PXE server setup and Windows deployment are smooth and efficient. Visit my Fiverr profile for more details and to get started: Linux System Administrator. Let’s make your installation process seamless!
Great manual thank you very much !!
You're welcome.
Hi Ahmer,
Thanks for the document. How can I add for UEFI based clients?
Hi, Thank you for liking this article.
Lately, I worked on adding UEFI support to Windows 10 PXE installation, but didn't succeed. Please let me know if you have workaround this issue.
Hello, well detailed tutorial. By the way, i'm unable to make it working… 🙁
My Winpe ISO file is fine, i tested it and booted on it but when using it with PXE server, nothing happens, WINPE does not launch… RHEL 7 installation is working… Any suggestion please?
Hi Alex, I am afraid, I cannot help you with this little information. But, I am advicing you to look into /var/log/messages at CentOS server. Contact me, if you find anything notable there.
Please add steps to setup auto-answer of the Windows10 installation.
Ok will work on it.
Hello Ahmer
thanks a lot for your great job,
i've successfully launched WINPE, but cant mount Windows image from samba share
however i cannot ping to server from winpe.
it seems that nic driver is missed on winpe image
Thanks for your kind remarks.
– If you are unable to mount Windows 10 DVD. then you can also copy the contents of DVD to disk and use it by using the same steps above.
– If your client is obtaining an IP from DHCP then this is not an NIC issue. Otherwise, troubleshoot it.
Hi Ahmer
I have the same issue,ping my server failed after wpeinit. However if I don't edit startnet.cmd when i create winpe.iso, I can manual mount use command "net use z: \192.168.116.41installwindows10 /user:ahmer 123", I also found the size of winpe.iso are different between edit startnet.cmd and not edit. Is it possible the network driver is not include when I follow the instruction to edit startnet.cmd ?
Thanks
Hi,
1) I wonder how do you manage to mount the share, if you are unable to ping the server. May be there is a Firewall in between that was restricting ICMP, although the connectivity is there.
2) The size of WinPE.iso may vary based on what you have included in c:WinPE_x86 folder before running MakeWinPEMedia command.
I've been able to get to the point where Windows10 boots up and is about to map the share, but when running setup.exe it says 'Access is denied'.
Check user permissions and SELinux context on the directory. Try
# ls -alZ /smbshare
This blog, the related post and most others from internet search deal with setting up a PXE server and sending an OS installation image. I'm looking for something that would describe the process/steps to create the boot images that the PXE server sends to the client machine. Ideally I would have a client machine all setup and configured with my working application running linux (centOS) from a local drive. (1) Want to create a boot image of this client drive, (2) change things as required for PXE needs, (3)put image on PXE server, (4)make it boot over PXE process, (5)when local drive is removed from the client. Items (1) and (2) are steps/procedures I'm in search of. Thank you for any advice.
Hi,
Your requirements have been noted, We will work on it very soon.
You forgot to mention, that you need to copy memdisk from /usr/share/syslinux to /var/lib/tftpboot/
Thanks for the correction.
The above post has been updated accordingly.
Hi Ahmer,
I am getting Error 50 while creating WinPE.iso.
Please contact me on Facebook Page and share the complete error screenshot there.
Dear Mr. Ahmer. Thank you for the wonderful article regarding PXE boot. Your steps worked perfectly fine before on my test server. But now when I am trying same steps, I find that the new server does not boot on to the command line of WinPE but instead takes me to the GUI and asks me for the login. Before, it took me to the command line but now it is taking me to the GUI. This seems strange to me. Can you help me out in this regard??
Sure. Please contact me at my Facebook page.
Thank you!
This article helped me very much.
Good day sir, do you have this type of set up for Diskless server? Centos 7 Server and windows10 client?
Hi,
We don't have work on diskless server yet. But may be you will find it here in near future.
Hi!
I am trying to follow this tutorial, but when it comes to executing the setup.exe I get the error "This version of z:setup.exe is not compatible with the version of Windows you're running. Check your computer's system information and then contact the software publisher."
The samba share works fine and the installation files were obtained from an original Windows 10 copy that I downloaded from Microsoft website. The winpe.iso was created following the provided tutorial in an updated windows 10 machine.
Any ideas what this error might be?
Thanks in advance!
Hi,
Looks like you are installing on a 64-bit system. Please use
copype amd64 c:WinPE_x86
instead of
copype x86 c:WinPE_x86
and follow the steps thereafter as it is.
Please update me about the status of the problem.
Hi, Ahmer Mansoor,
Thanks for your help and quick answer. I was, indeed, installing a 64-bit system and using a 32-bit WinPE. Generating a amd64 WinPE solved the problem.
Thanks again!
Hi, this tutorial works amazing for BIOS based systems but cannot boot a UEFI system, any ideas how to do that?
Hi, We have worked on PXE long ago and we couldn't find a solution for Windows based UEFI support. Please share if you are able to resolve the issue.
Hi I have followed this guide for installing windows10 but I keep receiving the error-
System error 1312 has occured.
A specified logon session does not exist. It may already have been terminated.
Hello Ahmer. I'm trying to configure PXE boot from Centos7 for windows, but seems that the Winpe.iso is unable to mount the samba share. Strange is that the network drive accessible from windows system.
I'm receiveing the following error message:
"system error 1231 has occured.
The network location cannot be reached. For information about network troubehsooting, see Windows Help."
Do you have any advice?
The error pertains to your windows machine and there can be many reasons of it.
1) You can try to access a network share of another windows machine from this machine.
2) Also check that "File and Printer Sharing for Microsoft Networks" and "Client for Microsoft Networks" are checked in network connection settings.
Hi Ahmer Sir,
Below Error i am facing After run this CMD(copype.cmd amd64 f:WinPE).
ERROR: The following processor architecture was not found: amd64.
Failed!
Please discuss it with me on our Facebook page.
I've had the same issue. It try adding the smb server ip address or domain before the login like so:
/user:10.0.0.1pxereadonly
/user:gaurav.localpxereadonly
must use backslash not forward slash also.
Not sure if you ran into this but getting and error with setup.exe. I made sure that the Win10 version matched on host when I built the boot image as well as on the backend of the kickstart server.
> net use z: \10.20.20.63installwindows 10
the command completed successfully
> z:setup.exe
this version of z:setup.exe is not compatible with the version of windows you're running …
Please discuss it with me on our Facebook page.
I got same issue
z:setup.exe
this version of z:setup.exe is not compatible with the version of windows you're running ..
Please contact your vendor to provide a compatible version for PXE environment.
Hello Ahmer, just curious – did you manage to find a solution for PXE Windows 10 install via UEFI?
HI Ahmer m ,, I have same error also WinPE does not obtain ip address
Please discuss it with me on our Facebook Page.