Background
I recently acquired an HP 800G2 PC from my company for just 200 RMB. I decided to utilize it to host VMs for my tech experiments, as running VMs on my home LAN provides me with advantages over remote connections to Azure datacenters, which I typically use.
After installing Hyper-V Server 2019 on the machine, I deployed an Ubuntu Server VM and a Windows 10 VM. In this post, I will share the process and tips for setting up this kind of environment.
Hyper-V Server, Windows Server with Hyper-V Role, or VMWare Esxi
Type 1 or Type 2 Hypervisor
I spent some time studying and making the choice among the host OS. First, there are two types of hypervisors. Type 1 and Type 2. All three products, Hyper-V Server, Windows Server with Hyper-V Role, and Esxi are Type 1 hypervisor. VMWare workstation on the other hand, is Type 2 hypervisor.
Type 1 hypervisor runs directly on the host machine's hardware, while type 2 hypervisor runs on top of an operating system. Type 1 hypervisors are often referred to as bare-metal hypervisors because they operate directly on the host machine's underlying hardware. They are typically used in enterprise-level virtualization environments because of their speed and security. Type 2 hypervisors, on the other hand, are installed on top of an existing operating system and are primarily used for desktop virtualization. They are slower than type 1 hypervisors and less secure but easier to use and install.
There is no difference between VMs running on Hyper-V Server vs Windows Server with Hyper-V Role. Hyper-V Server is a Windows Server Core with Hyper-V Role pre-installed. They are both type 1 hypervisors. The only diffrence is that Hyper-V Server has some other roles removed from the OS, Windows Server has a full list of roles, which in this case, you won't need them.
As stated in the book "Windows Internals", when you install Hyper-V for a Windows Server, or even in Windows 10/11, the host OS itself will also be running on hypervisor just like a VM. So, for anyone that is concerned if Hyper-V Server has better performance than Windows Server with Hyper-V Role, this is false. THEY ARE SAME! VM all runs as Type 1 hypervisor.
Free or Paid
Hyper-V Server 2019: Free
Windows Server 2022 with Hyper-V Role: Paid
VMWare Esxi: Can be free
Last version of Hyper-V Server
Hyper-V Server 2019 is the last version of Hyper-V Server and continues to be supported until 2029. There won't be a Hyper-V Server 2022 or later. Microsoft recommends using Azure Stack HCI, which is also a commercial product. As my goal is not to pay a cent for OS on a 200RMB low end machine, I won't use Azure Stack HCI.
If you really like Hyper-V Server and hate Azure. You can choose Windows Server Core and install Hyper-V Role (but you must pay for it). As described above, there is no diffrence for VMs.
Install Hyper-V Server 2019
Installing Hyper-V Server 2019 is no diffrence from a typical installation of Windows Server Core. I use Rufus (https://rufus.ie/en/)to burn ISO file into a USB drive and install on the machine.
Initial Configuration
Computer Name: This is for remote managing your machine in later step. IP address can't be used for today's Windows management tools. So, you must give the server a name.
Network: Required for remote management
Remote Desktop: Required for remote management
Configure Remote Management: Required for Windows Admin Center and Hyper-V Manager to access remotely
Date and Time: Required for OS to work properly
Download and Install Updates: Make sure your hardware drivers got installed and your OS got latest patch
Enable Remote Management on Client Machine
This is the most important setup in the entire process. If blow up, please watch https://www.youtube.com/watch?v=ZPjtiXB5k5s
On your laptop, or other machine that you will use to manage this server. Run these commands in PowerShell with Admin. Replace the host name, IP, network name, and password for your own values.
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "EDI-800G2HVS"
# Add server IP to host file
Add-Content -Path "C:\Windows\System32\drivers\etc\hosts" -Value "192.168.0.102 EDI-800G2HVS"
# Get current network profile name for next command
Get-NetConnectionProfile
# Set as Private to allow connection
Set-NetConnectionProfile -InterfaceAlias "Wi-Fi" -NetworkCategory Private
Enable-PSRemoting
Get-WSManCredSSP
Enable-WSManCredSSP -Role Client -DelegateComputer "EDI-800G2HVS"
cmdkey /add:EDI-800G2HVS /user: Administrator /pass:*******
Hyper-V Management
Run optionalfeatures
and Install only the Hyper-V Management Tools on your client machine.
You will now be able to add your server and run VMs on it.
Windows Admin Center
For a complete remote management capability, install Windows Admin Center (https://www.microsoft.com/en-us/windows-server/windows-admin-center) on your client machine, then connect to your server.
For example, you can easily make file shares to transfer VM OS install ISO files.
Anduin Xue
说得好。只是对于这种虚拟化来说,ESXI比Windows Server做得好很多。Windows Server一直没有一个特别易用的,像ESXI一样的版本,把所有功能都砍掉,只能用来开VM。听说Azure的人拿走了WinServer的代码,魔改了一遍,弄出来了Azure的Host系统可以这样,但是这个系统并不能在微软外面运行。
普通的场景,我还是认为ESXI或PVE都更加合适一些。
但是,那么这篇博客就没有意义了吗?
并不是!
我最近发现另一个非常有趣的事情就是,Windows On ARM!我买了微软的一台2023年出的DevKit,就是那个小电脑,是ARM架构的。
我发现这个小电脑要想装Linux,需要手写Device tree,非常996。想安装Windows Server,又没有官方的Windows Server版本。我自己在微软内网扒拉,硬装,各种炸。。。
最后我实在不行了,去uupdump,搓了一个 Windows 11的ARM版本,然后……装上去,打开HyperV,再删了所有Windows 11里花里胡哨的功能,然后安装 Windows Admin Center,和你这个方案完全一样。
嘿,你还别说!跑ARM的Linux妥妥的!我亲测了ARM的Jellyfin、GitLab、Nextcloud……
虽然坑多,感觉完成度很低,但是能跑。这可能是这个世界上为数不多的ARM芯片+Windows系统+虚拟化用途的HomeLab了。