• Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
  • Recent
  • Unsolved
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Change Hostname Early / Client Hostname Changer

Scheduled Pinned Locked Moved
General
3
10
2.0k
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W
    willian
    last edited by willian Jun 10, 2019, 1:17 PM Jun 5, 2019, 1:38 PM

    Hello.

    I wonder if these two settings do the same thing or is there any difference between?

    Captura de tela de 2019-06-05 10-28-59.png

    Thanks.

    Fog 1.5.6 (DHCP Server)
    CentOS 7

    1 Reply Last reply Reply Quote 0
    • S
      Sebastian Roth Moderator
      last edited by Jun 6, 2019, 10:21 PM

      @willian Although I am not exactly sure I understand your question I will try to answer.

      The option “change hostname early” will make FOS (FOG Linux OS - doing all the imaging work) run some registry modification scripts that do change the hostname of your machine after imaging but before it booting the first time.

      On the other hand what you call “Client Hostname Changer” I suspect to be the Hostname Changer Module we have in the fog-client software. This will check the hostname of your machine when the client host OS is booted up and running the fog-client service. In case it finds the hostname to be different it will try to change it and reboot the machine.

      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

      W 1 Reply Last reply Jun 10, 2019, 7:01 PM Reply Quote 0
      • W
        willian @Sebastian Roth
        last edited by Jun 10, 2019, 7:01 PM

        Hi @Sebastian-Roth that’s exactly what I wanted to know. I keep the Change Hostname Early enabled, as in the picture I posted, but the hosts “receive” random hostnames, DESKTOP-XXXXX. As I use sysprep to create the golden image, I do not include the ComputerName option in the unattend.xml file. I’ve also performed a debug deploy task to check:

        Captura de tela de 2019-06-10 15-47-41.png
        Captura de tela de 2019-06-10 15-48-00.png

        Fog 1.5.6 (DHCP Server)
        CentOS 7

        G 1 Reply Last reply Jun 10, 2019, 7:52 PM Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by Jun 10, 2019, 7:43 PM

          @willian I am not familiar with sysprep but @george1421 might know if this should work.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 0
          • G
            george1421 Moderator @willian
            last edited by george1421 Jun 10, 2019, 1:52 PM Jun 10, 2019, 7:52 PM

            @willian I’m not sure what your problem is here. Your OP was an either or.

            I can tell you that if you don’t set a computer name in the unattend.xml file you will get exactly what you are seeing. Then fog should rename the target computer when the fog client service is run.

            I can also tell you I don’t use FOG to set the computer name because of our naming convention. I CAN calculate the name at install time. I use a post install script to update the unattend.xml file on the target computer after the image has been deployed but before the first boot of WinSetup/OOBE.

            You can see how I’m doing this in this tutorial: https://forums.fogproject.org/topic/11126/using-fog-postinstall-scripts-for-windows-driver-injection-2017-ed Specifically this script: fog.updateunattend Where I use sed to change the name of the computername section to what fog’s internal host name variable is $hostname. For full disclosure my post install script is a bit more complicated since the $hostname variable is calculated when the script is run. But the fog.updateunattend script give a few examples of what could be done.

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            W 1 Reply Last reply Jun 10, 2019, 10:07 PM Reply Quote 0
            • W
              willian @george1421
              last edited by Jun 10, 2019, 10:07 PM

              @george1421 I had understood that by enabling the change hostname early, the hosts would have their hostnames changed during or after the deploy of the image, according to which they were registered on the server. For example, if I registered a host like Test-123, after deploy the image that would be its hostname.

              Fog 1.5.6 (DHCP Server)
              CentOS 7

              G 1 Reply Last reply Jun 10, 2019, 10:55 PM Reply Quote 0
              • G
                george1421 Moderator @willian
                last edited by Jun 10, 2019, 10:55 PM

                @willian Since I don’t use that function I had to reverse engineer the code to see how it should work.

                Long story short I expect that this process will not work with windows 10 (at least). This feature updates the registry directly post image push. I suspect with Win10 all registry entries are updated during WinSetup/OOBE.

                Here is the code segment that is supposed to set the host name:

                # Changes the hostname on windows systems
                #
                # $1 = Partition
                changeHostname() {
                    local part="$1"
                    [[ -z $part ]] && handleError "No partition passed (${FUNCNAME[0]})\n   Args Passed: $*"
                    [[ -z $hostname || $hostearly -eq 0 ]] && return
                    REG_HOSTNAME_KEY1="\ControlSet001\Services\Tcpip\Parameters\NV Hostname"
                    REG_HOSTNAME_KEY2="\ControlSet001\Services\Tcpip\Parameters\Hostname"
                    REG_HOSTNAME_KEY3="\ControlSet001\Services\Tcpip\Parameters\NV HostName"
                    REG_HOSTNAME_KEY4="\ControlSet001\Services\Tcpip\Parameters\HostName"
                    REG_HOSTNAME_KEY5="\ControlSet001\Control\ComputerName\ActiveComputerName\ComputerName"
                    REG_HOSTNAME_KEY6="\ControlSet001\Control\ComputerName\ComputerName\ComputerName"
                    REG_HOSTNAME_KEY7="\ControlSet001\services\Tcpip\Parameters\NV Hostname"
                    REG_HOSTNAME_KEY8="\ControlSet001\services\Tcpip\Parameters\Hostname"
                    REG_HOSTNAME_KEY9="\ControlSet001\services\Tcpip\Parameters\NV HostName"
                    REG_HOSTNAME_KEY10="\ControlSet001\services\Tcpip\Parameters\HostName"
                    REG_HOSTNAME_KEY11="\CurrentControlSet\Services\Tcpip\Parameters\NV Hostname"
                    REG_HOSTNAME_KEY12="\CurrentControlSet\Services\Tcpip\Parameters\Hostname"
                    REG_HOSTNAME_KEY13="\CurrentControlSet\Services\Tcpip\Parameters\NV HostName"
                    REG_HOSTNAME_KEY14="\CurrentControlSet\Services\Tcpip\Parameters\HostName"
                    REG_HOSTNAME_KEY15="\CurrentControlSet\Control\ComputerName\ActiveComputerName\ComputerName"
                    REG_HOSTNAME_KEY16="\CurrentControlSet\Control\ComputerName\ComputerName\ComputerName"
                    REG_HOSTNAME_KEY17="\CurrentControlSet\services\Tcpip\Parameters\NV Hostname"
                    REG_HOSTNAME_KEY18="\CurrentControlSet\services\Tcpip\Parameters\Hostname"
                    REG_HOSTNAME_KEY19="\CurrentControlSet\services\Tcpip\Parameters\NV HostName"
                    REG_HOSTNAME_KEY20="\CurrentControlSet\services\Tcpip\Parameters\HostName"
                

                I might suspect that if the system wasn’t sysprep’d that this code “might” work as intended. But I can’t say for sure.

                Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                W 1 Reply Last reply Jun 11, 2019, 2:12 PM Reply Quote 0
                • W
                  willian @george1421
                  last edited by Jun 11, 2019, 2:12 PM

                  @george1421 So, since Change Hostname Early might not work for me since I use sysprep, could I enable Hostname Changer to do the check but not reboot the machine in a forced manner, but when it is manually restarted by the user?

                  Fog 1.5.6 (DHCP Server)
                  CentOS 7

                  G 1 Reply Last reply Jun 11, 2019, 2:41 PM Reply Quote 0
                  • G
                    george1421 Moderator @willian
                    last edited by Jun 11, 2019, 2:41 PM

                    @willian Sorry the restart is automatic and managed by the FOG Service. I still think the post install script to update the unattend.xml file is a good option.

                    Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                    W 1 Reply Last reply Jun 13, 2019, 4:18 PM Reply Quote 0
                    • W
                      willian @george1421
                      last edited by Jun 13, 2019, 4:18 PM

                      @george1421 the next time I need to change something in the golden image I will test these scripts. Thank you.

                      Fog 1.5.6 (DHCP Server)
                      CentOS 7

                      1 Reply Last reply Reply Quote 0
                      • 1 / 1
                      1 / 1
                      • First post
                        8/10
                        Last post

                      188

                      Online

                      12.0k

                      Users

                      17.3k

                      Topics

                      155.2k

                      Posts
                      Copyright © 2012-2024 FOG Project