Created
April 28, 2023 10:04
-
-
Save augustin64/58dcee79a9d9c5bebe607bb39a606f03 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
MEMORY=8192 | |
CORES=4 | |
DISK_IMAGE=windows10.qcow2 | |
LIVE_CD=Win10_French_x64.iso # Download this from https://www.microsoft.com/fr-fr/software-download/windows10 | |
create () { | |
# Will create a blank disk of 64G maximum capacity | |
# It does not require 64G of disk space on your computer, but just creates a file that can contain up to 64G in a VM | |
qemu-img create -f qcow2 "$DISK_IMAGE" 64G | |
} | |
install () { | |
# Launch the actual installation of windows, you need to go through it manually | |
qemu-system-x86_64 \ | |
-m $MEMORY \ | |
-boot d \ | |
-net nic \ | |
-smp $CORES \ | |
-net user \ | |
-enable-kvm \ | |
-hda "./$DISK_IMAGE" \ | |
-cdrom "./$LIVE_CD" | |
} | |
start () { | |
# start the created VM | |
qemu-system-x86_64 \ | |
-m $MEMORY \ | |
-boot d \ | |
-net nic \ | |
-smp $CORES \ | |
-net user \ | |
-enable-kvm \ | |
-hda "./$DISK_IMAGE" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
First run:
Once this has exited, start the VM using that command each time:
source ./windows_vm.sh start