From 2cf9540f6df5701638b0d9c0fcec01650c78c52b Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 10 Nov 2026 09:22:55 -0600 Subject: [PATCH 1/2] FOG Agent: capturing an image, Sysprep, and the firewall The install page now says what to do with the agent on a reference machine. Capture it as is: each clone discards the captured key and enrolls as itself. Before Sysprep, disable the fog-agent service and start it from SetupComplete.cmd, because the agent reboots at once for a rename when nobody is logged in, and that breaks OOBE. The agent needs no inbound firewall rule. The capture how-to links to the new section. Co-Authored-By: Claude Opus 5.5 --- docs/installation/client/install-fog-agent.md | 51 +++++++++++++++++++ docs/kb/how-tos/capture-an-image.md | 3 ++ 2 files changed, 54 insertions(+) diff --git a/docs/installation/client/install-fog-agent.md b/docs/installation/client/install-fog-agent.md index bf7b6c5..cbe4957 100644 --- a/docs/installation/client/install-fog-agent.md +++ b/docs/installation/client/install-fog-agent.md @@ -299,6 +299,57 @@ The agent is released more often than FOG, and a newer agent against an older 1.6 server is the expected case: the server tells the agent which capabilities it has, and the agent leaves the rest idle. +## Capturing an image with the agent installed + +Install the agent on the reference machine and capture it. You do not +remove the agent's key or certificate first. The captured state directory +holds the key and the firmware identity it was made for. Each deployed +machine has a different firmware identity, so the agent discards the +captured key and enrolls as itself. A deploy from this server approves +that enrollment with no click, as [Enrollment and +approval](#enrollment-and-approval) describes. + +One exception: firmware with no UUID or serial of its own (all blank, or +one placeholder on every unit). The agent cannot tell those machines +apart. On such hardware, stop the service and delete `key.pem` and +`cert.pem` from `%ProgramData%\FOG\agent` immediately before capture. + +### Sysprep + +Disable the service before you run Sysprep, and start it again from +`SetupComplete.cmd`. This is the same procedure as the legacy client, with +the new service name. The reason is the reboot rule: with nobody logged +in, the agent reboots at once for a rename or a domain join (see +[[fog-agent#How and when it reboots|How and when it reboots]]). Windows +setup runs its specialize and OOBE passes with nobody logged in. A reboot +in those passes stops setup with "Windows could not complete the +installation". + +On the reference machine, immediately before Sysprep: + +``` +sc stop fog-agent +sc config fog-agent start= disabled +``` + +In `C:\Windows\Setup\Scripts\SetupComplete.cmd` in the image: + +``` +sc config fog-agent start= delayed-auto +sc start fog-agent +``` + +Windows runs `SetupComplete.cmd` after setup finishes and before the first +logon. The `sc start` line enrolls the agent at that point, not at the +next reboot. The space after `start=` is required. + +### Firewall + +The agent needs no inbound firewall rule. It opens no listening port. It +only connects out to the FOG server, on the port in the server URL (443 +for `https://`). Add an outbound rule only if your site blocks outbound +traffic by default. + ## Moving from the legacy client Nothing on the server has to change first. Hosts, groups, printers, snapins, diff --git a/docs/kb/how-tos/capture-an-image.md b/docs/kb/how-tos/capture-an-image.md index 79d6b82..210f089 100644 --- a/docs/kb/how-tos/capture-an-image.md +++ b/docs/kb/how-tos/capture-an-image.md @@ -44,6 +44,9 @@ have done the following: - Decrypt BitLocker fully and do not enroll a Windows Hello PIN; FOS refuses an encrypted partition and a PIN cannot survive imaging. See [[tpm-bitlocker-windows-hello|TPM, BitLocker and Windows Hello after imaging]] +- On FOG 1.6, install the FOG Agent instead of the FOG client. Disable + its service before Sysprep and start it from `SetupComplete.cmd`. See + [[install-fog-agent#Capturing an image with the agent installed|Capturing an image with the agent installed]] - Sysprep the machine and shut it down We're assuming here that you have a running FOG server, that you are From 7a83233358e01eee05595e4663f785545cea8890 Mon Sep 17 00:00:00 2001 From: Tom Elliott Date: Tue, 10 Nov 2026 09:37:22 -0600 Subject: [PATCH 2/2] FOG Agent Sysprep: leave the service running from 0.1.23 Agent 0.1.23 waits for Windows setup to finish before it enrolls, checks in or reboots, so the disable-before-Sysprep step is only for older agents. The section now says that, with the old steps in a note. Co-Authored-By: Claude Opus 5.5 --- docs/installation/client/install-fog-agent.md | 41 ++++++++----------- docs/kb/how-tos/capture-an-image.md | 4 +- 2 files changed, 19 insertions(+), 26 deletions(-) diff --git a/docs/installation/client/install-fog-agent.md b/docs/installation/client/install-fog-agent.md index cbe4957..4fe8340 100644 --- a/docs/installation/client/install-fog-agent.md +++ b/docs/installation/client/install-fog-agent.md @@ -316,32 +316,25 @@ apart. On such hardware, stop the service and delete `key.pem` and ### Sysprep -Disable the service before you run Sysprep, and start it again from -`SetupComplete.cmd`. This is the same procedure as the legacy client, with -the new service name. The reason is the reboot rule: with nobody logged -in, the agent reboots at once for a rename or a domain join (see -[[fog-agent#How and when it reboots|How and when it reboots]]). Windows -setup runs its specialize and OOBE passes with nobody logged in. A reboot -in those passes stops setup with "Windows could not complete the +Run Sysprep with the agent installed and its service left as it is. You +do not disable it, and you do not need `SetupComplete.cmd` for it. The +legacy client needed both. The agent does nothing until Windows setup has +finished. It does not enroll, check in, or reboot during the specialize +and OOBE passes. It starts when setup reports itself complete, before the +first logon. A reference machine in audit mode never enrolls. + +This matters because of the reboot rule: with nobody logged in, the agent +reboots at once for a rename or a domain join (see +[[fog-agent#How and when it reboots|How and when it reboots]]). A reboot +during OOBE stops setup with "Windows could not complete the installation". -On the reference machine, immediately before Sysprep: - -``` -sc stop fog-agent -sc config fog-agent start= disabled -``` - -In `C:\Windows\Setup\Scripts\SetupComplete.cmd` in the image: - -``` -sc config fog-agent start= delayed-auto -sc start fog-agent -``` - -Windows runs `SetupComplete.cmd` after setup finishes and before the first -logon. The `sc start` line enrolls the agent at that point, not at the -next reboot. The space after `start=` is required. +>[!note] Agents older than 0.1.23 +>An older agent does not wait for setup. Update the reference machine's +>agent, or disable the service before Sysprep +>(`sc config fog-agent start= disabled`) and turn it back on in +>`C:\Windows\Setup\Scripts\SetupComplete.cmd` with +>`sc config fog-agent start= delayed-auto` and `sc start fog-agent`. ### Firewall diff --git a/docs/kb/how-tos/capture-an-image.md b/docs/kb/how-tos/capture-an-image.md index 210f089..87ec42e 100644 --- a/docs/kb/how-tos/capture-an-image.md +++ b/docs/kb/how-tos/capture-an-image.md @@ -44,8 +44,8 @@ have done the following: - Decrypt BitLocker fully and do not enroll a Windows Hello PIN; FOS refuses an encrypted partition and a PIN cannot survive imaging. See [[tpm-bitlocker-windows-hello|TPM, BitLocker and Windows Hello after imaging]] -- On FOG 1.6, install the FOG Agent instead of the FOG client. Disable - its service before Sysprep and start it from `SetupComplete.cmd`. See +- On FOG 1.6, install the FOG Agent instead of the FOG client. Leave + its service running through Sysprep. See [[install-fog-agent#Capturing an image with the agent installed|Capturing an image with the agent installed]] - Sysprep the machine and shut it down