New Question

Windows 10 Hostname not being set

asked 2016-02-25 14:32:48 +0300

dniasoff gravatar image


I am trying to build a windows 10 (1511) image on Cloudstack.

Running windows update and then installing Cloudbase-init using the built in unattend xml.

It creates the new Admin account but does not change the hostname?

Is there any command I can run in %WINDIR%\Setup\Scripts\SetupComplete.cmd to work around this?

If I delete HKEYLOCALMACHINE\SOFTWARE\Cloudbase Solutions and reboot it does change the hostname.

Tried adding the following to %WINDIR%\Setup\Scripts\SetupComplete.cmd

reg delete /f "HKEYLOCALMACHINE\SOFTWARE\Cloudbase Solutions" shutdown -r -t 0

But it doesn't help (it just prevents me from using the newly created Admin account).

Any ideas?, I am pulling my hair out!!!!!!



edit retag flag offensive close merge delete


Has there been any further progress on mitigating this issue?

sruzgar gravatar imagesruzgar ( 2018-07-30 18:02:50 +0300 )edit

2 answers

Sort by » oldest newest most voted

answered 2016-02-26 14:02:47 +0300

avladu gravatar image

updated 2017-09-26 17:06:48 +0300

Hello Daniel,

If possible, can you put in a pastebin the cloudbase-init and cloudbase-init-unattend logs, for further debugging this issue?

Edited: This is a known issue of Windows 10, which causes a SetComputerName function to run during the OOBE step, that changes the computer name to DESKTOP-<random string="">. As we run our cloudbase-init-unattend during specialize(which is before oobe), the hostname plugin execution becomes irrelevant.

A quick solution would be to change the cloudbase-init-unattend run in Unattend.xml from "specialize" step to "oobesystem" step -> [edited] . The downside with this approach is that the login screen appears, then the hostname reboot is executed(after of course, the time taken to find and consume a valid metadata service).

We are currently investigating the options to mitigate this issue and will be back with a fix on this(either the installer or cloudbase-init).


edit flag offensive delete link more


Hi, Thanks for this, I managed to work around this by removing the ,cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin plugin from cloudbase-init-unattend.conf and setting the cloudbase-init service to manual and using post-sysprep script to reset it to auto. I guess your workaround is best

dniasoff gravatar imagedniasoff ( 2016-02-29 19:13:30 +0300 )edit

noob so no vote karma, but I am in the same boat. Going to try the specialized to oobe, but I can see the instance name in the metadata json and the plugin call, but standard unattend rand name.

jrack gravatar imagejrack ( 2016-03-29 16:04:27 +0300 )edit

As a note rename has been successful for me since moving from specialized to oobe. Seems like a fine workaround for the moment.

jrack gravatar imagejrack ( 2016-04-07 21:11:10 +0300 )edit

Hi I have changed in Unattend.xml but after sysprep instance didn't start.

mav96 gravatar imagemav96 ( 2017-06-28 14:27:09 +0300 )edit

So i used next workaround - add in Customization Script when launch instance: $computerName = Get-WmiObject Win32_ComputerSystem $name = (New-Object System.Net.WebClient).DownloadString("") $computername.Rename($name)

mav96 gravatar imagemav96 ( 2017-06-28 14:28:40 +0300 )edit

answered 2016-02-26 16:34:15 +0300

dniasoff gravatar image

Here is the cloudbase-init logs

Here is the cloudbase-init-unattend logs

And here is the sysprep logs



edit flag offensive delete link more


Hi, you need to remove the execution of the SetHostnamePlugin from the cloudbase-init-unattend.conf, as presented in my response from above.

avladu gravatar imageavladu ( 2022-03-17 16:37:48 +0300 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2016-02-25 14:32:48 +0300

Seen: 3,312 times

Last updated: Sep 26 '17