Hyper-V is a built-in virtualization platform in Windows that enables you to run multiple operating systems on a single computer. This guide explains step by step how to create and configure a virtual machine in Hyper-V.
Launching Hyper-V Manager
- Open Hyper-V Manager from the Start menu.
- In the Actions pane, click New > Virtual Machine.
Basic Setup
- Name: Enter a descriptive name (e.g., Ubuntu VM).
- Location: Choose a folder to store VM files.
Choosing Generation
- Generation 1: Legacy BIOS-based firmware, supports older operating systems.
- Generation 2: UEFI firmware, supports Secure Boot, recommended for modern operating systems.
Assigning Memory
- Allocate startup memory (e.g., 2 GB for lightweight Linux).
- Enable Dynamic Memory to allow Hyper-V to adjust memory usage automatically.
Configuring Networking
- External Switch: Connects to the physical network with internet access.
- Internal Switch: Communication between host and VMs, no internet.
- Private Switch: Communication only between VMs, isolated from host and internet.
Connecting Virtual Hard Disk
- Create a new virtual hard disk or use an existing one.
- Specify size (e.g., 20 GB for basic installations).
Installing the Operating System
- Choose to install later or attach installation media (ISO file).
Hyper-V VM Settings: Hardware
1. Add Hardware
- Add components such as network adapters, hard disks, or SCSI controllers.
2. Firmware
- Adjust boot order (e.g., Optical Drive first).
- Enable Secure Boot for Generation 2 VMs.
3. Security
- Configure Encryption Support and TPM for enhanced security.
4. Memory
- Set startup memory and enable dynamic memory allocation.
5. Processors
- Assign the number of virtual CPUs (e.g., 2 for better performance).
- Enable Virtual NUMA or Compatibility Mode if required.
6. SCSI Controller
- Attach virtual hard drives and optical drives using scalable SCSI controllers.
7. Network Adapter
- External Network: Connects VM to host’s physical network with internet access.
- Internal Network: Communication between host and VM, no internet.
- Private Network: Isolated communication between VMs only.
Hyper-V VM Settings: Management
- Name: Update VM name or description.
- Integration Services: Enable time sync, heartbeat monitoring, and guest file copy.
- Checkpoints: Save VM state for backup or testing.
- Smart Paging File: Specify paging file location.
- Automatic Start Action: Configure VM behavior when host boots (do nothing, start automatically, or restore state).
- Automatic Stop Action: Configure VM behavior when host shuts down (save state, turn off, or shut down).
Starting the Virtual Machine
- Select the VM and click Connect.
- Click inside the VM window to capture input.
- Enable integration services for seamless mouse and keyboard interaction.
- Enter full-screen mode with Ctrl + Alt + Break (or Ctrl + Alt + Pause).
Installing the Operating System
- Follow the OS installation wizard.
- Enable integration services for improved performance and usability.
Hyper-V offers a reliable and flexible platform for virtualization. With proper configuration, you can run multiple operating systems efficiently on a single host machine.
By following this guide, you’ll be able to create and manage virtual machines in Hyper-V with confidence, tailoring them to your testing, development, or isolated environment needs.
Tags
Software
