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

Hostname change

Scheduled Pinned Locked Moved
General
4
8
5.9k
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.
  • D
    Denis
    last edited by Sep 5, 2013, 10:39 AM

    Greetings, I am using Fog to deploy images, After deploying multicast image I do not want the hostname to be changed as this will be set as part of the mini setup process following the reboot of the pc once the image is deployed as the image was taken after having been sysprepped, however despite having ensured that the "HOSTNAME Changer Enabled? has NOT been selected I am still finding that after the image gets deployed it it still displays “hostname change --done” I would like it to be skipped in the sameway as when you do a quick image i have found shows " hostbname change – Skipped.

    Also is it possible to provide some information on how the hostname change actually works, does it only work with the fog client installed on the imaged pc’s

    Many Thanks for you help
    Denis

    1 Reply Last reply Reply Quote 0
    • T
      Tom Elliott
      last edited by Sep 5, 2013, 11:05 AM

      My understanding of this is that it changes the name by editing the registry key’s directly within the fog system. This is nice as it doesn’t require the system to contain the FOG Service client. However, I think the pertinent part here is that it’s a part of the FOG script.

      From the fog script:
      if [ “$capone” != “1” ]; then

                                          changeHostname
      

      Then from /usr/share/fog/lib/funcs.sh

      changeHostname()
      {
      echo -n " * Changing hostname…“;
      if [ -n “$hostname” ]
      then
      mkdir /ntfs &>/dev/null
      regfile=”“;
      key1=”“;
      key2=”";
      if [ “$osid” = “5” ]
      then
      ntfs-3g -o force,rw $win7sys /ntfs
      regfile=$REG_LOCAL_MACHINE_7
      key1=$REG_HOSTNAME_KEY1_7
      key2=$REG_HOSTNAME_KEY2_7
      elif [ “$osid” = “1” ]
      then
      ntfs-3g -o force,rw $part /ntfs
      regfile=$REG_LOCAL_MACHINE_XP
      key1=$REG_HOSTNAME_KEY1_XP
      key2=$REG_HOSTNAME_KEY2_XP
      fi
      reged -e “$regfile” &>/dev/null <<EOFREG
      ed $key1
      $hostname
      ed $key2
      $hostname
      q
      y
      EOFREG
      umount /ntfs
      echo “Done”;
      else
      echo “Skipped”;
      fi
      }

      The reason you’re not seeing it get changed in quick image is that runs a different script called fog.quickimage. On reboot the task doesn’t set the $hostname variable which is to be skipped. The only way, I could think, to get this is to comment out the changeHostname field in /bin/fog of the init.gz on line 606.
      [COLOR=#000000]if [ “$capone” != “1” ]; then

                                          changeHostname[/COLOR]
      

      [COLOR=#000000]if [ “$capone” != “1” ]; then

                                          changeHostname[/COLOR]
      

      [COLOR=#000000] [/COLOR]

      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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

      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
      • L
        Lee Rowlett Developer
        last edited by Sep 5, 2013, 2:47 PM

        I don’t use the registry key way (removed it from my init.gz) i get the fog script to edit the sysprep file main reason get it to do it while it’s changing the sysprep file to join the domain or specified workgroup - so it’s all done by sysprep - only use the FOG Client for snapins.

        1 Reply Last reply Reply Quote 0
        • D
          Denis
          last edited by Sep 5, 2013, 4:10 PM

          Thanks very much for the comments so far received, just to confirm I am not using the fog clients, I am only using for to deploy images and do not want fog to interfere\change anything on the image that is deployed.
          I tried to # out the entry in the init.gz file , but after making the change found the init.gz image would not load when testing a deployment.
          when setting up a multicast job , files for each pc is writen to the /tfptboot/pxelinux.cfg/ when looking at each of these files that is an entry for hostname, if I delete the hostname bit the deplyed image will skipp the change hostname bit.
          What determines what details get written to these files.

          Thanks again
          Denis

          1 Reply Last reply Reply Quote 0
          • T
            Tom Elliott
            last edited by Sep 5, 2013, 4:20 PM

            When you’re mounting the init.gz, follow these steps:

            gunzip init.gz
            mkdir tmp
            mount -o loop init tmp
            vi tmp/bin/fog
            :606
            i#ESC
            :wq!
            umount tmp
            gzip -9 init
            rm -rf tmp

            You should be good to go.

            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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

            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
            • D
              Denis
              last edited by Sep 6, 2013, 2:43 PM

              Hi Tom, Followed steps as mentioned, seems to be working well,
              Thanks very much for you help, much appreciated,
              Regards
              Denis

              1 Reply Last reply Reply Quote 0
              • T
                Tom Elliott
                last edited by Sep 6, 2013, 2:48 PM

                No problem.

                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! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                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
                • C
                  chad-bisd Moderator
                  last edited by Sep 6, 2013, 2:49 PM

                  In the FOG web management, you can update the value under Other Information -> Fog Settings -> FOG_CHANGE_HOSTNAME_EARLY to 0 and the imaging script will not try to update the username by editing a registry key before windows loads.

                  If you do not install the FOG service, you’re hosts will not rename after they load windows. You can also disable the hostnamechanger option in the FOG Service install, per host record, and for your FOG server completely.


                  If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

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

                  270

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project