Capture and deploy image hostname always same
-
Hello!
I’m new here and I have just tested Fog as PXE boot server.
I installed it on linux ubuntu, and everything works fine, execept when I set up linux mint on one of my test PC’s I had to put in hostname (“Laptop”) of the computer.
When i cloned the computer it worked fine and no trouble at all, but when deploying image on other PC’s or laptops, the hostname is always changed to “Laptop”.
I unchecked the box where it says “FOG Client - Hostname changer”, but the hostname has still changed.Can anyone tell me what I did wrong or is there a way that hostname of computer wouldn’t change and would be something computer would get from motherboard.
Thanks!
-
@Lukaz For linux based hostnames, theres actual files that store the names. For windows there’s a registry that we can hackishly setup, but for LInux there’s a utility on most modern installs to the effect of
hostnamectl
and possibly others.Because of this, we don’t know where all the different names might be stored and we leave it alone.
Because you captured the blocks of the disk (which includes the files as they were originally written) the device names are set to that of the captured host. It’s not really “changing” the names.
To address this we do have a client utility that should be able to change the hostname for you to the damn of the actual machine based on what it is registered as under the UI, but it would mean installing the FOG Client on the image and using that image as the base for deploying to other machines.
Of note, with the FOG CLient method, until the client performs the hostname change operation, the machine would still have the name as whatever the captured machines name was.
-
This post is deleted! -
@Tom-Elliott so there isnt a file like virt-sysprep in FOG project in which the user could change username and password and computer name on the first boot after PXE deploy has finished?
Best regards!
-
@Lukaz No. not for linux at least, and technically not for windows either.
-
@Lukaz You could try doing a post download script that takes the hostname you set for that fog host and put it in the /etc/hostname file.
I think there may be other locations that hostnamectl sets on newer linux builds, but this could still work.I haven’t done a linux post download script but you can see some other examples in these posts, mostly windows based, but I’m sure we can apply the idea to linux without too much trouble. Just gotta mount the client disk in FOS (Fog operating system that you boot into over the network for the imaging process) after imaging is done and inject the fog hots hostname variable (not sure what the var name is off the top of my head) into /etc/hostname on the client. It’s a bit of work initially, but once setup should just work from then on.
https://forums.fogproject.org/topic/7740/the-magical-mystical-fog-post-download-script