Desription:
Set up and simulate a mini data center on your laptop using Hyper-V. Learn to configure a local internal network, deploy and manage virtual machines, and experiment with server setups without dedicated hardware. Perfect for someone that is exploring virtualization and IT infrastructure basics as well as geeks that want cheap home lab.
Tech Stack:
Windows Hyper-V, Ubuntu Server, Windows PowerShell
Features:
- Local network simulation within Hyper-V
- Deployment of an Ubuntu Server virtual machine (VM)
- Resource allocation and management for VMs
- Network and system monitoring setup on a local environment
Learning Path:
- Virtualization concepts and Hyper-V basics
- Setting up virtual networks (Internal/private)
- Installing and configuring an Ubuntu Server VM
- Managing resources and snapshots in Hyper-V
- Understanding basic network configurations for simulated environments
Goal:
By the end of this guide, youâll have a functioning âdata centerâ simulation running on your laptop, providing foundational skills for working with virtual machines and network environments.
Table of Contents
Table of ContentsPart 1: Setting up Hyper-V and a Local NetworkStep 1: Enable Hyper-V on WindowsStep 2: Open Hyper-V ManagerStep 3: Create a Virtual Switch for Internal NetworkingStep 4: Configure the Host's IP Address on the Internal Network Part 2: Create and Configure an Ubuntu Server VMStep 5: Create a New Virtual MachineStep 6: Start and Install Ubuntu ServerStep 7: Configure Static IP for Ubuntu ServerPart 3: Managing Resources the Virtualized EnvironmentStep 8: Managing VM Resources in Hyper-VStep 9: Taking Snapshots for BackupConclusion
Part 1: Setting up Hyper-V and a Local Network
Step 1: Enable Hyper-V on Windows
To get started, ensure that Hyper-V is enabled on your laptop. Hyper-V is a built-in feature in Windows 10/11 Pro, Enterprise, and Education editions. It is also available on any version of Windows Server.
- Open Control Panel > Programs > Turn Windows features on or off.
- Locate and check Hyper-V along with Hyper-V Management Tools and Hyper-V Platform.
- Click OK, and restart your computer when prompted.
Step 2: Open Hyper-V Manager
After the restart, launch Hyper-V Manager:
- Press
Win + S
, type Hyper-V Manager, and open the application
- Click on Connect to Server and select Local computer then press OK
Step 3: Create a Virtual Switch for Internal Networking
To simulate a data center, youâll set up an internal network that allos communication between your virtual machines (VMs) as well as between your laptop to VMs.
- In Hyper-V Manager, click on Virtual Switch Manager from the right-hand menu.
- Select Internal, and click Create Virtual Switch
- Name the switch (e.g.,
Internal
) and leave other options as default. Click OK.
- In case of connecting VMs to external network such as Wi-Fi for Internet access, add another virtual network swtich with type of External.
- Select network adapters you want this virtual network switch to connect with. In this guide Iâm going to use Wi-Fi network adapters available on my laptop.
- Name the switch (e.g.
EXTERNAL-WIFI
). Click Apply.
Step 4: Configure the Host's IP Address on the Internal Network
Once the internal virtual switch is set up, we can setup a static IP address on our host machineâs virtual network adapter to establish communication between the host and virtual machines.
- Open Control Panel > Network and Internet > Network and Sharing Center. Click Change adapter settings from the left-hand menu.
- Youâll see a new network adapter corresponding to the internal virtual switch (e.g.,
vEthernet (Internal)
).
- Right-click the adapter and select Properties. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
- Choose Use the following IP address, and enter the following:
- IP address:
10.32.1.1
(or any address range that not used by other interface like Wi-Fi) - Subnet mask:
255.255.255.0
(this is/24
in slash notation which mean can afford to have 256 host connected which more than enough for local VM) - Leave the
Default gateway
blank
Click OK to apply the settings.
- Open a command prompt and run
ipconfig
. Look for the new virtual adapter, and ensure the IP address is correctly assigned.
Weâll leave test connectivity to VMs later after we set up the VM. Make sure the VM is attached with
Internal
network adapter and set the IP address manually using same range.Part 2: Create and Configure an Ubuntu Server VM
Step 5: Create a New Virtual Machine
- Prepare an Ubuntu Server ISO. Weâre going to download the latest ISO from official Ubuntu website: Ubuntu Downloads.
- Open Hyper-V Manager. In the right-hand panel, click New > Virtual Machine to launch the New Virtual Machine Wizard. Click Next to proceed with the setup.
- Enter a name for the virtual machine (e.g.,
Ubuntu-Server
). Specify the location where you want to store the VM files or leave it at the default.
- Choose Generation 2 for most modern Linux distributions, as it supports UEFI and secure boot features. If unsure, you can select Generation 1 for broader compatibility.
- Allocate memory for the VM (e.g., 2048 MB or more, depending on your systemâs resources and requirements). Check Use Dynamic Memory since weâre running this VM on laptop that have limited memory capacity.
- On Configure Networking, leave it Not Connected that weâll going to set it up after we create the VM before running later.
- Choose Create a virtual hard disk and specify:
- Name: (e.g.,
Ubuntu-Server.vhdx
). - Size: Allocate at least 20 GB (adjust based on your requirements).
- Choose Install an operating system from a bootable CD/DVD ROM. Select Image file (.iso) and browse to the Ubuntu Server ISO you downloaded earlier.
- Review the configuration summary and click Finish to create the virtual machine.
- Right click on the VM we created (
ubuntu-server
) and click Settings.
- Click Add Hardware and select Network Adapter. Click Add.
- Choose
Internal
on Virtual Switch. Then click Apply.
- Add another virtual switch and choose your
EXTERNAL-WIFI
. Click Apply then click OK.
Step 6: Start and Install Ubuntu Server
- In Hyper-V Manager, right-click the newly created VM and select Start. Once started, click Connect to open the VM console.
Â
- The VM will boot into the Ubuntu Servr installation wizard. Follow the prompts to set up Ubuntu Server.
- Choose your language and keyboard layout.
- Configure the network interface (you can manually set a static IP later if needed). For now we just let the
Internal
network interface disabled and let theEXTERNAL-WIFI
network interface to be automatic. - Partition the disk (use the default options unless you have specific requirements).
- Create a user account and set up SSH for remote access.
- Once the installation is complete, remove the ISO from the VMâs settings to avoid booting into the installer again. Restart the VM to complete the process.
Step 7: Configure Static IP for Ubuntu Server
To make so we can communicate with VM via internal network, configure a static IP for the Ubuntu Server.
- Log in to the server using the credentials you created during installation.
- Run command:
ip -br address
, you will see the interface name of theInternal
andEXTERNAL WI-FI
Here we see the
eth1
that already have IP address, which it is the EXTERNAL-WiFi
interface we enabled at installation. Meanwhile the eth0
is the Internal
interface that we will set as static IP. - Edit the Netplan configuration:
- Run the command:
- Update the file with the following. As you can see we set the
eth0
interface which corresponding - Apply the configuration by run following command:
- Test the network configuration by pinging the host machine
sudo vim /etc/netplan/01-netcfg.yaml
network: version: 2 ethernets: eth0: addresses: - 10.32.1.2/24 eth1: dhcp4: true
sudo netplan apply
ping 10.32.1
(Optional) If pinging to host network not works, perhaps you must allow ICMP on your Windows firewall.
Open Windows Defender Firewall and select Advanced Settings in the sidebar. Switch to Inbound Ulres via the Getting Started page on the sidebar. Find the rule named âCore Networkign Diagnostics - ICMP Echo Request (ICMPv4-In)â with Profile of âPrivate,Publicâ or âDomainâ if youâre on a corporate domain. Right-click the rule and Enable Rule. Do the same for the IPv6 version.
The ping from
Ubuntu-Server
to Windows host IP address should works.$ ping 10.32.1.1 PING 10.32.1.1 (10.32.1.1) 56(84) bytes of data. 64 bytes from 10.32.1.1: icmp_seq=1 ttl=128 time=0.281 ms 64 bytes from 10.32.1.1: icmp_seq=2 ttl=128 time=0.389 ms 64 bytes from 10.32.1.1: icmp_seq=3 ttl=128 time=0.784 ms 64 bytes from 10.32.1.1: icmp_seq=4 ttl=128 time=0.451 ms 64 bytes from 10.32.1.1: icmp_seq=5 ttl=128 time=0.685 ms 64 bytes from 10.32.1.1: icmp_seq=6 ttl=128 time=0.559 ms ^C --- 10.32.1.1 ping statistics --- 6 packets transmitted, 6 received, 0% packet loss, time 5112ms rtt min/avg/max/mdev = 0.281/0.524/0.784/0.171 ms
The same also works if we ping from the Windows host to
Ubuntu-Server
:> ping 10.32.1.2 Pinging 10.32.1.2 with 32 bytes of data: Reply from 10.32.1.2: bytes=32 time<1ms TTL=64 Reply from 10.32.1.2: bytes=32 time<1ms TTL=64 Reply from 10.32.1.2: bytes=32 time<1ms TTL=64 Reply from 10.32.1.2: bytes=32 time<1ms TTL=64 Ping statistics for 10.32.1.2: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
Your Ubuntu Server VM is now installed, connected to the internal network, and ready for further configuration. In the next part, weâll explore managing resources and monitoring the virtualzied environment.
Part 3: Managing Resources the Virtualized Environment
Once your VMs is up and running, the next step is to learn how to efficiently manage resources and monitor your virtualized environment. This includes allocating CPU and memory resoruces, and taking snapshots.
Step 8: Managing VM Resources in Hyper-V
- Adjust CPU and Memory Allocation.
- Open Hyper-V Manager
- Before set the resources allocation, you need to shut down your VM. Right-click the VM and select Turn offâŚ
- Right-click the Ubuntu VM and select Settings.
- Under Processor, adjust the number of virtual processors based on your laptopâs capabilities. A single processor is sufficient for basic tasks; increase it if your server needs more computing power.
- Under Memory, increase or decreae the RAM allocation to optimize performance. Ensure you donât allocate more memory than your host systen can support. You can also use Dynamic Memory capability from Hyper-V to set minimum request allocated and maximum limitation of memory to this VM. If all done, click Apply.
- Configure Virtual Hard Disk
- To expand the VMâs storage, go to Hard Drive under IDE Controller
- Select the VMâs hard disk (
.vhdx
file). Click Edit - The
.vhdx
file is automatically selected on Locate disk page and cannot be changed. On Choose Action, you can select either Compact to reduceing size or combining elementr to optimize storage, Convert to changing data or files format, or Expand to increase the capacity of the virtual hard disks. Letâs choose Expand for demonstration. - On the next page, you will input the new size of the virtual hard disk you want. The size must be greater than current size which mean the virtual hard disk canât be shrink in any case. Letâs input some reasonable number.
- Review the summary and click Finish.
- Set automatic start and stop actions
- In the Settings menu for the VM, navigate to Automatic Stop Action
- Configure the VM to Save the VM state or Turn off the VM when the host shuts down. The save VM state is useful so the works being done on VM will be continue when VM start again. It is done by using the disk space to save VM memory
Click Apply
Step 9: Taking Snapshots for Backup
Snapshots allow us to save the state of the VM at a specific point in time, making it easy to roll back if needed.
- Create a Snaphot
- In Hyper-V Manager, right-click the UBuntu VM and select Checkpoint. It will create checkpoint at the time when it clicked.
- Name the snapshot for referece (e.g.,
Network Configured
or any description to explain the state of VM)
- Restore a Snapshot
- To revert to a previous state, select the VM, click Checkpoints, and choose the desired snapshot
- Click Apply to restore the VM to that state. This will delete all files made after the snapshot or retrieve any files that exist at the snapshot time including any configurations.
Conclusion
This guide helps you transform your laptop into a fuctional mini data center using Hyper-V, providing a hands-on approac to learnign virtualization and IT infrastructure. By following the steps, youâll gain practical experience in setting up virtual networks, deploying and configuring an Ubuntu Server virtual machine, and simulating server environments â all without dedicated hardware. This is ideal for beginners exploring the foundations of system administration or enthusiasts building cost-effective home labs. Mastering these skills lays the groundwork for advanced IT infrastructure projects and virtualization management. đ§