• Bare Metal Server

bms
  1. Help Center
  2. Bare Metal Server
  3. Private Image Creation Guide (BMS)
  4. Creating a Windows Image
  5. Installing Cloudbase-Init
  6. Windows Server 2012 and Windows Server 2016

Windows Server 2012 and Windows Server 2016

  1. Download Cloudbase-Init from https://cloudbase.it/cloudbase-init/#download.
  2. Upload the Cloudbase-Init installation package to the host and generate an ISO image.

    Upload the installation package to the host.

    [root@server nl]# ll
    total 4390172
    -rw-r--r--. 1 root root    41070592  Sep 26 07:33 CloudbaseInitSetup_0_9_11_x64.msi
    -rw-r--r--. 1 qemu qemu  4413020160  Sep 26 02:36 cn_windows_server_2012_r2_x64_dvd_2707961.iso

    Run the following command in the directory where the installation package is stored:

    mkisofs -L -R -J -T -V system-sp2 -o software.iso CloudbaseInitSetup_0_9_11_x64.msi

  3. Mount the generated ISO image to the VM and install Cloudbase-Init.
    1. On virt-manager, choose View > Details.
    2. In the navigation pane on the left, choose IDE CDROM 1 and click Disconnect in the right pane.
    3. Click Connect.
    4. Select a local ISO file and click Open in the upper right corner.

    5. Check the information and click Apply.

  4. Install Cloudbase-Init.

    The following shows the default installation path of Cloudbase-Init.

    C:\Program Files\Cloudbase Solutions\Cloudbase-Init

  5. Edit the Cloudbase-Init configuration file in the C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf directory as follows:
    1. Create user administrator and add it to a group. Modify the following parameters:
      username=Administrator
      groups=Administrators
    2. Configure hostname and modify the following parameter (if it does not exist, add it):
      netbios_host_name_compatibility=false
    3. Locate and modify logging_serial_port_settings as follows:
      logging_serial_port_settings=COM1,115200,N,8
    4. Add parameter metadata_services and configure the loaded services as follows:
      metadata_services=cloudbaseinit.metadata.services.httpservice.HttpService,cloudbaseinit.metadata.services.configdrive.ConfigDriveService
    5. Add parameter plugins and configure the modules to be loaded. Separate different modules with commas (,). The information in bold is the keyword of each module.
      The following is an example of the Cloudbase-Init file content:
      plugins=cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin,cloudbaseinit.plugins.common.mtu.MTUPlugin,cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin,cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,cloudbaseinit.plugins.common.userdata.UserDataPlugin,cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin,cloudbaseinit.plugins.windows.winrmcertificateauth.ConfigWinRMCertificateAuthPlugin,cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin

      Functions of the modules are as follows:

      • LocalScriptsPlugin: sets the scripts.
      • MTUPlugin: sets the MTU network ports.
      • CreateUserPlugin: creates a user.
      • SetUserPasswordPlugin: sets the password.
      • SetUserSSHPublicKeysPlugin: sets the private key.
      • SetHostNamePlugin: sets the hostname.
      • ExtendVolumesPlugin: partitions the disks.
      • UserDataPlugin: injects user data.
      • ConfigWinRMListenerPlugin: sets listening to remote login.
      • ConfigWinRMCertificateAuthPlugin: sets remote login without the password authentication.
      • WindowsLicensingPlugin: activates window instances.