How to Create an Ubuntu Server VM on Hyper-V

In this guide, we'll create an Ubuntu Server virtual machine on Hyper-V — from setting up networking to installing the OS and logging in over SSH. This assumes Hyper-V is already enabled on your system. If it isn't, check out our guide on enabling Hyper-V on Windows 11 and Windows Server 2025.

What You'll Need

  • Hyper-V enabled on Windows 11 or Windows Server 2025
  • An Ubuntu Server ISO (download the 64-bit AMD/Intel package from ubuntu.com)

Step 1: Set Up an External Virtual Switch

Before creating the VM, set up networking in Hyper-V Manager:

  1. Open Virtual Switch Manager.
  2. Select New Virtual Network Switch | External.
  3. Click Create Virtual Switch, name it (e.g., "External Switch 1").
  4. Select the network interface your host PC uses to connect to the internet.
  5. Click Apply, then Yes.

An external switch connects your VM to the same physical network as your host PC — unlike the default switch, which uses an internal network type.

Step 2: Create the Virtual Machine

  1. Right-click the host in Hyper-V Manager | New | Virtual Machine.
  2. Name it (e.g., "Ubuntu Server 26.04").
  3. Choose Generation 2.
  4. Assign RAM (4 GB is enough for Ubuntu Server) and leave Dynamic Memory enabled.
  5. Select your external switch.
  6. Create a virtual hard drive | the default 127 GB works fine (it's dynamically allocated, so it won't use all the space right away).
  7. Select Install an operating system later, then Finish.
Create an Ubuntu Server VM on Hyper-V

Step 3: Configure VM Settings

Before booting, adjust a few settings:

  1. Right-click the VM | Settings.
  2. Under Security, change the Secure Boot template from Microsoft Windows to Microsoft UEFI Certificate Authority.
  3. Under SCSI Controller, add a DVD Drive.
  4. Attach your Ubuntu Server ISO to the DVD drive.
  5. Under Firmware, move the DVD Drive to the top of the boot order.
  6. Click Apply.

Step 4: Install Ubuntu Server

  1. Right-click the VM | Connect, then click Start.
  2. At the GRUB screen, select Try or Install Ubuntu Server.
  3. Follow the text-based installer.

That's it — your Ubuntu Server VM is up and running on Hyper-V. In the next guide, we'll cover how to clone this VM, which is handy for quickly setting up lab environments.