New Question
0

Windows 10 Hostname not being set

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

dniasoff gravatar image

Hi,

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!!!!!!

Thanks

Daniel

edit retag flag offensive close merge delete

2 answers

Sort by » oldest newest most voted
0

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

avladu gravatar image

updated 2016-02-29 14:14:56 +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 -> http://pastebin.com/LNy0D0mC . 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).

Thanks.

edit flag offensive delete link more

Comments

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("http://169.254.169.254/latest/meta-data/hostname") $computername.Rename($name)

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

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

dniasoff gravatar image

Here is the cloudbase-init logs

http://paste.openstack.org/show/488373/

Here is the cloudbase-init-unattend logs

http://paste.openstack.org/show/488374/

And here is the sysprep logs

http://paste.openstack.org/show/488372/

Thanks

Daniel

edit flag offensive delete link more

Your Answer

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

Add Answer

[hide preview]

Question Tools

2 followers

Stats

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

Seen: 673 times

Last updated: Feb 29 '16