Debian is one of the most popular and stable Linux distributions available. While you can install it directly on your computer, running Debian as a virtual machine allows you to try it out without modifying your existing system. This guide will show you how to install Debian on Microsoft’s Hyper-V virtualization platform, which comes built into Windows 10 Pro and Windows 11 Pro.
Download the Debian ISO File
Step 1: Go to the official Debian website at debian.org/download. Look for the link to download the latest Debian netinst ISO file – this is typically named something like “debian-11.x.0-amd64-netinst.iso”. Click the link to start the download.
Step 2: Once the ISO file has finished downloading, make note of where it’s saved on your computer. You’ll need this location later when setting up the virtual machine.
Enable and Configure Hyper-V
Before creating a Debian virtual machine, you need to make sure Hyper-V is enabled on your Windows system:
Step 1: Open the Control Panel and navigate to Programs > Turn Windows features on or off.
Step 2: Scroll down and check the box next to “Hyper-V”. Make sure both “Hyper-V Management Tools” and “Hyper-V Platform” are selected.
Step 3: Click OK and wait for Windows to install the necessary components. You’ll need to restart your computer to complete the installation.
Step 4: After restarting, search for and open “Hyper-V Manager” from the Start menu.
Create a New Virtual Machine for Debian
Now that Hyper-V is set up, let’s create a new virtual machine to install Debian:
Step 1: In Hyper-V Manager, click “Action” in the top menu, then select “New” > “Virtual Machine” to start the creation wizard.
Step 2: Give your virtual machine a name, like “Debian-VM”, and choose a location to store its files.
Step 3: For the generation, select “Generation 2” as it offers more modern features.
Step 4: Assign memory to the VM. For Debian without a graphical interface, 2048 MB (2 GB) is usually sufficient. Check “Use dynamic memory” to allow Hyper-V to adjust memory usage as needed.
Step 5: Configure networking by selecting the default virtual switch, or create a new one if desired.
Step 6: Create a new virtual hard disk, giving it at least 20 GB of space. Debian doesn’t need much, but extra space allows for future growth.
Step 7: When asked about installation options, choose “Install an operating system later” – we’ll manually attach the ISO in the next steps.
Step 8: Review your settings and click “Finish” to create the virtual machine.
Configure the Virtual Machine Settings
Before starting the Debian installation, we need to make a few adjustments to the VM’s settings:
Step 1: Right-click on your newly created VM in Hyper-V Manager and select “Settings”.
Step 2: Under “Security”, uncheck “Enable Secure Boot”. Debian doesn’t support Secure Boot by default.
Step 3: Go to “SCSI Controller” > “DVD Drive” > “Add”. Then select “Image file” and browse to the Debian ISO you downloaded earlier.
Step 4: Under “Firmware”, move the DVD drive to the top of the boot order list.
Step 5: In the “Processor” section, assign at least 2 virtual processors to ensure smooth performance.
Step 6: Click “Apply” and then “OK” to save these changes.
Install Debian on the Virtual Machine
Now we’re ready to start the Debian installation process:
Step 1: In Hyper-V Manager, right-click on your Debian VM and select “Start”.
Step 2: Right-click the VM again and choose “Connect” to open the VM’s console window.
Step 3: You should see the Debian installer boot menu. Use the arrow keys to select “Install” (or “Graphical install” if you prefer) and press Enter.
Step 4: Follow the on-screen prompts to select your language, location, and keyboard layout.
Step 5: When configuring the network, you can typically use DHCP for automatic setup. If you need a static IP, you can configure it manually.
Step 6: Choose a hostname for your Debian system and set up the root password when prompted.
Step 7: Create a regular user account as instructed by the installer.
Step 8: For partitioning, you can usually select “Guided – use entire disk” for simplicity. Advanced users may prefer manual partitioning.
Step 9: Select the software you want to install. For a minimal system, you can deselect the desktop environment and print server options.
Step 10: Allow the installation to complete. This may take some time depending on your system’s performance and network speed.
Step 11: When prompted, install the GRUB boot loader to the master boot record.
Step 12: Once the installation finishes, the system will reboot. You may need to manually remove the ISO file from the virtual DVD drive in the VM settings to boot from the virtual hard disk.
Post-Installation Setup
After Debian boots for the first time:
Step 1: Log in using the user account you created during installation.
Step 2: Open a terminal and run sudo apt update && sudo apt upgrade to ensure your system is up to date.
Step 3: Consider installing the Hyper-V integration services for improved performance:
sudo apt install hyperv-daemons
Step 4: Reboot the virtual machine to apply all updates and changes.
Congratulations! You now have a fully functional Debian Linux system running as a virtual machine on Hyper-V. This setup allows you to experiment with Debian without affecting your main Windows installation. Remember to take snapshots of your VM periodically so you can easily revert changes if needed.