From fb377a2aee5e08653e297df0b8c9ba8ffdb27482 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=B3=BB=E7=B5=B1=E7=AE=A1=E7=90=86=E5=93=A1?= Date: Fri, 6 Mar 2026 05:57:25 +0000 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20Service=EF=BC=9AHyper=20V?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Service%EF%BC%9AHyper-V.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Service%EF%BC%9AHyper-V.md diff --git a/Service%EF%BC%9AHyper-V.md b/Service%EF%BC%9AHyper-V.md new file mode 100644 index 0000000..1b74e0d --- /dev/null +++ b/Service%EF%BC%9AHyper-V.md @@ -0,0 +1,37 @@ +### 啟用 KVM + +```powershell +Set-VMProcessor -VMName "" -ExposeVirtualizationExtensions $true +``` + +### 偽裝 MAC 地址 for PVE + +因為虛擬機共用同一張網路卡,為了防止流量進到 PVE 後,不再往虛擬機送,因此需要偽裝 MAC 地址 + +```powershell +Get-VMNetworkAdapter -VMName "" | Set-VMNetworkAdapter -MacAddressSpoofing On +``` + +# 限制虛擬硬碟的讀寫速度(IOPS) + +一個 IOPS 為 8KB / s,如果要限制虛擬硬碟只能使用 100MB / s 的速度,則 IOPS 應該設定為 12800 (100 * 1024 / 8) + +# 加入具 NAT 功能的虛擬交換器 + +加入新的虛擬交換器 + +```powershell +New-VMSwitch -SwitchName "NAT Switch" -SwitchType Internal +``` + +設定交換器的 IP + +```powershell +New-NetIPAddress -IPAddress 192.168.30.1 -PrefixLength 24 -InterfaceAlias "vEthernet (NAT Switch)" +``` + +設定 NAT + +```powershell +New-NetNat -Name "NAT Network" -InternalIPInterfaceAddressPrefix 192.168.30.0/24 +``` \ No newline at end of file