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

    Rename Linux host after deployment

    Scheduled Pinned Locked Moved
    General
    3
    7
    1.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.
    • A
      andreiv
      last edited by andreiv

      I have a dual boot deployment situation. I manage the Windows part with my own scripts, but I would like to rename the Ubuntu part after deployment (changing the host name to the same name as the host name registered in FOG).
      Can this be done somehow?

      The partition structure is very simple. I have 4 primary MBR partitions: the Windows recovery partition, the Windows partition, the Ubuntu partition and the swap.

      1 Reply Last reply Reply Quote 0
      • george1421G
        george1421 Moderator
        last edited by

        The short answer is yes probably.

        The solution is with a fog postinstall script. This script gets run just after the image is deployed to the target computer and before the first boot of the target OS on the computer.

        What you need to do is write a bash script that mounts the ubuntu partition and then you can run a sed script against the host name file for unbuntu to change the host name. In a fog post install script you can get fog system variables by calling a file from the fog server.

        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!

        1 Reply Last reply Reply Quote 0
        • george1421G
          george1421 Moderator
          last edited by

          You probably want to read through this tutorial to gets some clues. https://forums.fogproject.org/topic/7740/the-magical-mystical-fog-post-download-script

          I realize its MS Windows centric. But the coding is all bash scripting. Pay attention to the bits about the sed script that will update the unattend.xml file’s host name. A similar concept can be run against ubuntu’s host name file.

          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!

          1 Reply Last reply Reply Quote 0
          • A
            andreiv
            last edited by

            Ok. Thank you for the answer.

            1 Reply Last reply Reply Quote 0
            • S
              Sebastian Roth Moderator
              last edited by

              @andreiv Here you see some great examples: https://forums.fogproject.org/topic/4510/scripts-customization-of-ubuntu-fog-service-for-ubuntu

              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

              A 2 Replies Last reply Reply Quote 0
              • A
                andreiv @Sebastian Roth
                last edited by

                @george1421 Ok. Thanks.

                1 Reply Last reply Reply Quote 0
                • A
                  andreiv @Sebastian Roth
                  last edited by

                  @sebastian-roth Great! Thanks.

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

                  144

                  Online

                  12.0k

                  Users

                  17.3k

                  Topics

                  155.2k

                  Posts
                  Copyright © 2012-2024 FOG Project