Create a Debian Linux Virtual Machine using Hyper-V
How to create a generation 2 Linux virtual machine on Hyper-V, assign memory, connect virtual switch and virtual hard disk. Then edit the VM settings, attach the ISO image file and install Debian.
The steps in this guide will create a Debian Linux Hyper-V Virtual Machine with 2GB memory, 2 Virtual processors and a 50GB hard disk. These resources should be a good starting point for a Linux VM without a GUI.
Windows Server 2019 Hyper-V, Debian 11
Download Debian
Download the latest DVD amd64 (64-bit) ISO image for Debian
Debian on CDs/DVDs
https://www.debian.org/CD
debian-11.0.0-amd64-DVD-1.iso
Create Virtual Machine
Hyper-V Manager
Action - New - Virtual Machine
Before you begin - Next
Specify Name and Location - enter VM name
Store the virtual machine in a different location
In this example, the Hyper-V server has two drives; C drive for the Windows OS and D drive for VM Data.
We've already configured the Virtual Hard Disk and Virtual Machine folders in the Hyper-V Settings so we don't need to change this setting.
Specify Generation - Generation 2
- Generation 2 virtual machines have more features than generation 1
- You should only create a generation 1 VM if the guest operating system you want to install isn't supported on generation 2
References:
Should I create a generation 1 or 2 virtual machine in Hyper-V?
Debian guest operating system support
https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/plan/should-i-create-a-generation-1-or-2-virtual-machine-in-hyper-v#debian-guest-operating-system-supportHyper-V feature compatibility by generation and guest
by Author
https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/hyper-v-feature-compatibility-by-generation-and-guest
Assign Memory
Enter startup memory e.g. 2048MB / 2GB
Tick use dynamic Memory for this virtual machine
Dynamic memory allows Hyper-V to add more memory to a guest OS when it's needed or remove it when the VM memory usage drops. This allows VMs to share the host's available physical memory more efficiently as the guests only use memory when they need it.
Configure Networking - Connect virtual switch
Connect Virtual Hard Disk
Set virtual disk size e.g. 50GB
- Creating a virtual hard disk (VHD) using the New virtual machine wizard will automatically create a dynamically expanding VHD.
- A Dynamically expanding VHD will automatically expand to the available maximum size.
- Dynamically expanding VHDs are thin-provisioned, they are initially small and increase in size as data is added.
Installation Options - Install an operating system later
We will attach the Debian ISO file to the VM in the next steps.
Finish
Edit Virtual machine settings
Memory
Dynamic Memory - set Maximum RAM to 2048MB / 2GB
Processor
Number of virtual processors 2
SCSI Controller
DVD Drive - add
Image file - browse to select ISO image file
debian-11.0.0-amd64-DVD-1.iso
Firmware
Change boot order so DVD drive is first
Security
Untick enable secure boot
Automatic Start and Stop Actions
Automatic Start Actions
Always start this virtual machine automatically
Automatic Stop Actions
Shut down the guest operating system

Install Debian 11 (Bullseye) Minimal Server - TechLabs

Comments 5
Nice job with the article. What about having Debian (in HypeV) reach/mount back to the host's resources? Ex. in the VM mount a shared drive.
Thanks for the feedback on the guide. You can copy text from the VM using a terminal app like Putty or transfer files to/from the VM using SSH; I use FileZilla for this. Another option is to shutdown the VM and mount the virtual hard disk .vhdx file on the Hyper-V host. Then you can access all of the files on the VM disk.
Important note: The default virtual switch for Hyper-V allows the VM to piggyback off of the host's IP configuration. The VM will have internet access but will not be accessible from any computer other than the host.
You can create a new switch using the Virtual Switch Manager (in the actions panel on the right of the main Hyper-V Manager screen)... External switch, link it to your Ethernet card... and it will appear on your network as an independent device with its own IP, allowing you to forward ports to it.
Thanks for the feedback. Hyper-V virtual switch configuration isn't covered in the guide so this could be useful info for others
Hi,
Just installed Debian 11 with same parameters.
Partitionning is encrypted LVM.
Issue: at boot up, impossible to enter the password to decrypt the volume. Apparently some other users have the same issue but I have seen no solution to fix this so far...a