Created
November 15, 2020 07:59
-
-
Save oBuTr471b/f15c489dab44e57f3f457cf132ba57b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In The Name Of Allah . | |
# -- --- ---- -- ----- - | |
# Fri Nov 13 04:40:22 2020 | |
# Written By : zer0err0r . | |
# ======= == = ========= = | |
# 12, VirtIO Windows LAB . | |
# Defining variables : | |
vm=win1 | |
virsh='virsh --connect qemu:///system' | |
virt_install='virt-install --connect qemu:///system' | |
# Installing virtio driver : | |
if rpm -qa | grep virtio-win; then :; else sudo dnf install -y virtio-win; fi | |
# Creating a new volume : | |
$virsh vol-create-as my_pool $vm.qcow2 40G --format qcow2 | |
# Creating the VM : | |
$virt_install \ | |
--name=$vm \ | |
--ram=2048 \ | |
--vcpus=2 \ | |
--network bridge=br0,model=virtio \ | |
--graphics vnc \ | |
--noautoconsole \ | |
--noreboot \ | |
--os-variant win10 \ | |
--disk "vol=my_pool/$vm.qcow2",bus=virtio \ | |
--disk ~/win10.iso,device=cdrom,boot.order=1 \ | |
--disk /usr/share/virtio-win/virtio-win.iso,device=cdrom,boot.order=2 \ | |
--boot cdrom | |
<<useful_notes | |
# Note 1 : | |
= [--boot] is used because of we didnt issue any booting[installing] option , | |
= I mean one of [--location, --cdrom, --pxe, --import, --boot] . | |
# Note 2 : | |
= Without [boot.order], We should arrange [--disk] lines in a specific order . | |
# Note 3 : | |
= Unlike linux, I think that we should specify [model=virtio, bus=virtio] for windows , | |
= I mean even with using [--os-variant win10] . | |
useful_notes | |
# ===== == ==== ======== = | |
# Peace Be Up0n Muhammed . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment