Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows Server 系統教學 >> Server 2008

OpenStack 建立 Windows Server 2008 映像檔完整步驟:KVM/QEMU、VirtIO 驅動注入、VNC 安裝流程

編輯:Server 2008

在 Ubuntu 12.04 (KVM/QEMU) 環境建立 Windows Server 2008 映像檔供 OpenStack Glance 使用。關鍵點:預先建立 qcow2 虛擬磁碟、掛載 VirtIO ISO 注入半虛擬化驅動 (磁碟/網路)、VNC 圖形安裝、安裝過程手動載入 VirtIO 驅動讓安裝程式辨識磁碟與網卡。

環境與工具

  • 宿主機:Ubuntu 12.04 LTS、KVM/QEMU、libvirt
  • VirtIO 驅動 ISO:virtio-win-0.1-30.iso (Fedora 專案提供)
  • Windows Server 2008 安裝 ISO:windows2008.iso
  • 目標映像檔:windowsserver.img (qcow2, 20 GB)

建立步驟

  1. 建立虛擬磁碟:
    kvm-img create -f qcow2 windowsserver.img 20G
  2. 啟動安裝 VM (掛載雙 ISO、VirtIO 裝置、VNC 顯示):
    kvm -m 1024 -cdrom windows2008.iso -drive file=windowsserver.img,if=virtio -boot d -drive file=virtio-win-0.1-30.iso,index=3,media=cdrom -device virtio-net-pci -net nic -net user -nographic -vnc :5
  3. 另開終端機連線 VNC:vncviewer localhost:5
  4. 安裝程式啟動 → 「載入驅動程式」 → 選擇第二個 CD-ROM (VirtIO ISO) → 依序展開 viostor → 2k8 (或 wlh/win7) → x86 → 選擇 viostor.inf → 磁碟出現 → 繼續安裝
  5. 同樣方式載入網卡驅動:NetKVM → 2k8 → x86 → netkvm.inf
  6. 完成安裝、關機
  7. 映像檔 windowsserver.img 即可上傳至 Glance:
    glance image-create --name "Windows Server 2008" --disk-format qcow2 --container-format bare --file windowsserver.img --is-public true

Windows 安裝載入驅動程式畫面

選擇 VirtIO ISO 磁碟機

最佳化建議:
- 安裝完成後在客體內安裝 qemu-guest-agent (Windows 版) 以支援 OpenStack 註入密碼、關機、快照等功能
- 使用 virt-sysprep 通用化映像檔 (移除 SID、重設網路、清理日誌) 供多租戶部署
- 生產環境建議使用 packer + ansible 自動化建構映像檔管線,確保可重現、可審計
Copyright © Windows教程網 All Rights Reserved