LogoLogo
Web HomeTutorialsPortal
  • Bamboozle Wiki and Documents
  • Products
    • Cloud
      • Compute
        • Managing Virtual Machines
          • Supported guest operating systems
          • Creating virtual machines
          • Connecting to virtual machines
          • Managing virtual machine power state
          • Attaching ISO images to virtual machines
          • Reconfiguring virtual machines
            • Changing virtual machine resources
            • Configuring network interfaces of virtual machines
            • Configuring virtual machine volumes
          • Monitoring virtual machines
          • Shelving virtual machines
          • Rescuing virtual machines
          • Managing guest tools
            • Installing guest tools
            • Uninstalling guest tools
          • Troubleshooting virtual machines
          • Deleting virtual machines
          • Managing SSH keys
        • Managing security groups
          • Creating and deleting security groups
          • Managing security group rules
          • Changing security group assignment
        • Managing images
          • Uploading images
          • Creating volumes from images
          • Preparing templates
            • Preparing Linux templates
            • Preparing Windows templates
            • Enabling logging for virtual machines
        • Managing volumes
          • Creating and deleting volumes
          • Attaching and detaching volumes
          • Resizing volumes
          • Creating images from volumes
          • Cloning volumes
          • Managing volume snapshots
        • Managing virtual networks
        • Managing VPN connections
          • Creating VPN connections
          • Editing VPN connections
          • Restarting and deleting VPN connections
        • Managing virtual routers
          • Managing router interfaces
          • Managing static routes
      • Managed Kubernetes
        • Creating and deleting Kubernetes clusters
      • Object Storage
        • Instances
        • How-to
          • Access Storage with S3 SDKs
          • Access Object Storage with Cyberduck
          • Access Storage with Mountainduck
        • Addtional Ressources
          • Supported Amazon S3 features
    • Servers
      • Cloud Servers
      • Dedicated Servers
    • Cyber Protect
      • Welcome to Cyber Protect
      • Supported features by OS
      • Activating the account
        • Password requirements
        • Two-factor authentication
      • Accessing the Cyber Protect service
      • The Cyber Protect console
      • Installing the software
        • Which agent do I need?
        • System requirements for agents
        • Preparation
        • Linux packages
        • Proxy server settings
        • Installing the Protection Agents
          • Downloading protection agents
          • Installing protection agents in Windows
          • Installing protection agents in Linux
          • Installing protection agents in macOS
          • Granting the required system permissions to the Connect Agent
          • Changing the logon account on Windows machines
          • Dynamic installation and uninstallation of components
    • Business Email
      • Getting started
        • DNS Records
        • Setting up a Mail Client with IMAP
        • Setting up your Mailbox with macOS, iOS, ipadOS and Android Devices
        • Configure Microsoft Outlook for Business Email
        • Zimbra Connector for Microsoft Outlook User Guide
      • Web Mail Client
        • Webmail Login
        • Mail
          • Left Sidebar
          • Email Pane
          • Reading Pane
          • Keyboard Shortcuts
      • Zimbra Modern Desktop
    • Web Hosting
      • Linux Web Hosting
        • cPanel Overview
          • Getting Started in cPanel
          • Server Information for cPanel
        • Preferences
          • Account Preferences
          • Audit Log
          • Change Language
          • Contact Information
      • Windows Web Hosting
    • SSL Certificates
      • SSL Intermediate and ROOT CA Bundles
        • RapidSSL CA Bundle
  • Tutorials
    • Rocky Linux
      • Rocky Linux 9
        • Basic Server Setup with Rocky Linux 9
  • Billing
    • Payment Methods
    • Credit Card Refunds
  • Legal
    • Legal Documents
      • Terms & Conditions
      • Master Agreement for Datacenter IP Services
      • Privacy
      • Service Level Agreement (SLA)
        • Public & Private Cloud
        • IP Transit Service Level Agreement
      • GDPR
        • FAQ
        • Data Processing Agreement
          • Schedule 1: Description of the Processing and Subprocessors
          • Schedule 2: Controller-to-Controller Information for International Data Transfers
      • Supplier Code of Conduct
  • Security
    • Platform Security
    • Infrastructure Security
    • Certification Reports
  • Pricing
    • Overview
    • Cloud
      • Compute
      • Volumes & Snapshots
      • Load Balancers
      • VPN
      • Elastic IPs
      • Traffic
    • Billing Q&A
      • Colocation - 95th percentile billing
  • Other Technical Information
    • Peering
Powered by GitBook
LogoLogo

Copyright © 2024 Bamboozle Web Services, Inc. All Rights Reserved.

On this page

Was this helpful?

Export as PDF
  1. Products
  2. Cloud
  3. Compute
  4. Managing images
  5. Preparing templates

Preparing Windows templates

PreviousPreparing Linux templatesNextEnabling logging for virtual machines

Last updated 2 years ago

Was this helpful?

Windows guests have neither Cloudbase-Init nor OpenSSH Server preinstalled by default. You need to install and configure them manually.

To install Cloudbase-Init and OpenSSH Server inside a Windows virtual machine

  1. Log in to a Windows VM.

  2. Create a new administrator account that will be used for SSH connections and log in with it.

  3. To install and configure OpenSSH Server:

    1. Run Windows PowerShell with administrator privileges and set the execution policy to unrestricted to be able to run scripts:

      > Set-ExecutionPolicy Unrestricted
    2. Download OpenSSH Server (for example, from the ), extract the archive into the C:\Program Files directory, and then install it by running:

      > & 'C:\Program Files\OpenSSH-Win64\install-sshd.ps1'
    3. Start the sshd service and set its startup type to “Automatic”:

      > net start sshd
      > Set-Service sshd -StartupType Automatic
    4. Open TCP port 22 for the OpenSSH service in the Windows Firewall:

      • On Windows 8.1, Windows Server 2012, and newer versions, run:

        > New-NetFirewallRule -Protocol TCP -LocalPort 22 -Direction Inbound -Action Allow -DisplayName OpenSSH
      • On Windows Server 2008/2008 R2, run:

        > netsh advfirewall firewall add rule name=sshd dir=in action=allow protocol=TCP localport=22
    5. Open the C:\ProgramData\ssh\sshd_config file:

      > notepad 'C:\ProgramData\ssh\sshd_config'

      Comment out the following lines at the end of the file:

      #Match Group administrators
      #AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys

      Save the changes.

    6. Create the .ssh directory in C:\Users\<current_user> and an empty authorized_keys file inside it:

      > cd C:\Users\<current_user>
      > mkdir .ssh
      > notepad .\.ssh\authorized_keys

      Remove the .txt extension from the created file:

      > move .\.ssh\authorized_keys.txt .\.ssh\authorized_keys
    7. Modify the permissions for the created file to disable inheritance:

      > icacls .\.ssh\authorized_keys /inheritance:r
  4. Download Cloudbase-Init from , and then install it by following the procedure from the Installation section at .

    1. The password for the user specified during the Cloudbase-Init installation will be reset on the next VM startup. If this user does not exist, a new user account will be created. You will be able to log in with this account by using the key authentication method or you can set a new password with a customization script. If there are multiple Windows users at the image preparation time, the passwords for other users will not be changed.

    2. When the Cloudbase-Init installation is complete, do not select the option to run Sysprep before clicking Finish. Otherwise, you will not be able to modify cloudbase-init.conf.

  5. Run Windows PowerShell with administrator privileges and open the file C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf:

    > notepad 'C:\Program Files\Cloudbase Solutions\Cloudbase-Init\conf\cloudbase-init.conf'

    Add metadata_services and plugins on two lines:

    metadata_services=\
    cloudbaseinit.metadata.services.configdrive.ConfigDriveService,\
    cloudbaseinit.metadata.services.httpservice.HttpService
    plugins=cloudbaseinit.plugins.common.mtu.MTUPlugin,\
    cloudbaseinit.plugins.windows.ntpclient.NTPClientPlugin,\
    cloudbaseinit.plugins.common.sethostname.SetHostNamePlugin,\
    cloudbaseinit.plugins.windows.createuser.CreateUserPlugin,\
    cloudbaseinit.plugins.common.networkconfig.NetworkConfigPlugin,\
    cloudbaseinit.plugins.windows.licensing.WindowsLicensingPlugin,\
    cloudbaseinit.plugins.common.sshpublickeys.SetUserSSHPublicKeysPlugin,\
    cloudbaseinit.plugins.windows.extendvolumes.ExtendVolumesPlugin,\
    cloudbaseinit.plugins.common.setuserpassword.SetUserPasswordPlugin,\
    cloudbaseinit.plugins.common.userdata.UserDataPlugin,\
    cloudbaseinit.plugins.windows.winrmlistener.ConfigWinRMListenerPlugin,\
    cloudbaseinit.plugins.windows.winrmcertificateauth.\
    ConfigWinRMCertificateAuthPlugin,\
    cloudbaseinit.plugins.common.localscripts.LocalScriptsPlugin

    Make sure to remove all backslashes in the lines above.

    Save the changes.

GitHub repository
https://cloudbase.it/cloudbase-init/#download
https://cloudbase.it/cloudbase-init/