Opennebula:运行Winddos虚拟机
Opennebula 也支持Winddos虚拟机,跟着我一步一步完成创建吧
Winddos镜像制作
我们在导入镜像的时候需要注意存储-数据存储-default中的RESTRICTED_DIR
S和SAFE_DIRS
设置,否则会提示
shell
ERROR="Thu Nov 30 23:44:23 2023 : Error copying image in the datastore: Not allowed to copy image from /data/iso/virtio-win.iso, check RESTRICTED_DIRS in your datastore"
下载镜像
-
Windows 10 ISO:www.microsoft.com/en-us/evalc...
-
VirtIO Drivers for Windows
bash
wget -O /var/tmp/virtio-win.iso https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
- OpenNebula Windows VM Contextualization
bash
wget -O /var/tmp/one-context-5.10.0.iso https://github.com/OpenNebula/addon-context-windows/releases/download/v5.10.0/one-context-5.10.0.iso
创建镜像
shell
oneimage create -d 1 --name "Windows 10 ISO" --path /var/tmp/win10-19045.iso --type CDROM
oneimage create -d 1 --name "Virtio Windows Drivers ISO" --path /var/tmp/virtio-win.iso --type CDROM
oneimage create -d 1 --name "ONE Windows Context ISO" --path /var/tmp/one-context-5.10.0.iso --type CDROM
oneimage create -d 1 --name "Windows 10" --type OS --size 60G --persistent
创建模版
template.txt
ini
NAME = "Windows 10 Installation"
MEMORY = "16384"
MEMORY_UNIT_COST = "MB"
CPU = "4"
VCPU = "4"
DISK = [
IMAGE = "Windows 10 ISO",
IMAGE_UNAME = "oneadmin" ]
DISK = [
IMAGE = "Virtio Windows Drivers ISO",
IMAGE_UNAME = "oneadmin" ]
DISK = [
IMAGE = "ONE Windows Context ISO",
IMAGE_UNAME = "oneadmin" ]
DISK = [
DEV_PREFIX = "vd",
IMAGE = "Windows 10",
IMAGE_UNAME = "oneadmin" ]
NIC = [
NETWORK = "vnet",
NETWORK_UNAME = "oneadmin",
SECURITY_GROUPS = "0" ]
NIC_DEFAULT = [
MODEL = "virtio" ]
GRAPHICS = [
LISTEN = "0.0.0.0",
TYPE = "VNC" ]
INPUT = [
BUS = "usb",
TYPE = "tablet" ]
OS = [
BOOT = "disk0" ]
我们创建出模版,如果有不对的选项再通过页面修改即可
shell
onetemplate create template.txt
实例化win虚拟机
-
安装win系统,选择自定义,加载安装驱动(全部安装即可),接下来就可以看到磁盘了,选择下一步安装系统。
-
安装完成后,打开此电脑,安装one-context驱动。打开设备管理器,查看其他设备,选择更新网卡驱动,路径选择virtio-win.iso,继续按照同样方式更新其他的驱动。
-
关机,删除虚拟机。修改"Windows 10"的镜像,"持久化"选择否。之前创建的驱动ISO镜像也可以删除了。
-
更新模版,删除之前的ISO镜像,只保留"Windows 10"的镜像。
-
创建win10虚拟机测试
-
需要自行完成激活,进入设置-系统-远程桌面,开启并添加允许的用户