Computer >> Hướng Dẫn Máy Tính >  >> Hệ Thống >> Windows 10

Cài đặt VMWare ESXi trong máy ảo Hyper-V

Mình muốn cài VMWare ESXi trong máy ảo Hyper-V chạy trên Windows 10 cho homelab. Hyper-V và VMWare ESXi hỗ trợ nested virtualization nên kịch bản này khả thi (dù không được hỗ trợ chính thức). Tuy nhiên có một số lưu ý khi cài ESXi trên Hyper-V.

Trong image ESXi không có driver cho virtual network adapter Hyper-V, NIC này không được VMware hỗ trợ (không trong VMware Hardware Compatibility List — HCL). Vì vậy trước khi cài VMWare ESXi trên VM, cần slipstream driver cho Hyper-V network adapter (net-tulip) vào image cài ESXi.

Net-tulip là driver cộng đồng DECchip 21140 Ethernet để chạy ESXi làm VM trên Microsoft Hyper-V. Hỗ trợ tất cả phiên bản ESXi lên đến 6.5.

Nếu ESXi installer không tìm thấy network adapter, báo lỗi và ngăn cài đặt:

No Network Adapters. No network adapters were detected. Either no network adapters are physically connected to the system, or a suitable driver could not be located. A third-party driver may be required.

Cài đặt VMWare ESXi trong máy ảo Hyper-V

Để thêm driver net-tulip vào image ESXi, cài module VMWare PowerCLI.

Thêm net-tulip vào image dùng PowerShell cmdlets từ VMware.ImageBuilder module (Add-EsxSoftwareDepot, Add-EsxSoftwarePackage, Export-EsxImageProfile). Phải tải image ESXi và driver net-tulip thủ công (https://vibsdepot.v-front.de/depot/bundles/net-tulip-1.1.15-1-offline_bundle.zip).

Cách dễ nhất: dùng module sẵn ESXi-Customizer-PS (đã thảo luận trong bài inject driver vào image ESXi).

Tải phiên bản mới ESXi-Customizer-PS 2.8.1 từ GitHub (https://github.com/VFrontDe/ESXi-Customizer-PS/blob/master/ESXi-Customizer-PS.ps1). Phiên bản này hỗ trợ ESXi 7.0 và 6.7 hiện tại.

Hiển thị danh sách phiên bản ESXi có sẵn tải:

.\ESXi-Customizer-PS-v2.8.1.ps1 -sip –ozip

Trường hợp này tải image số 203 (ESXi-6.0.0-20170604001-standard). Nhập 203 Enter.
Cài đặt VMWare ESXi trong máy ảo Hyper-V

Rất tiếc, không chạy được ESXi 7.0 và 6.5 mới nhất trên Hyper-V. Tất cả phiên bản ESXi hiện tại chặn legacy Hyper-V virtual network adapter load driver. Phiên bản ESXi cao nhất boot đúng với driver Net-tulip là ESXi-6.0.0-20170604001 Build 5572656. Dù ESXi-Customizer-PS 2.8.1 cho phép làm việc với image ESXi 7.0 và tích hợp driver Net-tulip, installer không load driver và không thấy Hyper-V virtual network adapter.

Chờ script tải file ZIP image ESXi về thư mục hiện tại.

Tích hợp net-tulip vào ZIP image và xuất ra ISO, chạy:

.\ESXi-Customizer-PS-v2.8.1.ps1 -iZip "C:\Ps\ESXi-6.0.0-20170604001-standard.zip" -vft -load net-tulip

This is ESXi-Customizer-PS Version 2.8.1 ... Adding base Offline bundle ... [OK] Connecting the V-Front Online depot ... [OK] Getting Imageprofiles ... [OK] Using Imageprofile ESXi-6.0.0-20170604001-standard ... Load additional VIBs from Online depots ... Add VIB net-tulip 1.1.15-1 [New AcceptanceLevel: CommunitySupported] [OK, added] Exporting the Imageprofile to 'C:\PS\ESXi-6.0.0-20170604001-standard-customized.iso'. Please be patient ... All done.

Cài đặt VMWare ESXi trong máy ảo Hyper-V

Tùy chọn -vft nghĩa là tải driver VIB mới nhất từ kho V-Front online.

Đã có ISO cài ESXi. Tạo VM mới trên Hyper-V host với cài đặt:

  • Tạo VM Generation 1;
    Cài đặt VMWare ESXi trong máy ảo Hyper-V
  • Ít nhất 2 vCPUs;
  • Xóa Network Adapter mặc định trong properties VM, thêm Legacy Network Adapter;
    Cài đặt VMWare ESXi trong máy ảo Hyper-V
  • Cho phép Nested virtualization: Set-VMProcessor -VMName test-esxi1 -ExposeVirtualizationExtensions $true
  • Mount ISO ESXi vào VM.

Boot VM từ image cài ESXi, lỗi video adapter không tương thích VMkernel:

Shutting down firmware services… Relocating modules and starting up the kernel…

Cài đặt VMWare ESXi trong máy ảo Hyper-V

Để bỏ qua và tiếp tục cài ESXi, nhấn TAB khi boot VM thêm tùy chọn:

ignoreHeadless=TRUE
Cài đặt VMWare ESXi trong máy ảo Hyper-V

ESXi installer kiểm tra hardware, phát hiện network card, đề nghị tiếp tục cài image ESXi trên ổ ảo.
Cài đặt VMWare ESXi trong máy ảo Hyper-V

Làm theo wizard cài VMWare ESXi (các bước chi tiết trong bài "How to Install and Configure VMWare Hypervisor?").

Sau cài xong, restart VM nhấn Shift+O khi chọn boot option ESXi. Cũng chỉ định boot không kiểm tra videocard. Gõ ignoreHeadless=TRUE cuối dòng Enter.
Cài đặt VMWare ESXi trong máy ảo Hyper-V

Để không làm mỗi lần boot, đổi cấu hình ESXi:

  1. Sau boot ESXi, nhấn F2 nhập pass root;
  2. Chọn Troubleshooting Options → Enable ESXi Shell trong DCUI ESXi;
    Cài đặt VMWare ESXi trong máy ảo Hyper-V
  3. Mở console ESXi: Alt+F2;
  4. Chạy lệnh: Esxcfg-advcfg -k TRUE ignoreHeadless
    Cài đặt VMWare ESXi trong máy ảo Hyper-V

Đóng console Alt+F2. Cấu hình network cho ESXi host trong DCUI và restart VM. Đảm bảo ESXi boot đúng và kết nối được qua vSphere Web Client.
Cài đặt VMWare ESXi trong máy ảo Hyper-V

Đã demo chạy ESXi trong VM Hyper-V. Cấu hình không được hỗ trợ chính thức, nhưng giúp làm việc với ESXi phiên bản cũ trong sandbox trên máy Windows 10 cá nhân.