Skip to content

Instantly share code, notes, and snippets.

@fguisso
Created April 9, 2023 15:38
Show Gist options
  • Save fguisso/08428cb4793be7442e3c209b00caf59d to your computer and use it in GitHub Desktop.
Save fguisso/08428cb4793be7442e3c209b00caf59d to your computer and use it in GitHub Desktop.
Install Win10 in proxmox
#!/bin/bash

# Specify the Windows 10 ISO to download
WIN10_ISO_URL="https://software-download.microsoft.com/download/pr/19043.1165.210529-1541.co_release_CLIENT_CONSUMER_x64FRE_en-us.iso"

# Download the Windows 10 ISO
wget -O /var/lib/vz/template/iso/Windows10.iso $WIN10_ISO_URL

# Create a new VM in Proxmox
qm create 9000 --name Windows10 --memory 4096 --cpu host --net0 virtio,bridge=vmbr0

# Add a SATA hard drive to the VM
qm set 9000 --scsihw virtio-scsi-pci --scsi0 /var/lib/vz/images/9000/vm-9000-disk-0.qcow2,ssd=1,size=100G

# Attach the Windows 10 ISO to the VM's CD/DVD drive
qm set 9000 --ide2 /var/lib/vz/template/iso/Windows10.iso,media=cdrom

# Set the VM to use the "kvm64" CPU type
qm set 9000 --cpu kvm64

# Enable the QXL display driver for improved performance
qm set 9000 --vga qxl

# Add a Spice console to the VM for remote desktop access
qm set 9000 --spicehw virtio-vga --spiceport 5900 --password mypassword

# Set the SMBIOS UUID to a unique value for each VM
qm set 9000 --smbios1 uuid=$(uuidgen)

# Start the VM
qm start 9000

This script first downloads the Windows 10 ISO image from the Microsoft website using the URL provided in the Proxmox wiki. It then creates a new VM in Proxmox with 4GB of memory and a 100GB virtual hard drive.

The script sets the CPU type to "kvm64," which is recommended for better performance on modern CPUs. It also enables the QXL display driver for improved graphics performance, adds a Spice console for remote desktop access, and sets the SMBIOS UUID to a unique value for each VM.

Please note that you should replace "mypassword" in the --password parameter with a secure password of your choice. Additionally, you may need to adjust the VM parameters, such as CPU, RAM, and storage allocation, based on your specific needs.

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