
Fabian Tech Tips

Hyper-V Command Line Configuration and Management
Feb 11
2 min read
0
4
0
Hyper-V Command Line Configuration and Management
This guide provides a comprehensive overview of setting up, configuring, and managing Microsoft Hyper-V using only command-line tools. PowerShell offers a robust and efficient way to interact with Hyper-V, enabling automation, scalability, and streamlined management of your virtualized environment1. Whether you're a seasoned system administrator or new to Hyper-V, this guide will equip you with the knowledge and commands to harness the power of Hyper-V without relying on graphical interfaces.
Setting Up Hyper-V via Command Line 2
Before diving into the command-line instructions, ensure your system meets the necessary requirements. These include:
A 64-bit processor with at least 1.4 GHz CPU speed2.
Second Level Address Translation (SLAT)2.
Support for VM Monitor Mode Extensions2.
Minimum of 4 GB RAM2.
Hardware-assisted virtualization enabled through Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V) technology2.
Hardware-enforced Data Execution Prevention (DEP) with the Intel XD bit (execute disable bit) or the AMD NX bit (no execute bit)2.
To confirm your system's compatibility, open PowerShell or Command Prompt and execute the following command:
PowerShell
systeminfo
Scroll down to the "Hyper-V Requirements" section and verify that all listed requirements have a "Yes" status2. If your system meets the requirements, proceed with the Hyper-V installation using any of the methods below.
Installing Hyper-V with PowerShell 3
PowerShell offers a streamlined approach to installing Hyper-V: 3
Open PowerShell as an administrator.
Execute the following cmdlet:
PowerShell
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -All
Import the Hyper-V module:
PowerShell
Import-Module Hyper-V
Restart your computer when prompted.
Installing Hyper-V with DISM
The Deployment Image Servicing and Management (DISM) tool provides another command-line method for installing Hyper-V:
Open Command Prompt as an administrator.
Run the following command:
PowerShell
DISM /Online /Enable-Feature /All /FeatureName:Microsoft-Hyper-V
Restart your computer when prompted.
Installing Hyper-V Server 2
Hyper-V Server is a minimal installation option that provides a dedicated environment for running virtual machines. To install Hyper-V Server, follow these steps:
Check if your computer meets the hardware requirements.
Download the Hyper-V Server installation ISO image.
Create a bootable USB drive or DVD using the ISO image.
Boot your computer from the installation media.
Follow the on-screen instructions to complete the installation.
After installing Hyper-V Server, you can use the Server Configuration tool (Sconfig) to manage the server. To enable Sconfig, open Command Prompt as an administrator and type sconfig2.
Administering Hyper-V with Command-Line Tools
Once Hyper-V is installed, you can leverage PowerShell cmdlets to manage various aspects of your Hyper-V environment. Here are some essential commands:
Basic VM Management
| Command | Description |
Works cited
1. Hyper-V PowerShell Commands: A System Administrator's Guide - SmiKar, accessed on February 11, 2025, https://www.smikar.com/hyper-v-powershell-commands/
2. How to Install Hyper-V in Your Environment - NAKIVO, accessed on February 11, 2025, https://www.nakivo.com/blog/how-to-install-hyper-v/
3. Beginners Guide for Microsoft Hyper-V: How to Install Microsoft Hyper-V with PowerShell - Part 3 - BDRSuite, accessed on February 11, 2025, https://www.bdrsuite.com/blog/beginners-guide-for-microsoft-hyper-v-how-to-install-microsoft-hyper-v-with-powershell-part-3/