Overview
Cloudbase-Init is a tool installed in the Windows operating system. It enables users to automatically configure and initialize Windows virtual machines in cloud environments. In cloud environments, users need to quickly create and deploy virtual machines. Cloudbase-Init can help users automatically complete some initialization work when creating virtual machines, such as configuring networks, installing software, and executing scripts.
This document takes Windows Server 2022 64-bit operating system as an example to guide you to install Cloudbase-Init on the Windows operating system.
Prepare Software
To install Cloudbase-Init, you need to prepare the following software:
| Name of Software | Access Path | Note |
|---|---|---|
| CloudbaseInitSetup_X_X_XX_xXX.msi | Download the corresponding Cloudbase-Init installation package according to the actual bits of operating systems used: Stable version: (recommended) Windows 64-bit Operating System Windows 32-bit Operating System Beta version For more details, see Cloudbase-Init Official Website. |
Used to install Cloudbase-Init. |
| XXXCloudRun.ps1 | Used to modify the cloudbase-init configuration file | |
| localscripts.py | Used to ensure that Cloudbase-Init can start normally. |
Directions
Install Cloudbase-Init
Download the CloudbaseInitSetup_X_X_XX_xXX.msi software to your server. On the operating system interface, double-click to open the Cloudbase-Init installation package.
In the pop-up security warning dialog box, click to run and enter the Cloudbase-Init installation interface.

Click Next.
Check I accept the terms in the License Agreement, and then click Next twice.
On the Configuration options interface, set Serial port for logging to COM1 (if this option is not available, it can be ignored). Check Run Cloudbase-Init service as LocalSystem and click Next.

Click Install to install Cloudbase-Init.
After Cloudbase-Init is installed, click Finish to close the Cloudbase-Init installation interface.
Notes:
When closing the Cloudbase-Init installation interface, do not select any checkbox and do not run Sysprep.

Modify Cloudbase-Init Configuration File
- Open the cloudbase-init.conf configuration file. The default path of the cloudbase-init.conf configuration file is: C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf
- Replace the cloudbase-init.conf configuration file with the following content:
[DEFAULT]
username=Administrator
groups=Administrators
inject_user_password=true
config_drive_raw_hhd=true
config_drive_cdrom=true
config_drive_vfat=true
bsdtar_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\bsdtar.exe
mtools_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\bin\
san_policy=OnlineAll
metadata_services=cloudbaseinit.metadata.services.configdrive.ConfigDriveService,cloudbaseinit.metadata.services.ec2service.EC2Service
#,cloudbaseinit.metadata.services.httpservice.HttpService
#,cloudbaseinit.metadata.services.maasservice.MaaSHttpService
metadata_base_url=http://169.254.0.23/
ec2_metadata_base_url=http://169.254.0.23/
retry_count=2
retry_count_interval=5
plugins=cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin,cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin,cloudbaseinit.plugins.common.userdata.UserDataPlugin
verbose=true
debug=true
logdir=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\log\
logfile=cloudbase-init.log
default_log_levels=comtypes=INFO,suds=INFO,iso8601=WARN,requests=WARN
#logging_serial_port_settings=COM1,115200,N,8
mtu_use_dhcp_config=true
ntp_use_dhcp_config=true
first_logon_behaviour=no
netbios_host_name_compatibility=false
allow_reboot=true
activate_windows=true
kms_host="kms.convergecloud.com"
local_scripts_path=C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts\
C:\powershell
PS C:\Set-ExecutionPolicy Unrestricted
volumes_to_extend=1,2,3
Download the XXXCloudRun.ps1 script and copy the XXXCloudRun.ps1 script to the C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts path.
3. Right-click the XXXCloudRun.ps1 script, select attributes, and check in the popup window whether the script has executable permission.
If there is an Unblock option, select it and click OK to exit.
If there is no Unblock option, skip this step.
4. Replace the localscripts.py file in the path C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\plugins\common with the localscripts.py file in the prepared software.


