Help & Documentation>Cloud Virtual Machine

Installing Cloudbase-Init on Windows

Last updated: 2024-06-26 15:27:11

Scenario

This document describes how to install Cloudbase-Init on the Windows Server 2012 R2 64-bit operating system.

Required Software

The following table describes the software required for installing Cloudbase-Init.
Software Name
Access Path
Note
CloudbaseInitSetup_X_X_XX_xXX.msi
Please download the appropriate Cloudbase-Init installation package according to the actual operating system bit version you are using:
Stable Version: It is recommended to use this installation package.
Windows 64-bit Operating System: Click here to obtain
Windows 32-bit Operating System: Obtain here
Beta version
For more information, please visit the Cloudbase-Init official website.
Used for installing Cloudbase-Init.
TencentCloudRun.ps1
-
localscripts.py
This software ensures that Cloudbase-Init can start properly.

Instructions

Installing Cloudbase-Init

1. On the desktop, double-click the Cloudbase-Init installation package.
2. In the dialog box, click Run to enter the Cloudbase-Init setup wizard, as shown below:

3. Click Next.
4. Select I accept the terms in the License Agreement and click Next twice.
5. In the Configuration options window, set Serial port for logging to COM1, check "Run Cloudbase-Init service as LocalSystem," and click Next. As shown below:

6. Click Install to install Cloudbase-Init.
7. After Cloudbase-Init installation is complete, click Finish to close the setup wizard, as shown below:
Note
When closing the Cloudbase-Init installation interface, do not select any checkboxes and avoid running Sysprep.




Modifying the Cloudbase-Init configuration file

1. Open the cloudbase-init.conf configuration file. The default path for the cloudbase-init.conf configuration file is: C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf
2. Replace the content of the cloudbase-init.conf configuration file with the following:
[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.tencentyun.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. Copy the TencentCloudRun.ps1 script to the C:\Program Files\Cloudbase Solutions\Cloudbase-Init\LocalScripts directory.
4. Right-click the TencentCloudRun.ps1 script, select Properties, and check if the script has executable permissions in the pop-up window, as shown below:

If the Unblock option is present, select it and click OK to exit.
If the Unblock option is not present, skip this step.
5. Replace the localscripts.py file in the C:\Program Files\Cloudbase Solutions\Cloudbase-Init\Python\Lib\site-packages\cloudbaseinit\plugins\common directory with the localscripts.py file from the Required Software section.