Complete Guide to Running Windows Server on Linux with KVM

Home / Blog / Complete Guide to Running Windows Server on Linux with KVM

Complete Guide to Running Windows Server on Linux with KVM

Posted:  July 31, 2025

Complete Guide to Running Windows Server on Linux with KVM

Introduction to KVM Virtualization for Windows Workloads

For system administrators and developers who need to run Windows Server alongside Linux infrastructure, KVM (Kernel-based Virtual Machine) offers a robust, high-performance virtualization solution. As a Type-1 hypervisor built directly into the Linux kernel, KVM provides near-native performance for virtualized Windows environments while leveraging Linux’s stability and security.

This comprehensive guide will walk you through setting up a production-ready Windows Server virtual machine using KVM, covering everything from initial hardware checks to advanced networking configurations.

Why Choose KVM for Windows Virtualization?

Performance Advantages

  • Direct hardware access through kernel integration
  • Support for CPU virtualization extensions (Intel VT-x, AMD-V)
  • Minimal overhead compared to Type-2 hypervisors
  • Ability to assign physical PCIe devices via passthrough

Enterprise-Grade Features

  • Live migration capabilities
  • Fine-grained resource allocation
  • Integrated storage management
  • Support for Windows virtio drivers

Cost Efficiency

  • No licensing fees (unlike VMware ESXi)
  • Included with most Linux distributions
  • Lower resource overhead reduces hardware requirements

System Requirements

Hardware Prerequisites

  • 64-bit x86 processor with virtualization extensions
  • Minimum 8GB RAM (16GB+ recommended for production)
  • 50GB+ available storage (SSD strongly recommended)
  • BIOS/UEFI virtualization enabled (VT-x/AMD-V)

Software Requirements

  • Modern Linux distribution (Ubuntu 20.04+, RHEL 8+, etc.)
  • Windows Server installation media (ISO)
  • Administrative access (sudo privileges)

Installation and Configuration

1. Verifying Virtualization Support

Before proceeding, confirm your system supports hardware virtualization:

grep -E --color '(vmx|svm)' /proc/cpuinfo

A non-zero output indicates supported hardware. Next, verify KVM modules are available:

lsmod | grep kvm

2. Installing KVM Packages

For Debian/Ubuntu Systems:

sudo apt update
sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients \
virt-manager bridge-utils ovmf

For RHEL/CentOS Systems:

sudo dnf install -y qemu-kvm libvirt virt-install virt-viewer \
virt-manager libguestfs-tools

Enable and start the libvirt service:

sudo systemctl enable --now libvirtd

3. Configuring User Permissions

Add your user to the necessary groups:

sudo usermod -aG libvirt $(whoami)
sudo usermod -aG kvm $(whoami)

Log out and back in for changes to take effect.

Creating a Windows Server Virtual Machine

1. Preparing Storage

Create a storage pool for your VMs:

sudo virsh pool-define-as --name default --type dir --target /var/lib/libvirt/images
sudo virsh pool-start default
sudo virsh pool-autostart default

2. Launching Virt-Manager

Start the graphical interface:

virt-manager

3. Creating a New VM

  1. Click “Create a new virtual machine”
  2. Select “Local install media” and browse to your Windows Server ISO
  3. Allocate RAM (minimum 4096MB for Server Standard)
  4. Create a virtual disk (minimum 40GB, qcow2 format recommended)
  5. Under “Customize configuration before install,” ensure:
  • Chipset: Q35
  • Firmware: UEFI
  • CPU model: host-passthrough
  • Add virtio disk driver

4. Installing Windows Server

  1. Start the VM and proceed with Windows installation
  2. When prompted for storage, load the virtio drivers from:
  • virtio-win.iso (available from Fedora repositories)
  1. Complete the installation normally

Optimizing Windows Performance

1. Installing Virtio Drivers

Mount the virtio ISO and install:

  • Balloon driver
  • Network driver
  • Storage driver
  • QEMU guest agent

2. CPU Pinning

For performance-critical workloads, pin vCPUs to physical cores:

virsh vcpupin   

3. Memory Allocation

Enable memory ballooning for dynamic allocation:

8388608
4194304

Networking Configuration

Bridged Networking Setup

Edit your network configuration:

sudo nano /etc/netplan/01-netcfg.yaml

Example configuration:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: no
  bridges:
    br0:
      interfaces: [enp3s0]
      dhcp4: yes
      parameters:
        stp: false
        forward-delay: 0

Apply changes:

sudo netplan apply

Assigning the Bridge to Your VM

In virt-manager:

  1. Select the VM and open hardware details
  2. Remove the default NAT network
  3. Add new hardware → Network → Bridge to br0

Advanced Features

PCIe Passthrough

  1. Identify your device:
lspci -nnk
  1. Unbind from host driver:
echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind
  1. Add to VM configuration:
<hostdev mode='subsystem' type='pci' managed='yes'>
  <source>
    <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
  </source>
</hostdev>

Snapshot Management

Create snapshots:

virsh snapshot-create-as --domain win-server --name pre-update

Restore snapshots:

virsh snapshot-revert win-server pre-update

Maintenance and Monitoring

Key Commands

  • List running VMs: virsh list
  • Start VM: virsh start win-server
  • Graceful shutdown: virsh shutdown win-server
  • Force stop: virsh destroy win-server

Performance Monitoring

virsh domstats win-server
virt-top

Conclusion

KVM provides an enterprise-grade virtualization platform for running Windows Server workloads on Linux infrastructure. By following this guide, you’ve established a high-performance virtualized environment that combines Windows Server’s compatibility with Linux’s stability and efficiency.

For production environments, consider additional optimizations like:

  • NUMA node pinning
  • Storage pools on ZFS or LVM
  • Regular backup routines
  • SELinux/AppArmor hardening

The flexibility of KVM allows for everything from simple test environments to complex, high-availability Windows Server deployments — all while maintaining the reliability and cost-effectiveness of Linux as the host platform.

Like This Article? Share It!

Kevin Pirnie

Over two decades of expertise in PC, server maintenance, and web development—specializing in WordPress. From managed hosting to high-performance WordPress development, I treat every site and server as if it were my own. With a strong emphasis on security, speed, and reliability, I ensure everything is meticulously updated, optimized, and running at its best.

Cookie Notice

This site utilizes cookies to improve your browsing experience, analyze the type of traffic we receive, and serve up proper content for you. If you wish to continue browsing, you must agree to allow us to set these cookies. If not, please visit another website.

Complete Guide to Running Windows Server on Linux with KVM

Introduction to KVM Virtualization for Windows Workloads

For system administrators and developers who need to run Windows Server alongside Linux infrastructure, KVM (Kernel-based Virtual Machine) offers a robust, high-performance virtualization solution. As a Type-1 hypervisor built directly into the Linux kernel, KVM provides near-native performance for virtualized Windows environments while leveraging Linux’s stability and security.

This comprehensive guide will walk you through setting up a production-ready Windows Server virtual machine using KVM, covering everything from initial hardware checks to advanced networking configurations.

Why Choose KVM for Windows Virtualization?

Performance Advantages

  • Direct hardware access through kernel integration
  • Support for CPU virtualization extensions (Intel VT-x, AMD-V)
  • Minimal overhead compared to Type-2 hypervisors
  • Ability to assign physical PCIe devices via passthrough

Enterprise-Grade Features

  • Live migration capabilities
  • Fine-grained resource allocation
  • Integrated storage management
  • Support for Windows virtio drivers

Cost Efficiency

  • No licensing fees (unlike VMware ESXi)
  • Included with most Linux distributions
  • Lower resource overhead reduces hardware requirements

System Requirements

Hardware Prerequisites

  • 64-bit x86 processor with virtualization extensions
  • Minimum 8GB RAM (16GB+ recommended for production)
  • 50GB+ available storage (SSD strongly recommended)
  • BIOS/UEFI virtualization enabled (VT-x/AMD-V)

Software Requirements

  • Modern Linux distribution (Ubuntu 20.04+, RHEL 8+, etc.)
  • Windows Server installation media (ISO)
  • Administrative access (sudo privileges)

Installation and Configuration

1. Verifying Virtualization Support

Before proceeding, confirm your system supports hardware virtualization:

grep -E --color '(vmx|svm)' /proc/cpuinfo

A non-zero output indicates supported hardware. Next, verify KVM modules are available:

lsmod | grep kvm

2. Installing KVM Packages

For Debian/Ubuntu Systems:

sudo apt update
sudo apt install -y qemu-kvm libvirt-daemon-system libvirt-clients \
virt-manager bridge-utils ovmf

For RHEL/CentOS Systems:

sudo dnf install -y qemu-kvm libvirt virt-install virt-viewer \
virt-manager libguestfs-tools

Enable and start the libvirt service:

sudo systemctl enable --now libvirtd

3. Configuring User Permissions

Add your user to the necessary groups:

sudo usermod -aG libvirt $(whoami)
sudo usermod -aG kvm $(whoami)

Log out and back in for changes to take effect.

Creating a Windows Server Virtual Machine

1. Preparing Storage

Create a storage pool for your VMs:

sudo virsh pool-define-as --name default --type dir --target /var/lib/libvirt/images
sudo virsh pool-start default
sudo virsh pool-autostart default

2. Launching Virt-Manager

Start the graphical interface:

virt-manager

3. Creating a New VM

  1. Click “Create a new virtual machine”
  2. Select “Local install media” and browse to your Windows Server ISO
  3. Allocate RAM (minimum 4096MB for Server Standard)
  4. Create a virtual disk (minimum 40GB, qcow2 format recommended)
  5. Under “Customize configuration before install,” ensure:

  • Chipset: Q35
  • Firmware: UEFI
  • CPU model: host-passthrough
  • Add virtio disk driver

4. Installing Windows Server

  1. Start the VM and proceed with Windows installation
  2. When prompted for storage, load the virtio drivers from:

  • virtio-win.iso (available from Fedora repositories)

  1. Complete the installation normally

Optimizing Windows Performance

1. Installing Virtio Drivers

Mount the virtio ISO and install:

  • Balloon driver
  • Network driver
  • Storage driver
  • QEMU guest agent

2. CPU Pinning

For performance-critical workloads, pin vCPUs to physical cores:

virsh vcpupin   

3. Memory Allocation

Enable memory ballooning for dynamic allocation:

8388608
4194304

Networking Configuration

Bridged Networking Setup

Edit your network configuration:

sudo nano /etc/netplan/01-netcfg.yaml

Example configuration:

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: no
  bridges:
    br0:
      interfaces: [enp3s0]
      dhcp4: yes
      parameters:
        stp: false
        forward-delay: 0

Apply changes:

sudo netplan apply

Assigning the Bridge to Your VM

In virt-manager:

  1. Select the VM and open hardware details
  2. Remove the default NAT network
  3. Add new hardware → Network → Bridge to br0

Advanced Features

PCIe Passthrough

  1. Identify your device:

lspci -nnk

  1. Unbind from host driver:

echo 0000:01:00.0 > /sys/bus/pci/devices/0000:01:00.0/driver/unbind

  1. Add to VM configuration:

<hostdev mode='subsystem' type='pci' managed='yes'>
  <source>
    <address domain='0x0000' bus='0x01' slot='0x00' function='0x0'/>
  </source>
</hostdev>

Snapshot Management

Create snapshots:

virsh snapshot-create-as --domain win-server --name pre-update

Restore snapshots:

virsh snapshot-revert win-server pre-update

Maintenance and Monitoring

Key Commands

  • List running VMs: virsh list
  • Start VM: virsh start win-server
  • Graceful shutdown: virsh shutdown win-server
  • Force stop: virsh destroy win-server

Performance Monitoring

virsh domstats win-server
virt-top

Conclusion

KVM provides an enterprise-grade virtualization platform for running Windows Server workloads on Linux infrastructure. By following this guide, you’ve established a high-performance virtualized environment that combines Windows Server’s compatibility with Linux’s stability and efficiency.

For production environments, consider additional optimizations like:

  • NUMA node pinning
  • Storage pools on ZFS or LVM
  • Regular backup routines
  • SELinux/AppArmor hardening

The flexibility of KVM allows for everything from simple test environments to complex, high-availability Windows Server deployments — all while maintaining the reliability and cost-effectiveness of Linux as the host platform.

Like This Article? Share It!

Our Privacy Policy

Last Updated: June 18th, 2025

Introduction

Western Mass Hosting (“we,” “our,” or “us”) respects the privacy of all individuals and organizations that interact with our services. This Privacy Policy establishes our practices regarding the collection, use, disclosure, and protection of personal information for visitors to our website and clients utilizing our managed hosting and WordPress services. By accessing our website or engaging our services, you acknowledge that you have read and understood this policy in its entirety.

Scope and Applicability

This Privacy Policy governs our handling of information collected through our corporate website and in the course of providing managed hosting, WordPress maintenance, and development services. In accordance with global privacy regulations, we serve as a Data Controller for information related to our business operations and client relationships. When processing data on behalf of our clients through hosted services, we act as a Data Processor under applicable data protection laws.

Information We Collect

We collect various categories of information necessary to provide and improve our services. This includes personal contact and payment details provided during account registration, technical information such as IP addresses and device characteristics for security purposes, and records of communications through support channels. For clients utilizing our hosting services, we may process end-user data stored within client websites, though we do not control or monitor the collection practices of such data.

Purpose and Legal Basis for Processing

We process personal information only when we have proper justification under applicable laws. The primary legal bases for our processing activities include the necessity to fulfill contractual obligations to our clients, our legitimate business interests in maintaining and improving our services, and in limited cases, explicit consent for specific marketing communications. We maintain detailed records of processing activities to demonstrate compliance with legal requirements.

Use of Collected Information

The information we collect serves multiple business purposes. Primarily, we use this data to deliver and maintain reliable hosting services, including server provisioning, performance monitoring, and technical support. We also utilize information for business operations such as billing, customer relationship management, and service improvement initiatives. Security represents another critical use case, where we analyze data to detect and prevent fraudulent activity or unauthorized access to our systems.

Data Sharing and Third-Party Disclosures

We engage with carefully selected third-party service providers to support our operations, including cloud infrastructure providers, payment processors, and customer support platforms. These relationships are governed by strict contractual agreements that mandate appropriate data protection measures. We may disclose information when legally required to comply with court orders, government requests, or to protect our legal rights and the security of our services.

International Data Transfers

As a global service provider, we may transfer and process data in various locations worldwide. When transferring personal data originating from the European Economic Area or other regulated jurisdictions, we implement appropriate safeguards such as Standard Contractual Clauses and rely on adequacy decisions where applicable. Our subprocessors, including AWS Lightsail, maintain robust compliance certifications to ensure the protection of transferred data.

Data Retention Practices

We retain personal information only for as long as necessary to fulfill the purposes outlined in this policy. Client account information is typically maintained for five years following service termination to comply with legal and financial reporting obligations. Backup data associated with hosting services is automatically purged after thirty days, as specified in our Terms of Service. For data processed on behalf of clients, retention periods are determined by the respective client’s policies and instructions.

Security Measures

We implement comprehensive technical and organizational security measures to protect personal information against unauthorized access, alteration, or destruction. Our security program includes network encryption protocols, regular vulnerability assessments, strict access controls, and employee training on data protection best practices. We maintain incident response procedures to address potential security breaches and will notify affected parties where required by law.

Individual Rights

Individuals whose personal data we process may exercise certain rights under applicable privacy laws. These rights may include requesting access to their information, seeking correction of inaccurate data, requesting deletion under specific circumstances, and objecting to particular processing activities. We have established procedures to handle such requests in accordance with legal requirements, typically responding within thirty days of receipt. Requests should be submitted to our designated Data Protection Officer through the contact information provided in this policy.

Cookies and Tracking Technologies

Our website employs various technologies to enhance user experience and analyze site performance. Essential cookies are used for basic functionality and security purposes, while analytics cookies help us understand how visitors interact with our site. Marketing cookies are only deployed with explicit user consent. Visitors can manage cookie preferences through their browser settings or our cookie consent tool.

Policy Updates and Notifications

We periodically review and update this Privacy Policy to reflect changes in our practices or legal obligations. Material changes will be communicated to affected clients through email notifications at least thirty days prior to implementation. Continued use of our services following such notifications constitutes acceptance of the revised policy.

Contact Information

For questions or concerns regarding this Privacy Policy or our privacy practices, please contact our Data Protection Officer at [email protected] or by mail at:

Western Mass Hosting
22 Orlando. St.,
Feeding Hills, MA 01030.

We take all privacy-related inquiries seriously and will respond promptly to legitimate requests. For clients with specific data processing agreements, please reference your contract for any additional terms that may apply to our handling of your data.

Like This Article? Share It!