eryph
by
On this page
guides

Create Your First Hyper-V Virtual Machine: Step-by-Step Tutorial

Build and configure VMs using built-in Hyper-V tools or eryph's automated approach

By eryph Team
2025-09-01
10 min read

Ready to create your first virtual machine with Hyper-V? Whether you're testing a new operating system, setting up a development environment, or isolating applications, this guide will walk you through the entire process from start to finish.

If you haven't installed Hyper-V yet, check our guides for Windows 10/11 or Windows Server first.

We'll cover three methods for creating VMs:

  • Method 1: Hyper-V Manager (GUI) - Visual approach perfect for beginners
  • Method 2: PowerShell - Built-in commands ideal for automation and scripting
  • Method 3: eryph - Simplified one-liner deployment with template inheritance (see Option 3 below)

Important: Know Before You Create Your First VM

Prerequisites Checklist

Hyper-V installed on Windows 10/11 Pro or Windows Server
Operating system ISO file (Windows, Linux, etc.) or installation media
8GB+ RAM total (4GB for host + 4GB for VM minimum)
30GB+ free disk space (varies by OS and intended use)

What You'll Need

Important: VM Generation Cannot Be Changed

Virtual machine generation is permanent once created - choose carefully!

Generation 1 VMs: Legacy BIOS boot, compatible with older operating systems
Generation 2 VMs: Modern UEFI boot, better security and performance

Strong recommendation: Always use Generation 2 for new VMs unless you need very old OS support (pre-2012)

Method 1: Create VM Using Hyper-V Manager (GUI)

This visual method is perfect for your first VM or when you want to see all available options.

Step 1: Open Hyper-V Manager and Start the Wizard

  1. Launch Hyper-V Manager

    • Press Windows + R, type virtmgmt.msc, press Enter
    • Or search "Hyper-V Manager" in Start menu
  2. Start New VM Wizard

    • Click your computer name in the left panel
    • Right-click → "New" → "Virtual Machine"
    • Or use Action menu → "New" → "Virtual Machine"

Step 2: Configure Basic VM Settings

Name and Location

  • VM Name: Choose something descriptive like "Ubuntu-Dev" or "Windows11-Test"
  • Storage Location: Default is fine, or choose a drive with more space
  • Click "Next"

Generation Selection

  • Choose Generation 2 for Windows 10/11 or modern Linux
  • Choose Generation 1 only for older operating systems
  • Click "Next"

Step 3: Configure Memory

Memory Assignment

  • Startup Memory: Start with 4096 MB (4GB) for most modern operating systems
  • Use Dynamic Memory: Check this box to automatically adjust memory usage
    • VM will use less RAM when idle, more when busy
    • Good for multiple VMs on limited hardware

Memory Guidelines by OS

Windows 11: Minimum 4GB, recommended 8GB
Windows 10: Minimum 2GB, recommended 4GB
Ubuntu Desktop: Minimum 2GB, recommended 4GB
Windows Server: Minimum 4GB, recommended 8GB+

Click "Next"

Step 4: Configure Networking

Virtual Switch Selection

  • Default Switch: Automatically created, provides internet access
  • External Switch: If you created one, connects VM directly to your network
  • Not Connected: No network access (you can add this later)

For your first VM, "Default Switch" works well. Click "Next"

Step 5: Create Virtual Hard Disk

Virtual Hard Disk Options:

  • Create a virtual hard disk: Most common option
    • Name: Automatically matches VM name
    • Location: Uses VM's folder location
    • Size: 127GB default (fine for most uses, dynamically allocated)

Disk Size Recommendations

Windows 11: 64GB minimum, 100GB+ recommended
Windows 10: 32GB minimum, 80GB+ recommended
Ubuntu Desktop: 25GB minimum, 50GB+ recommended
Windows Server: 40GB minimum, 100GB+ recommended

Click "Next"

Step 6: Installation Options

Choose Installation Method:

  • Install from bootable image file (.iso): Browse to your downloaded ISO
  • Install from network-based installation server: For enterprise deployments
  • Install later: Create empty VM, add ISO later

For first VM: Select "bootable image file" and browse to your OS ISO file.

Click "Next"

Step 7: Review and Create

Summary Page:

  • Review all your settings
  • Click "Finish" to create the VM

The VM is now created but not started.

Step 8: First Boot and OS Installation

  1. Connect to VM

    • Right-click your new VM → "Connect"
    • Virtual Machine Connection window opens
  2. Start the VM

    • Click "Start" button or Action → "Start"
    • VM will boot from your ISO file
  3. Install Operating System

    • Follow the OS installation wizard
    • Install normally as if on physical hardware
    • Install Integration Services after OS installation (see below)

Method 2: Create VM Using PowerShell

PowerShell offers more control and is perfect for scripting or advanced users.

Step 1: Check Available Resources

PowerShell
# Check available virtual switches
Get-VMSwitch | Format-Table Name, SwitchType, NetAdapterInterfaceDescription

# Check available disk space
Get-Volume

Step 2: Create VM with New-VM Command

Basic VM Creation:

PowerShell
# Create simple VM with default settings
New-VM -Name "MyFirstVM" -MemoryStartupBytes 4GB -Generation 2

# Create VM with new virtual hard disk
New-VM -Name "Ubuntu-Test" -MemoryStartupBytes 4GB -Generation 2 -NewVHDPath "C:\VMs\Ubuntu-Test.vhdx" -NewVHDSizeBytes 50GB

# Create VM with existing VHD and network switch
New-VM -Name "Windows11-VM" -MemoryStartupBytes 8GB -Generation 2 -VHDPath "C:\VMs\Win11.vhdx" -Switch "Default Switch"

Advanced VM Creation with All Options:

PowerShell
New-VM -Name "DevServer" `
       -MemoryStartupBytes 4GB `
       -Generation 2 `
       -NewVHDPath "D:\VMs\DevServer\DevServer.vhdx" `
       -NewVHDSizeBytes 100GB `
       -Switch "Default Switch" `
       -Path "D:\VMs\DevServer"

Step 3: Configure VM Settings

PowerShell
# Enable Dynamic Memory
Set-VMMemory -VMName "MyFirstVM" -DynamicMemoryEnabled $true -MinimumBytes 2GB -MaximumBytes 8GB

# Set processor count
Set-VMProcessor -VMName "MyFirstVM" -Count 2

# Add DVD drive and mount ISO
Add-VMDvdDrive -VMName "MyFirstVM" -Path "C:\ISOs\ubuntu-22.04.3-desktop-amd64.iso"

# Enable Enhanced Session Mode (better integration)
Set-VM -Name "MyFirstVM" -EnhancedSessionTransportType HvSocket

Step 4: Start the VM

PowerShell
# Start the virtual machine
Start-VM -Name "MyFirstVM"

# Connect to VM (opens connection window)
vmconnect localhost "MyFirstVM"

Method 3: eryph - Simplified VM Deployment

While the built-in Hyper-V methods work well, they require multiple steps and manual configuration. eryph simplifies VM creation with template inheritance and one-line deployments.

eryph vs Built-in Methods

Built-in Hyper-V: Create VM → Configure settings → Install OS → Configure guest
eryph: Single command deploys pre-configured, ready-to-use VMs with template inheritance

Install eryph (One-time Setup)

If you don't have eryph installed yet, see our quickstart guide for complete installation instructions.

Create VM with One Command

PowerShell
# Deploy Windows 11 VM with a single command
New-Catlet -Name "win11" -Parent "dbosoft/win11-24h2-enterprise"

# Check deployment status
Get-Catlet

That's it! The VM will be created, configured, and ready to use with:

  • Automatic OS installation - No ISO mounting or installation wizards
  • Pre-configured settings - Memory, disk, and network automatically optimized
  • Template inheritance - VMs inherit configurations from parent templates
  • Consistent environments - Same setup every time, reproducible across teams

eryph Template Benefits

VMs deployed from eryph templates inherit optimized configurations, automatic provisioning, and consistent environments. Templates can be customized and shared across teams for standardized deployments.

Next steps with eryph: Explore our quickstart guide to see template customization, gene inheritance, and automated provisioning workflows.

Essential Post-Creation Configuration

Enable Integration Services (Optional Management Features)

Hyper-V Integration Services provide management conveniences like time sync, guest shutdown, and file copy between host and VM:

Windows VMs: Integration Services are built into Windows. Most are enabled by default (time sync, shutdown, heartbeat), but some like Guest Service Interface (file copy) are disabled by default and can be enabled in VM settings if needed.

Linux VMs: Follow Microsoft's Linux VM best practices for optimal configuration. Modern Linux distributions include Hyper-V drivers built into the kernel - no additional driver installation needed.

Enable Enhanced Session Mode (Windows VMs)

Enhanced Session Mode provides better VM interaction with clipboard sharing and drive redirection:

PowerShell
# Enable on Hyper-V host
Set-VMHost -EnableEnhancedSessionMode $true

# Enable for specific VM
Set-VM -Name "MyFirstVM" -EnhancedSessionTransportType HvSocket

Configure Automatic Checkpoints

Hyper-V can automatically create checkpoints (snapshots) before Windows Updates:

PowerShell
# Disable automatic checkpoints (recommended for production VMs)
Set-VM -Name "MyFirstVM" -AutomaticCheckpointsEnabled $false

# Enable if you want automatic backup before updates
Set-VM -Name "MyFirstVM" -AutomaticCheckpointsEnabled $true

Common First-VM Issues and Solutions

VM Won't Start or Shows Black Screen

  • Check Secure Boot: For Generation 2 VMs, ensure your OS supports UEFI
  • Verify ISO file: Make sure your ISO isn't corrupted
  • Check memory allocation: Ensure enough RAM is available
PowerShell
# Check VM configuration
Get-VM -Name "MyFirstVM" | Format-List *

# Disable Secure Boot if needed (Generation 2 VMs)
Set-VMFirmware -VMName "MyFirstVM" -EnableSecureBoot Off

Poor Performance

  • Check memory allocation: Don't assign more RAM than your host has available
  • Verify VM generation: Generation 2 VMs perform better than Generation 1
  • Monitor host resources: Ensure host CPU and memory aren't overloaded
  • Check storage performance: Slow host storage directly impacts VM performance

Networking Issues

  • VM can't access internet: Check virtual switch configuration
  • Can't connect to VM from host: Verify firewall settings
PowerShell
# Check virtual switch configuration
Get-VMNetworkAdapter -VMName "MyFirstVM" | Format-List *

# Change virtual switch
Connect-VMNetworkAdapter -VMName "MyFirstVM" -SwitchName "Default Switch"

What's Next: Managing Your VMs

VM Creation Complete!

You now know three ways to create VMs - GUI, PowerShell, and eryph automation
Choose the right method - Manual control vs automated deployment
Ready for advanced scenarios - Checkpoints, templates, and scaling await
Multiple use cases unlocked - Development, testing, learning, and production

Method Comparison

Hyper-V Manager: Visual approach, great for learning and one-off VMs
PowerShell: Command-line control, perfect for scripting and automation
eryph: Template inheritance, ideal for consistent environments and scaling

Next Steps by Method

Built-in tools: Learn checkpoints, exports, and PowerShell automation
eryph users: Explore template customization, gene inheritance, and team sharing

Choose Your Path Forward

For learning and experimentation: Start with Hyper-V Manager to understand VM concepts, then progress to PowerShell for automation.

For production and scaling: Consider eryph's template system for consistent, repeatable deployments - explore our quickstart guide to see automated provisioning and template inheritance in action.

For mixed environments: Combine approaches - use built-in tools for custom setups and eryph for standardized deployments.

You now have three powerful ways to create virtual machines, each suited to different scenarios and workflows.


Ready for automated VM deployment? eryph builds on your Hyper-V foundation with template inheritance and one-line provisioning for scalable virtualization.