Skip to content

Instantly share code, notes, and snippets.

@fsodogandji
Last active September 26, 2023 17:53
Show Gist options
  • Save fsodogandji/0053dd6dcde60686faf0557f363e8096 to your computer and use it in GitHub Desktop.
Save fsodogandji/0053dd6dcde60686faf0557f363e8096 to your computer and use it in GitHub Desktop.
qemu windows
#!/bin/bash
wget -c https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.185-2/virtio-win-0.1.185.iso
wget -c https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO
apt install -y software-properties-common
add-apt-repository multiverse
apt install -y qemu ovmf
#qemu-img create -f qcow2 windows_server_2016.qcow2 30G
qemu-img check windows_server_2016.qcow2
qemu-img info windows_server_2016.qcow2
qemu-system-x86_64 \
-cpu host\
-enable-kvm \
-machine accel=kvm \
-no-shutdown \
-name windows_2016 \
-m 32G \
-smp 10 \
-drive file=windows_server_2016.qcow2,index=0,if=ide,cache=writeback \
-drive file=Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO,index=1,media=cdrom \
-drive file=virtio-win-0.1.185.iso,index=2,media=cdrom \
-boot menu=on \
-vnc 0.0.0.0:0 \
-drive if=pflash,format=raw,readonly,file=/usr/share/OVMF/OVMF_CODE.fd \
-drive if=pflash,format=raw,file=./OVMF_VARS.fd \
@francisuk1989
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment