Custom Full Host Registration Menu for 1.4.0.rc2 and later

  • Custom FOG Full host registration

    This guide is to allow you remove questions asked during the full host registration process. In previous versions of FOG, the only way to customize this was to modify the /bin/ manually. The instructions on this link are for FOG versions 1.2.0 and below:

    In FOG 1.4.0rc2 and higher, we must use post init scripts. Once a major update is released, this tutorial can be modified to reflect those changes.

    Let’s start by creating a few scripts. Secondly we will modify the fog.postinit script to call our custom scripts. Our first script that we will create will be called which will be a modified version of the script in /bin/ This script is actually everything that is performed when selecting the full host registration option when you boot into FOG but this tutorial utilizes post init scripts to “copy” our customized script and replaces /bin/ script. So let’s go to our steps and begin:

    Step 1
    Obtain a copy of /bin/ so we can modify it to our needs.
    Here is the link on github:

    We can go ahead and place this file under /images/dev/postinitscripts/ and rename it to so we can reference it later.

    As in the Wiki link earlier above, we will now modify the script using the same concepts. A good rule of thumb is for every question you want to remove during the full host registration process, you will have to delete the variable towards the bottom of the code.


    while [[ -z $askme ]]; do
        echo -n "    Would you like to associate this host with groups? (y/N) "
        read askme
        case $askme in
                setIDs "groupid" "group" "true" "" 20
                echo " * Invalid input, please try again"

    So if you don’t want to be asked this question above, you must delete everything between askme="" and done. Then towards the bottom of the code, you will see the following:

    while [[ -z $res ]]; do
        res=$(curl -ks --data "mac=$mac&advanced=$(echo -n 1 | base64)&host=$host&imageid=$imageid&primaryuser=$primaryuser&other1=$other1&other2=$other2&doimage=$realdoimage&doad=$blDoAD&location=$location64&username=$user64&groupid=$group64&snapinid=$snapin64&productKey=$productKey" http://${web}service/auto.register.php 2>/dev/null)
        echo "$res"
        usleep 2000000

    Look for the section where it says groupid because that is the variable we no longer need. So from there delete the following: &groupid=$group64 The & must be in the front of the variable being removed in case another variable must follow.

    By following the steps on the Wiki link

    We can follow the same concepts. Now we can just really skip any modifications to the inits.

    Step 2
    Now that we have a customized script and placed it in the proper directory, we can now create the script that fog.postinit will call. We will call this script patch.fullreg and use the following code:

    echo "Installing Patch"
    cp -f ${postinitpath} /bin/
    echo "Done Patching stuff"

    We then save that file also in the same directory that and fog.postinit which is /images/dev/postinitscripts/ As you can see, we are really just copying our custom script to This allows us to basically simplify our full host registration process. Through this process, we can now remove questions like product key, user1, user2, primary user, active directory, etc.

    Notes: This will not work if using fog 1.3.0 - 1.4.0 rc 1 from my understanding. I’m sure I will be updating this post and making changes to improve the language and references. Hopefully with this, we can update the Wiki page to reflect the newer version of FOG and utilizing post init scripts in the future.

  • Moderator

    @jgallo We must be aware of a few things here.

    1. The github site always contains the latest release. So (currently) the files contained are for FOG 1.5.0. If you are working on a down level version of FOG then you need to take the route of extracting the inits. You don’t need to repack the inits, because you only need the file you want to tweak. Once you have the file you want to patch, then you may unmount the loop directory and remove the unpacked init.
    2. The structure of files may change from release to release. In the case of FOS, it was split out into its own branch. The correct path (as of 1.5.0) to the file in question is: (full disclosure, it took me a bit to find the right path too).
    3. The only caution is as newer versions of FOG are released, your patch file may become stale, where you might need to update a newer versions of as newer versions of FOG are released. The risk is that you might be applying an older version of over an updated version breaking FOG without a clue why.

    The rest of the instructions by @JGallo are still accurate (at least for 1.5.0). You can still use the post init scripts to “patch” the current FOS image as in the original post.

  • @daniel-dillard

    Thank you. That is weird. Probably something on githubs end. Hopefully @george1421 or @Tom-Elliott could help.

  • Noticed that the link to above is broken. I attempted to extract the file myself using a modified version of the old instructions (unxz init, mount -o loop init initmountdir/, etc.) and am able to get the file, however when I zip back up init it breaks everything.

    Anyway, I did end up figuring it out, but thought you would want to know that the link to the file was dead.

  • @george1421 Finally got around to testing this. I was able to remove the unwanted options, no issues.

    I was also able to get it set to join AD domain, but I wasn’t able to get it to pick an image or snapins. Is there a specific way that the values need to be entered?

  • Moderator

    @Avaryan Yes you could “hard wire” the registration script to select any option required.

    There is also a plugin that simulates static groups. You create a template host and link it with a group. Then when you add a new host to that group, the template host settings get copied to the new host.

  • Would it be possible to select a default image and snapins and not have it show those options?