WindowsLow

Creating a Virtual Machine in Hyper-V: Step-by-Step Guide

This guide will walk you through creating a virtual machine in Hyper-V from scratch. You'll learn how to configure resources, install an operating system, and manage virtual hardware.

Updated at February 16, 2026
15-30 min
Medium
FixPedia Team
Применимо к:Windows 10 ProWindows 11 ProWindows 10/11 EnterpriseWindows 10/11 Education

Introduction / Why This Is Needed

Hyper-V is Microsoft's hypervisor that allows you to create and manage virtual machines (VMs) directly on Windows. With it, you can isolate environments for software development and testing, run multiple operating systems simultaneously, learn, or experiment without risking your main system. This guide will help you create a fully functional virtual machine from scratch—from setting up Hyper-V to installing the guest OS.

Requirements / Preparation

Before you begin, ensure your system meets the following requirements:

  • Operating System: Windows 10/11 Pro, Enterprise, or Education (the Home edition does not support Hyper-V).
  • Processor: Must support virtualization (Intel VT-x or AMD-V) and have the option enabled in BIOS/UEFI (usually "Virtualization Technology").
  • RAM: Minimum 4 GB (8 GB or more recommended, as the VM will use a portion of RAM).
  • Disk Space: Sufficient space for virtual hard disks (e.g., 40–60 GB per VM).
  • Installed Hyper-V Role: If not already installed, the first step of this guide covers it.
  • Installation Media: ISO image of the desired OS (Windows, Linux) or a physical disk/flash drive.

Step 1: Enabling the Hyper-V Role

If Hyper-V is not yet activated, start by installing the component.

Via Control Panel:

  1. Open Control PanelPrograms and FeaturesTurn Windows features on or off.
  2. Find Hyper-V and check the box (expand to select all subcomponents).
  3. Click OK and wait for the installation to complete. Restart your computer to finish the process.

Via PowerShell (Run as Administrator):

Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All

This command will install Hyper-V and all necessary dependencies. Restart the system after execution.

💡 Tip: After restarting, verify that the Hyper-V service is running: in PowerShell, run Get-Service vmms. The status should be "Running".

Step 2: Creating a Virtual Switch

A virtual switch provides network connectivity between the virtual machine and the outside world (internet, local network).

  1. Launch Hyper-V Manager (via Windows search).
  2. In the right pane, select Virtual Switch Manager.
  3. Click Create Virtual Switch.
  4. Select the External type (to allow the VM to access the network via the physical adapter). For isolated environments, you can use Internal or Private.
  5. Under Connection to, select your active network adapter (e.g., "Ethernet" or "Wi-Fi").
  6. Name the switch (e.g., ExternalSwitch) and uncheck Enable virtual LAN identification if not required.
  7. Click OK. Network connectivity on the host may temporarily drop—this is normal.

⚠️ Important: If you have multiple adapters, select the one used for internet access. For wireless adapters, there may be limitations—in such cases, consider using an internal switch with a bridge.

Step 3: Creating a New Virtual Machine

Now let's create the virtual machine itself.

  1. In Hyper-V Manager, select ActionNewVirtual Machine. The wizard will open.
  2. Before you begin: Click Next.
  3. Specify name: Enter a name for the VM (e.g., Ubuntu-VM). Optionally, choose a location for its files (default is C:\Users\Public\Documents\Hyper-V).
  4. Generation:
    • For 64-bit modern OSes (Windows 10/11, recent Linux versions), select Generation 2 (UEFI support, better performance).
    • For 32-bit or older OSes requiring BIOS, select Generation 1.
  5. Assign memory:
    • Specify startup memory (e.g., 2048 MB for Linux, 4096 MB for Windows).
    • Uncheck Use dynamic memory if you want a fixed allocation (recommended to leave enabled for flexibility).
  6. Configure networking: Select the created virtual switch (e.g., ExternalSwitch).
  7. Connect virtual hard disk:
    • Select Create a virtual hard disk.
    • Specify name, location, and size (for Windows 10/11, minimum 40 GB; for Linux, 20 GB is sufficient).
    • Format: VHDX (supports larger sizes and is more resilient to corruption).
  8. Install an operating system:
    • Select Install an operating system from a bootable image file and specify the path to the ISO image (e.g., D:\ISOs\ubuntu-22.04.iso).
    • Or select Install an operating system from a physical disk if using a flash drive.
    • You can also select Install an operating system later and attach the ISO later via VM settings.
  9. Click Finish. The VM will appear in the list.

Step 4: Configuring Virtual Machine Settings

After creation, you can fine-tune settings for optimal performance.

  1. In Hyper-V Manager, select the created VM, right-click → Settings.
  2. Processor: Increase the number of virtual processors (e.g., 2 or 4) depending on host resources.
  3. Memory: Adjust RAM amount if needed. For dynamic memory, configure buffers.
  4. Hard Drive: You can add additional disks via Add in the "Hard Drive" section.
  5. FirmwareBoot order: Ensure DVD Drive is above Hard Drive if planning to install from ISO. Revert the order after installation.
  6. Integration Services: Ensure the Enable integration services option is active (usually enabled by default).

💡 Tip: For gaming or heavy applications in the VM, allocate more resources, but no more than 80% of available host resources to avoid slowing down the main system.

Step 5: Installing the Operating System

Now let's start the VM and install the OS.

  1. In Hyper-V Manager, select the VM and click Start.
  2. After startup, click Connect... to open the console window (or double-click the VM).
  3. Boot from the installation media (ISO). Follow the standard OS installation process:
    • For Windows: Select language, click Install, enter product key (or skip), select version, accept agreement, choose custom installation, select the virtual hard disk, and complete setup.
    • For Linux (e.g., Ubuntu): Select language, click Install Ubuntu, follow the wizard (disk partitioning, username, etc.).
  4. After installation, the system will reboot. Important: Detach the ISO image in the VM settings (in the "DVD Drive" section, select "None") or uncheck Start from a physical or virtual hard disk to avoid looping back into installation.
  5. Complete the initial OS setup (create user, configure updates).

Step 6: Installing Integration Services

Hyper-V Integration Services improve VM performance by adding support for dynamic memory, time synchronization, shared folders, etc.

For Windows:

  1. In the Action menu of the open VM console, select Insert Integration Services Setup Disk.
  2. In the guest Windows, autorun will open. Launch the installation.
  3. Follow the instructions (usually Next → Next → Finish).
  4. Restart the virtual machine.

For Linux (Ubuntu/Debian example): Integration Services are often built-in, but for full functionality, install the packages:

sudo apt update
sudo apt install linux-image-extra-virtual

For other distributions, use the appropriate package manager (yum, dnf). Restart the VM after installation.

💡 Tip: After installing Integration Services in Windows, you can configure shared folders (via ActionEnable Enhanced Session Mode) to exchange files between host and guest.

Verifying the Result

Ensure the virtual machine is functioning correctly:

  1. Boot and startup: The VM should boot into the guest OS without errors.
  2. Network: If an external switch is configured, check internet access from the VM (open a browser or run ping 8.8.8.8).
  3. Integration Services: In guest Windows, check Task Manager for hypervisor components. In Linux, check for hv_* modules (lsmod | grep hv).
  4. Shared folders: If configured, ensure they are accessible and writable.
  5. Performance: Check that the VM responds to actions without significant lag.

If all points work, the virtual machine is ready for use.

Potential Issues

Error: "Failed to initialize virtual switch"

  • Cause: Conflict with other virtualization software (VirtualBox, VMware) or incorrect switch binding.
  • Solution:
    • Ensure Hyper-V is the only hypervisor. Temporarily disabling VirtualBox/VMware may help.
    • Recreate the switch, selecting a different physical adapter or type (internal).
    • Restart the Hyper-V service: in PowerShell (as admin) run Restart-Service vmms.

Error: "Not enough memory to start the virtual machine"

  • Cause: Insufficient free RAM on the host to allocate to the VM.
  • Solution:
    • Reduce memory allocation in VM settings (e.g., from 4096 MB to 2048 MB).
    • Close unnecessary programs on the host.
    • Add more RAM to the computer.

Error: "Failed to start the virtual machine"

  • Cause: Incorrect boot order in VM firmware or corrupted ISO image.
  • Solution:
    • In VM settings (Firmware section), ensure DVD Drive is first in the boot order.
    • Verify ISO file integrity (redownload or use a different version).
    • Ensure the ISO matches the architecture (x64 for Generation 2).

Network not working in the virtual machine

  • Cause: Misconfigured switch or missing drivers in guest OS.
  • Solution:
    • For Windows: In the VM, open "Network Connections," check that the "Hyper-V Virtual Ethernet Adapter" is enabled and has an IP (DHCP). Reinstall drivers via Device Manager if needed.
    • For Linux: Install hypervisor packages (e.g., sudo apt install hyperv-daemons for Ubuntu). Check that the hv_netvsc module is loaded (lsmod | grep hv).
    • Recreate the virtual switch, choosing a different type or adapter.

Virtual machine is slow or uses many resources

  • Cause: Insufficient allocated resources or Integration Services conflict.
  • Solution:
    • Increase virtual processors and memory (within reasonable limits).
    • Disable unnecessary services in the guest OS.
    • For Linux, ensure Hyper-V drivers are in use (not standard ones).

F.A.Q.

Do I need to disable Hyper-V to use VirtualBox or VMware?
How to increase the virtual machine disk size after creation?
Can I create a virtual machine without an ISO image?
Why does the virtual machine fail to start with the error 'Failed to initialize virtual switch'?

Hints

Enabling Hyper-V in Windows
Creating a Virtual Switch
Creating a New Virtual Machine
Configuring Memory and Disk
Installing the Operating System
Installing Integration Services
FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community