Tutoriel Linux

Install Debian 13 on Hyper-V without missing the VM

Débutant5 min de lecture

You have just created a VM to test Debian, and then the screen remains black or the installer starts without network. On Hyper-V, the problem often arises from a choice made before the first Debian screen: VM generation, Secure Boot model, ISO, or virtual switch.

I prefer to adjust these settings before starting. You will check the Debian 13 ISO, create a generation 2 VM with an appropriate VHDX, choose the network according to the use case, and then control the result from Debian.

VM Debian ready to start in a Hyper-V environment
Prepare the VM, disk, and network before the first startup of Debian.

Prepare and verify the Debian 13 ISO

Download a Debian 13 image suitable for your connection. A netinst image is fine if the VM will be able to reach a Debian mirror during installation. A DVD image limits this dependency at the cost of a larger download. Keep the exact name of the ISO file: you will reuse it in the command and in the virtual DVD drive.

Debian describes the procedure on its image verification page. Compare the locally calculated SHA256 or SHA512 with the official file. For a complete chain of trust, also check the hash sum file’s signature. Do not invent a hash value: it depends on the exact image downloaded.

Get-FileHash .debian-13.x.x-amd64-netinst.iso -Algorithm SHA256

Replace the example name with your file name. If the checksum does not match, redownload the ISO and do not start the installation.

Prepare the following items to avoid having to go back during the wizard:

  • Windows with Hyper-V available and administrative rights;
  • sufficient disk space for the VHDX and ISO;
  • a virtual switch already chosen;
  • an Internet connection if you are using netinst;
  • the Secure Boot setting ready to be checked.

Create a Hyper-V generation 2 VM

In Hyper-V Manager, launch the new virtual machine wizard and give it a name that identifies Debian and its usage. I recommend generation 2: it uses UEFI and is the default choice for a current Debian 13 installation. Keep generation 1 for a clearly identified compatibility constraint.

Adjust the startup memory and number of processors according to the expected load. There is no universal size for a testing workstation, a graphical desktop, or a service. You can adjust the CPU after creation. For the disk, choose a dynamic VHDX and plan a capacity consistent with the expected packages, logs, and data.

SettingRecommended choiceWhen to change
GenerationGeneration 2Generation 1 only for a compatibility constraint
DiskDynamic VHDXIncrease the capacity if data exceeds initial needs
NetworkDefault Switch for a quick testExternal switch if the VM needs to be reachable from the local network
ISOVirtual DVD driveRemove the ISO after installation to boot from the VHDX

The Default Switch usually provides Internet access via NAT. It does not replace an external switch if you need to access the VM from another device on the LAN. Select the switch before starting the installer; otherwise, Debian may install correctly but with an interface that remains without an address.

Set Secure Boot before the first startup

A generation 2 VM starts with UEFI and can use Secure Boot. In the VM’s Firmware or Security settings, verify the certificate model. The “Microsoft UEFI Certificate Authority” model is the one to try for a Linux ISO when the default setting refuses to boot.

Note: the behavior depends on the version of Windows, Hyper-V, and the image used. If the VM does not boot from the ISO, first check the Secure Boot model and the boot order. Temporarily disable Secure Boot only to isolate this blocking in a lab. Then re-enable it if the chosen configuration allows it.

Install Debian 13 in the VM

Mount the ISO in the virtual DVD drive, start the VM, and choose the graphical or text installation. Select the language and keyboard, then allow the installer to detect the Hyper-V network interface. With netinst, choose a Debian mirror accessible from the selected switch.

For a lab VM, guided partitioning on the VHDX is sufficient if the disk contains no data to keep. Then choose the useful environment: minimal installation for a server, or desktop if the VM is also used for graphic testing. Add SSH only if you need it. Before restarting, remove the ISO from the virtual drive so that Debian boots from the disk.

Check Debian after the first startup

After the restart, check the version, kernel, network, and disk from the guest. The first commands display this state. sudo apt update is an exception: it updates the package index and checks access to the repositories.

cat /etc/os-release
cat /etc/debian_version
uname -r
ip addr
ip route
lsblk
sudo apt update

dmesg | grep -Ei 'hyperv|hv.'
  • /etc/os-release and /etc/debian_version confirm the installation of Debian 13;
  • uname -r indicates the actual loaded kernel;
  • ip addr shows the interface and the received address. If this reading is unfamiliar to you, the resource check an address with ip addr details the useful lines;
  • ip route helps identify the default route. The page read traffic with ip route assists in distinguishing between an absence of route and a DNS issue;
  • lsblk confirms the presence of the virtual disk and its partitions;
  • sudo apt update checks network, DNS resolution, and repositories if you chose a connected installation;
  • dmesg may display Hyper-V traces, but the content depends on the kernel and read permissions. The resource read messages with dmesg explains this check.

Microsoft documents Debian among the distributions supported on Hyper-V and specifies that Linux Integration Services are integrated into the Linux kernel for the relevant distributions. Therefore, you do not need to install the old Microsoft LIS package for this modern Debian. Check the kernel and previous checks rather than adding an external installer. The reference remains the Microsoft Learn page on Debian in Hyper-V.

Fix the most common issues

SymptomVerificationCorrection
The ISO does not bootDVD drive, boot order, Secure BootCheck the ISO and try Microsoft UEFI Certificate Authority
No IP addressAttached switch and interface in ip addrReturn to the Hyper-V switch, then relaunch the network check
No InternetRoute with ip route, then DNSDistinguish switch, route, and resolution before modifying Debian
Disk absentPresence of the VHDX in lsblkCheck the controller and the disk attached to the VM

The VM is ready for a lab if it starts, obtains an address, has a default route, and sees its VHDX. Then create a clean checkpoint if you need it for your tests, and then update Debian. A checkpoint does not replace a long-term backup. If the VM needs to exit the lab, hardening, monitoring, and backup policy will need to be addressed separately.