New Question

RunOnce Registry Keys with cloudbase-init

asked 2020-12-01 11:39:59 +0300

dngady gravatar image

Hi Cloudbase,

I've to ideas for my environment Win2k12r2, Win2k16, and also Win2k19 where that Win2kxx I want to deploy an image on Openstack (RHOSP13) for the public image to the customers which when someone Launch a windows instance as automatically connect to licenses with our KMS Hosts. That is what I'm expected.

So, I already create and save a script with bat file automatically running and just once running when first starting up windows from this ref: . After that, I want these windows to want send as an image at Openstack so I install Cloudbase-init. Next, after installed automatically Cloudbase-init sent a shutdown, and after I run these windows again, my script on Regedit has gone and my purpose with that script is not running. I think maybe my script from Regedit has gone because of cloudbase-init.

We need your advice about my expectation, Thank you very much.

Regards, BSC

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted

answered 2020-12-07 14:21:46 +0300

avladu gravatar image


Cloudbase-Init does not remove any scripts from the image. The runonce scripts have been deleted by sysprep.

Sysprep's whole idea is to clean / generalize the image so that it can be used to create multiple instances from that image.

One way to achieve this is to use LocalScriptsPlugin and let cloudbase-init run that script. Make sure you make that script idempotent:

Another way is to change the sysprep Unattend.xml that cloudbase-init already has, add those runonce scripts in the unattend.xml and perform the sysprep manually. To automate this, you can use the Windows Imaging Tools and set the Unattend.xml template of your choice: .

Make sure you leave the cloudbase-init run command there and put your run command before it: .

Thank you,
Adrian Vladu

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

Question Tools


Asked: 2020-12-01 11:39:59 +0300

Seen: 1,209 times

Last updated: Dec 07 '20