4 minutes reading time (848 words)
Featured

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

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

How to install a Debian 11 Bullseye server. Minimal setup with no GUI and with a minimum of packages installed.
...

Debian Linux Server Setup Checklist - TechLabs

A series of step by step guides for installing and configuring a Debian 11 Linux server.


Related Posts

 

Comments 5

Guest - Paul on Wednesday, 19 January 2022 11:58

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.

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.
TechLabs on Thursday, 20 January 2022 20:02

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.

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.
Guest - Kate on Sunday, 13 February 2022 02:28

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.

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.
TechLabs on Wednesday, 16 February 2022 19:13

Thanks for the feedback. Hyper-V virtual switch configuration isn't covered in the guide so this could be useful info for others

Thanks for the feedback. Hyper-V virtual switch configuration isn't covered in the guide so this could be useful info for others :)
Guest - Valyno on Thursday, 23 February 2023 09:47

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

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
Already Registered? Login Here
Saturday, 23 September 2023
You can help support this website by buying me a coffee!
Buy Me A Coffee