Alright, time to tackle Part 2 of this huge Guide: Create Windows 10 Image for Deployment with FOG Server.
Now that we have our FOG Server up and running, it’s time to create our Generalized Windows 10 Image with Sysprep and capture it with our FOG Server for Deployment.
First things first: Download Windows 10 with the Windows 10 Download Tool. Make sure you create an ISO File.
Before you start
- Make sure that the VM you are going to install Windows 10 on, or the physical computer, has NO INTERNET CONNECTION UNTIL WE ARE IN AUDIT MODE! This is extremely important because Windows might activate itself in the installation process, given an active Internet Connection.
- Don’t enter a product key obviously
- Once we are booted into Audit Mode, we will re-enable the Internet Connection to Download the Windows ADK and Software we want to install.
Keep Microsoft’s Reimaging Rights in mind to Create Windows 10 Image for Deployment with FOG Server!
Thanks to a Reddit User who pointed that out: To create a Golden Image with Windows 10, you need to have 1 single Volume License for this particular Image.
Part 1: Installing Windows 10 in a VirtualBox VM
Start VirtualBox and click on New to create a New Virtual Machine.
Give it a descriptive Name and select Windows 10 64 bit.
Now allocate as much RAM as you could spare. 2GB is enough, 4 is better.
Create a Virtual Hard Disk Now.
Choose VDI as Hard Disk File Type
I’ll opt for Dynamically Allocated.
And I’ll keep the File Size at the Recommended 32,00GB. This highly depends on what you plan to install on the image, so if you want to install lots of software, adjust the size accordingly.
You can also choose a different location where you want to save the VDI file by clicking on the Folder next to the Name of the VM.
Next, we need to make sure that the Internet Connection is disabled.
Select your Windows 10 General Image and click on Network.
Uncheck Enable Network Adapter and click on Ok.
Now start your Virtual Machine.
Select the Windows 10 Image you downloaded earlier by clicking on the little Folder Symbol.
Now normally follow through the Installation Process. When you are getting asked for a key, click on I don’t have one. (excuse the German screen, I just have the German image)
On the next screen select Custom Installation.
Select your only Hard Drive and click next.
Now let the installation run through until you come to the first dialog after all the reboots are done, don’t press anything!
Part 2: Entering Audit Mode
After the reboots are done, this should be the first screen you will see: (as of September 2017..)
Now press CTRL + SHIFT and then hit the F3 key. Windows will now reboot into Audit Mode.
Click on Cancel on the first Dialog. That’s the Sysprep Dialog that pops up automatically, but we’ll do that later manually.
Part 3: Re-Enabling the Internet Connection
Now we can safely re-enable our Internet Connection to Download the ADK.
You can shut down your Windows 10 now, it will automatically boot up in Audit Mode again. We need to shut it down to re-enable the network connection.
After it’s shut down, select your VM and click on Network again.
Enable either Bridged Mode or NAT, both will work.
Start your VM again. After it’s booted up, cancel the Sysprep Dialog again.
Part 4: Installing VirtualBox Guest Auditions (Optional but recommended!)
One more side-step we can take for our convenience before is to install the VirtualBox Guest Additions. So we will be able to copy & paste stuff from our Host Computer to our VM. This is optional but recommended.
Simply click on Devices and Insert Guest Additions CD Image…
After that, open your CD Drive and run the Installation.
Simply follow through the installation and agree to installation everything you’re asked to.
Reboot your computer.
Cancel the Sysprep Dialog once more.
Click on Devices again, select Drag & Drop and Choose: Bidirectional
You will be able to Copy & Paste Link Addresses and Drag & Drop Files from your Host Computer to your VM.
Part 5: Installing the Windows ADK
Now open INTERNET EXPLORER, not Edge. Edge will not work here.
Go to this Link https://msdn.microsoft.com/en-gb/windows/hardware/dn913721.aspx
And Download the Windows ADK.
You should download Windows ADK for Windows 10 Version 1703, or whatever the newest version will be.
Click through the routine leaving everything on default (Expect maybe if you don’t want to send anonymous data to Microsoft, untick that), until you come to the part where you can choose what to install.
Uncheck everything except Deployment tools:
Finally, click on Install.
Alright, after this is done we can start customizing Windows.
Optionally, you can take a Snapshot of the machine state now (Recommended!) to revert to a fresh installation state later if you need to.
Part 6: Customizing Windows
First I will tell you what you can customize:
- Desktop Icon Spacing and Sizes.
- File Explorer Settings
- Windows Wallpaper
- Windows Icons, Sounds, Themes and Colors
All those settings, when modified in Audit mode, will be saved in the Default User Profile. Meaning, every user that you will add to this machine later (Even Domain Users), will have those settings applied to them. It works very well in a Domain environment, too.
Now you can also go ahead and Install every Software you want to have available on your General Image.
- VLC Player
You can go to Ninite.com to make the installation easier.
Now we are going to also install the FOG-Client.
I assume that you won’t have just one single Laptop or Desktop Model but several different. That’s where the FOG Client comes into play. It allows you to use whatever Computer Model you want.
Just open HTTP://<Your Fog Server IP>/fog/client or simply open an instance of your FOG-Server in the web browser and find “Fog Client” on the bottom of the page.
Just run through the Smart-Installer process and you can forget it. Select that you want to hide the taskbar symbol.
After you got everything installed, I would recommend you to change the computer name to something less generic.
Just hit the Windows Key and type: Name
Select Show Computer Name and change it to something descriptive.
Reboot your system. Cancel the Sysprep Dialogue one more time.
Part 7: Creating an Answer File
Now we need to create our Answer file that tells Sysprep what kind of changes we want to have applied to our Image.
First, we need to put back our Windows 10 Image into our VM, so Sysprep can access the installation medium.
Click on Devices -> Optical Drives and Select your Windows 10 Image again.
Open an Explorer Window and open the Windows 10 Image. Select all files and copy them.
Create a new folder in C:\customize\Win10 and paste the files in there.
Converting install.esd to install.wim
Now we need to convert the install.esd file to a install.wim file so we can use it for creating our answer file.
Press your Windows Key once more and type “Powershell”. Right-click Powershell and select Run as Administrator. Run the following command next:
dism /Get-WimInfo /WimFile:C:\customize\Win10\sources\install.esd
Now depending on which Windows 10 Version you want to install, you need to choose the correct index number in the next step. Look in the image below.
Once you have the number noted, in my case it’s “5” for Windows 10 Professional, we are going to create our install.wim by running:
dism /Export-Image /SourceImageFile:C:\customize\Win10\sources\install.esd /SourceIndex:5 /DestinationImageFile:C:\customize\Win10\sources\install.wim /Compress:Max /CheckIntegrity
Make sure to adjust the command with your own SourceIndex Number! And make sure the path is the same for Source and Destination.
Creating the Answer File using Windows System Image Manager
Open Windows System Image Manager by pressing the Windows Key and typing it’s name. Click on File -> Select Windows Image and choose the C:\customize\Win10\sources\install.wim file we just created (Sorry for the German Screenshot). Select YES in the following dialogue.
Create a Folder called Distribution in C:\customize\ and within this Folder create 4 Subfolders:
- Out-of-Box Drivers
Next back in Windows System Image Manager Click on File -> Select Distribution Share. Select the Distribution folder we just created and click on Ok.
Next click on File -> New Answer File.
If you just want to create an answer file and manually run through the Windows installation each time you pull your FOG Image to a new client, you can just go ahead and continue with saving the file. If you want to fully automate your installation process, I can recommend this article which helps you to fully automate your Windows 10 installation. I won’t cover all those steps here.
Click on Tools -> Validate Answer File when you are ready.
From here on you can save your file by selecting File -> Save Answer File -> C:\customize\customize.xml
If you want to learn how to hide this Customize Folder so your users don’t see it, I got you covered!
Alright, finally we have everything set up and we are able to run Sysprep!
Part 7.5 (OPTIONAL): Remove last used Folder / Files
Because we last used our customize.xml file, the user who logs in after the Image was applied to a machine, will still see this file in the last used file section of the Windows Explorer. To prevent that, we can implement a little script that will remove that.
The script will just run once and deletes itself after.
To do that, navigate to %appdata%\Microsoft\Windows\Start Menu\Programs\Startup and create a file called runonce.bat , make sure the file extension is correct and not .txt. Edit the file and paste the following code:
echo Y | del %appdata%\microsoft\windows\recent\automaticdestinations\* del %0
This will solve the problem.
Part 8: Running Sysprep
Make sure you have everything set up as you want it to be. This will generalize your image.
TAKE A SNAPSHOT NOW! You can later revert back to this snapshot in case you want to change software, update windows, modify your answer file and so on.
After taking a Snapshot, you can go ahead and delete the C:\customize\Win10 folder to save you some disk space, or, you remove it later after installing the image on a client.
Hit the Windows Key, type in: cmd and right-click Run As Administrator.
Navigate to the Sysprep directory by typing:
Stop Windows Media Networking Service to avoid errors during Sysprep by typing:
net stop wmpnetworksvc
It never was actually started for me, but it might be for you. Just do it to be safe.
Now we start Sysprep. After running the command, Sysprep will prepare the Image, DO NOT DO ANYTHING WITH THE COMPUTER WHILE SYSPREP IS RUNNING!
sysprep.exe /generalize /oobe /shutdown /unattend:C:\customize\customize.xml
After Sysprep is finished, shut down your computer if it doesn’t do it by itself.
Congratulations, now you have your Generalized Windows 10 Image.
Anytime you want to do changes on this image, like update Windows, Install new Software, change Software or whatever, just go back to that one Snapshot you took before running Sysprep, make changes, and run Sysprep again.
Part 9: Capturing our Image with FOG Server
Alright, finally time to get our FOG Server back into play!
Make sure your FOG Server is running, if you set everything up correctly, we should be done in no time now!
First, log in to your FOG Web Interface and head to Images.
Click on Create Image and adjust everything like in my screenshot.
It might sound a bit counter-intuitive, but you have to first create an Image in the Database of FOG to be able to capture it. I had to wrap my head around it at first too.
Alright, time to register our Windows 10 host in FOG:
Select your Windows 10 VM and click on System. Make sure you have Network Boot Enabled in your VM and it’s on position #1.
One more thing, make sure that Legacy Boot (not UEFI) is enabled on whatever computer you want to capture or deploy. I think FOG supports UEFI already but I haven’t looked into it yet.
Fire up the client and you should end up in your PXE Boot Environment.
Choose Perform Full Host Registration and Inventory.
Questions and Answers during the process:
- Enter the hostname for this computer:
- Enter your hostname, for example, Win10General
- Enter the image ID to associate with computer
- Confirm with Enter
- Would you like to associate this host with groups?
- Would you like to associate this host with snapins?
- Would you like to… a product key to this host?
- Would… Join a domain?
- Enter the primary user for this computer:
- Confirm with Enter
- Enter other tag #1
- Enter other tag #2
- Would you like to deploy the image to this computer now?
Phew… Questions over questions.
Now your Win10 General Image is registered in your FOG-Server.
Power off your VM after the registration process is finished and the machine attempts to reboot.
Part 10: Capturing our Image
Bare with me guys, just a few more steps and we are golden.
Back to your FOG-Server Web Interface.
Head to Hosts -> List All Hosts and click on your Win10General Host.
In case your host is not listed under its hostname, you can simply network boot your Win10General VM once again and look up it’s MAC Address, then rename it in FOG:
After you selected your host, choose your Windows 10 General Image that you created earlier.
Don’t mind the different names on the screenshots, just select what you created.
Click on Update.
When that’s done, Navigate to Task Management -> List All Hosts and click on Capture next to your Win10General Host.
Head back to the System tab in your VirtualBox VM. You should now have Network on first and Hard Disk on the second position:
Now start your VM. The Image Capturing process starts automatically.
After the capturing process is finished, just switch off your Win10General Host until you need to have some changes done on it again. It can rest for now.
Head over to Images and click on All Images in your FOG-Server Web Interface.
If all went well, you should now see that your Win10General Image grew to a certain size.
This means that the capture task was completed successfully.
Part 11: Deploying the Image
You probably have guessed it by now.
The Deploying process is very simple now. I won’t step by step screenshot it for you because if you have followed through everything before, it should be a breeze for you.
- Boot a new client via PXE Boot.
- Perform a Full Host Registration.
- Choose a Hostname
- You can now already decide if you want to associate an Image ID with this computer. Press ? to list all Image ID’s and choose the one you would like to deploy. You can also NOT do this and associate an Image with the host registration via FOG-Web Interface. You select the Host, associate the Win10General Image to it and head to Task Management and choose Deploy Image. That’s way more steps, so I always opt for Associate Image ID with this computer already here.
- On the last question of the registration process: Would you like to deploy the Image to this Computer now? You choose Yes.
That’s it. Now FOG will deploy the Image to your computer fully automatic.
I hope those last steps are clear. It’s far easier to just associate an Image ID within the Host Registration Process than doing everything via the Web Interface. Saves a ton of time.
Conclusion and Final Words
If you stuck until here, congratulations, you have a fully operational, FREE Imaging solution up and running!
I use FOG a while now and I’m still very satisfied with how easy it is once it’s running.
I will keep using it until I need a different solution one day.
I really hope I didn’t miss out on any steps, this is a monster of a tutorial, if so, please let me know in the comments! The video is coming soon too! Subscribe to my Channel to be sure to get informed!
ADDITIONAL INFORMATION REGARDING WINDOWS SERVER DHCP + EXTRAS
Thanks to the User “ICT” below in the comments, I can share a bit additional information with you regarding the whole setup with Windows Server and a couple other options.
He pointed out:
Great tutorial, with a few bugs for me and a last question to you.
Question: Does this also work for multicast, I can’t configure it. Multicast does the job but after Windows boots, I get the error in the Windows installation that something has gone wrong…
Bugs and answers:
– If you work with Windows Server DHCP, please activate in DHCP Scope Options 66 with value ip-address fogserver and 67 with value undionly.kpxe
– Choose in VirtualBox also with Clipboard for bidirectional
– Install on the client Fog Client and uncheck enable Fog Tray and give the Server IP-address in the box on top
– If you work with Windows Education, replace in the Answer file with Education and not EDU
Thanks again buddy!
More additional Windows Server DHCP Information from another reader, Dylan P.:
Hi Stefan, I followed your guide for the setup and configuration of FOG with a Windows 10 Pro image and I have been using Windows Server to handle DHCP with virtual machines to run FOG and capture the deployment image. It really took some time to get the DHCP server policies setup correctly and I wanted to share some of the specifics that I have been using with the hope of benefiting others that may be having similar issues.
Note: Option 66 and 67 need to be enabled for PXEClient:Arch:00000 (DHCP Manager > T310-Demo.TestRealm.lcl > IPv4 > Policies > PXEClient:Arch:00000 > Options > DHCP Standard Options > …) FOG DHCP Settings https://wiki.fogproject.org/wiki/index.php/BIOS_and_UEFI_Co-Existence
Expand DHCP server Right click IPv4 Select Define vendor classes Click Add Repeat for each of the following: PXEClient:Arch:00000 PXEClient:Arch:00002 PXEClient:Arch:00008 PXEClient:Arch:00009 PXEClient:Arch:00007
Expand DHCP server Expand IPv4 Right click Policies Select New Policy Name/Desc: Allow UEFI PXE handout Click Next Click Add Criteria: Vendor Class Operator: Equals Value: Select each of the following, check Append Wildcard, and Click Add PXEClient:Arch:00007* PXEClient:Arch:00008* PXEClient:Arch:00009* Click Ok Click Next Select Option 067 from DHCP Standard Options Set String Value to: ipxe.efi
Right click Policies Select New Policy Name/Desc: PXEClient:Arch:00000 Click Next Click Add Criteria: Vendor Class Operator: Equals Value: Select each of the following, check Append Wildcard, and Click Add PXEClient:Arch:00000 Click Ok Click Next Select Option 067 from DHCP Standard Options Set String Value to: undionly.kpxe
Name/Desc: i386 EFI boot Click Next Click Add Criteria: Vendor Class Operator: Equals Value: Select each of the following, check Append Wildcard, and Click Add PXEClient:Arch:00002* PXEClient:Arch:00006* Click Ok Click Next Select Option 067 from DHCP Standard Options Set String Value to: i386-efi/ipxe.efi
Thank you, Dylan!