在 CentOS 8 中使用 KVM 安裝 Windows 10


使用 esxi 的話總覺得有些別扭?故嘗試 KVM,本文使用 CentOS 8 minimal 作為基礎環境。因為懶得截圖,所以就決定不上圖了。

使用阿里雲鏡像

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-8.repo
yum makecache

安裝 cockpit 和 qemu

dnf install cockpit cockpit-machines

啟用 cockpit

systemctl enable --now cockpit.socket

安裝 Winodws 依賴的驅動

dnf install virtio-win

配置虛擬機網絡

創建 Windows 虛擬機並配置 CDROM

隨便使用一個 Windows ISO 都可以,系統里沒有 Windows,隨便選擇一個都可以,我在這里選的是 Fedora 31,創建完系統后不要開機,緊接着需要掛載驅動 ISO 為 CDROM。

掛載 CDROM 在 cockpit 網頁端並不支持,詳見 Option to add/remove CD-ROM device and load/eject ISO

需要手動編輯,假設創建的虛擬機名稱為 win10,則可以通過執行 virsh edit win10 來進行編輯。

在 <disk> 標簽所在的組中新增一個 <disk>

<disk type='file' device='cdrom'> <driver name='qemu' type='raw'/> <source file='/usr/share/virtio-win/virtio-win.iso'/> <backingStore/> <target dev='sda' bus='sata'/> <readonly/> <alias name='sata-cdrom'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk>

安裝 Windows

到了選擇磁盤的那一步會發現沒有磁盤可選,這個時候需要安裝我們掛載的驅動,64 位的話選擇 amd64/win10 就 OK 了。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM