Deploying Windows Server in Yandex.Cloud

Published 13.06.2025

Today, we’ll dive into the world of cloud technologies and learn how to deploy the Windows Server operating system on the Yandex.Cloud platform. This is an excellent opportunity for anyone looking to have their own server for various tasks, whether it’s for application testing, website deployment, or even Active Directory creation.


Important Note: Your Own Windows Server Image

Currently, Yandex.Cloud does not provide pre-built Windows Server images. This means we’ll need to prepare a Windows Server image locally, import it into Yandex.Cloud, and then create a virtual machine based on that image. This process requires a bit more effort but gives you full control over your system.

Let’s get started!


What We’ll Need

  1. Yandex.Cloud Account: If you don’t have one yet, register on the official Yandex.Cloud website. You might need to link a bank card to activate your account, but Yandex.Cloud offers a generous free trial period for exploration.
  2. Access to Yandex.Cloud Management Console: Via a web browser.
  3. Local PC with Virtualization Software Installed: Oracle VirtualBox or VMware Workstation/Player is recommended.
  4. Windows Server ISO Image: You should have your own Windows Server license. Important: Microsoft offers evaluation versions of Windows Server that come with a 180-day trial period. This period can be rearmed up to 5 times using the slmgr.vbs /rearm command, providing up to 3 years of use for testing and development.
  5. Internet Connection.
  6. s3cmd Installed and Configured (or another S3-compatible command-line client like aws cli) on your local PC for uploading large files.

Part 1: Preparing the Windows Server Image in VirtualBox (or another VM)

This section is the most labor-intensive but crucially important.

Step 1: Install Windows Server in VirtualBox

  1. Create a new virtual machine in VirtualBox:
    • Type: Microsoft Windows
    • Version: Select the appropriate Windows Server version (e.g., “Windows 2019 (64-bit)”).
    • Memory: 4096 MB (4 GB) RAM is recommended.
    • Hard Disk: Choose “Create a new virtual hard disk”. The recommended disk size is at least 50 GB (80-100 GB is better for comfortable operation). Important: Select VMDK or VHD as the disk file type, as these formats are easier to import into Yandex.Cloud. A dynamically expanding disk will also work, but the actual data size will be important for import.
  2. Configure the VM:
    • In the VM settings, under “System” -> “Processor,” allocate at least 2 cores.
    • Under “Storage,” connect your Windows Server ISO image to the virtual CD/DVD drive.
  3. Start the VM and Install Windows Server:
    • Perform a standard Windows Server installation. Choose the Datacenter (GUI) version for convenience.
    • Create an administrator user and set a strong password.

Step 2: Basic Windows Server Configuration and Cloudbase-Init Installation

After installing Windows Server, you need to perform several important configurations.

  1. Perform basic updates: Open “Windows Update” and install all available updates. Restart the server.
  2. Disable Internet Explorer Enhanced Security Configuration: This will make it easier to download files. Open “Server Manager” -> “Local Server” and find “IE Enhanced Security Configuration” – disable it for administrators.
  3. Enable Remote Desktop (RDP) access: Without this, you won’t be able to connect to the server after deploying it in the cloud.
    • Open “Server Manager” -> “Local Server”.
    • Find the “Remote Desktop” parameter and click on it.
    • Select “Allow remote connections to this computer”.
    • If a firewall warning appears, confirm the exceptions for RDP.
    • Important: The built-in Windows Firewall must be configured to allow incoming connections on port 3389 (RDP). This rule is usually created automatically when Remote Desktop is enabled.
  4. Install Cloudbase-Init (Mandatory!): Cloudbase-Init is the equivalent of cloud-init for Linux, which allows Yandex.Cloud to configure your VM on first boot (setting password, network settings, etc.).
    • Open a browser on your VM and go to the Cloudbase-Init website: https://cloudbase.it/cloudbase-init/.
    • Download the latest stable installer (.msi).
    • Run the Cloudbase-Init installer.
      • In the “Configuration options” step, ensure “OpenSSH” and “EC2Config” (or “OVF”) are selected.
      • In the “Serial port for logging” field, select “COM1”.
      • Very Important: At the end of the installation, when prompted to “Run Sysprep to generalize the system,” uncheck this option. We’ll need to run Sysprep manually with the correct parameters.
      • Click “Finish”.
  5. Install VirtualBox Guest Additions drivers (for VirtualBox): This will improve VM performance and interaction. Go to “Devices” -> “Insert Guest Additions CD image…”. Install them and restart the VM.
  6. Prepare network settings: Ensure the network adapter is configured to obtain an IP address via DHCP. Yandex.Cloud will assign the IP address automatically.

Step 3: Prepare the Image with Sysprep

Sysprep “generalizes” the operating system, removing unique identifiers and preparing it for cloning.

  1. Open Command Prompt (cmd) as administrator.
  2. Navigate to the Sysprep directory: cd C:\Windows\System32\Sysprep\
  3. Execute the command:
    sysprep.exe /generalize /oobe /shutdown
    
    • /generalize: Prepares the system for image creation.
    • /oobe: The system will be in “Out-Of-Box Experience” mode on the next boot (initial setup).
    • /shutdown: The VM will shut down after Sysprep completes.

After running the command, the VM will shut down. Do not start this VM in VirtualBox again! It’s now ready for export.

Step 4: Export the VM Image to VMDK or VHD Format

  1. Open VirtualBox.
  2. Select your Windows Server VM.
  3. Go to “File” -> “Export Appliance…” (or “File” -> “Export configurations to Appliance…”).
  4. Select your VM and click “Continue”.
  5. For the format, choose “Open Virtualization Format 0.9” (OVF) or “Open Virtualization Format 1.0” (OVF). VirtualBox will actually pack the VMDK/VHD inside the OVF, which Yandex.Cloud understands.
  6. Specify the path to save the .ova file (this is an archive containing the .vmdk or .vhd).
  7. Click “Export”.

Result: You’ll have an .ova file, which contains your Windows Server image in VMDK or VHD format. If you saved it as a .vmdk file directly, that file will also work.


Part 2: Importing the Image into Yandex.Cloud

Now that the image is ready, it’s time to upload it to the cloud.

Step 1: Upload the Image to Yandex.Cloud Object Storage (S3)

Yandex.Cloud requires the image to be in Yandex Object Storage (an S3-compatible storage) before it can be imported. Due to the large size of image files, it is strongly recommended to use command-line tools like s3cmd, rather than the web interface.

  1. Configure s3cmd: If you don’t have it yet, install s3cmd and configure it to work with Yandex.Cloud Object Storage. You’ll need access_key and secret_key for a service account with write permissions to the S3 bucket.
    • Detailed instructions for configuring s3cmd for Yandex.Cloud can be found in the official Yandex.Cloud documentation (search for “s3cmd Yandex.Cloud”).
  2. Log in to the Yandex.Cloud management console.
  3. In the left menu, select the “Object Storage” section.
  4. Create a new bucket. Give it a unique name (e.g., my-windows-images). Choose a regional bucket type.
  5. Upload the image using s3cmd:
    • Open a terminal (command prompt) on your local PC.
    • Execute the command to upload the image:
      s3cmd put /path/to/your/image/your_image.vmdk s3://my-windows-images/your_image.vmdk
      
      Replace /path/to/your/image/your_image.vmdk with the full path to your .vmdk (or .vhd) file, and my-windows-images with your bucket name.
    • Wait for the upload to complete. This can take a significant amount of time depending on the image size and your internet speed.

Step 2: Create a Custom Compute Cloud Image

  1. Go back to the “Compute Cloud” (Virtual machines) section in the left menu.
  2. In the left submenu, select “Images”.
  3. Click the “Create image” button.
  4. Image Name: Give the image a clear name, for example, windows-server-2019-custom.
  5. Source: Select “From Object Storage”.
  6. Bucket: Select the bucket where you uploaded the image (e.g., my-windows-images).
  7. Object: Select your uploaded .vmdk or .vhd file.
  8. Operating System: Select “Windows”.
  9. Click “Create image”.

The image import process can take anywhere from a few minutes to an hour, depending on the image size. Monitor the import status on the “Images” page.


Part 3: Creating a Virtual Machine from the Imported Image

Once the image has been successfully imported, you can create a VM.

Step 1: Create a New Virtual Machine (VM)

  1. In the “Compute Cloud” (Virtual machines) section, click the “Create VM” button.

Step 2: Configure Basic VM Parameters

  1. VM Name: Give your virtual machine a clear name, for example, my-custom-windows-server.
  2. Availability Zone: Choose an availability zone.
  3. Boot Image:
    • In the “Select image/boot disk” section, choose the “My images” tab.
    • Find and select your imported image (e.g., windows-server-2019-custom).

Step 3: Configure Disks

  1. Boot Disk: By default, the disk size corresponding to your imported image will be suggested. You can increase it if necessary. Using SSD disks is recommended.
  2. Add Additional Disk (optional): If needed.

Step 4: Configure Compute Resources

  1. Processor (vCPU) and Memory (RAM): Select resources according to your needs. For Windows Server, 2 vCPU and 4 GB RAM are recommended as a starting point.

Step 5: Configure Network

  1. Network and Subnet: Select an existing cloud network and subnet.
  2. Public IP Address: Be sure to select “Automatic” or “Create” so your VM is accessible from the internet. Without a public IP, you won’t be able to connect via RDP.
  3. Security Groups (optional): Configure security groups to allow incoming RDP connections (port 3389).

Step 6: Configure VM Access (Windows)

Since you used Cloudbase-Init, Yandex.Cloud will be able to apply access settings on the first boot.

  1. Username: Specify the username you want to use to log into Windows Server. For example, yandex-admin.
  2. Password: Enter and confirm a strong password for this user. This password will be set by Cloudbase-Init on the VM’s first boot.
  3. Allow access via Serial Console (optional): Not strictly necessary for Windows.

Step 7: Create the VM

  1. Carefully review all settings.
  2. Click the “Create VM” button.

Yandex.Cloud will begin the process of creating your virtual machine. This may take a few minutes. You’ll see the VM status change from “Starting” to “Running”.

Step 8: Connect to Windows Server via RDP (Remote Desktop)

  1. Once the VM status changes to “Running”, copy the public IP address of your virtual machine. You can find it on the VM’s information page.
  2. Open the “Remote Desktop Connection” application on your computer (type “mstsc” in Windows search or find it in the “Accessories” menu).
  3. In the “Computer” field, paste the copied IP address.
  4. Click “Connect”.
  5. In the credentials prompt window, enter:
    • Username: The username you specified when creating the VM (e.g., yandex-admin).
    • Password: The password you created in Step 6.
  6. You might receive a security certificate warning. Click “Yes” or “Continue”.

Congratulations! You have successfully connected to your new Windows Server in Yandex.Cloud. Now you can install programs, configure roles, and do everything you need.


Important Considerations and Recommendations

  • Windows Server Trial Period: Remember the 180-day evaluation period for Windows Server, which can be extended using the slmgr.vbs /rearm command up to 5 times, providing up to 3 years of use for testing and development.
  • Security: Immediately after connecting, configure Windows Firewall if necessary. Don’t leave unnecessary ports open.
  • Updates: Ensure your Windows Server is regularly updated.
  • Snapshots: Before making major system changes, it’s recommended to take snapshots of the VM disks. This will allow you to quickly revert in case of issues.
  • Monitoring: Yandex.Cloud provides monitoring tools. Track CPU, memory, and disk usage.
  • Stopping the VM: If you don’t plan to use the server constantly, consider stopping it to avoid paying for compute resources. You will always be charged for disk space.

I hope this detailed guide helped you understand the process of deploying Windows Server in Yandex.Cloud by importing your own image. This is a more complex path, but it gives you full control over your server infrastructure.

If you have any questions, feel free to ask in the comments!

Get in Touch

Ready to discuss your project and offer the best solution