Run the following command to download the installer:
wget https://raw.githubusercontent.com/emuhib/windows.server.DO/main/windows-server-autoinstaller.shAfter downloading, give the file permission to be executed:
chmod +x windows-server-autoinstaller.shRun the installer with the following command:
./windows-server-autoinstaller.shAfter the installer is complete, run QEMU to start Windows Server. Replace xx with the version of Windows you selected (e.g., windows10):
qemu-system-x86_64 \
-m 4G \
-cpu host \
-enable-kvm \
-boot order=d \
-drive file=windowsxx.iso,media=cdrom \
-drive file=windowsxx.img,format=raw,if=virtio \
-drive file=virtio-win.iso,media=cdrom \
-device usb-ehci,id=usb,bus=pci.0,addr=0x4 \
-device usb-tablet \
-vnc :0Note: Press Enter twice to continue.
Once QEMU is running, follow these steps to access and configure the Windows Server:
- Enable Remote Desktop in Windows Server settings.
- Disable CTRL+ALT+DEL in Local Security.
- Set Windows Server to never sleep..
- Disable Security Prevent Logon Blank Pasword in Local Security (if your windows doesn't use Password)
After configuration is complete, compress the Windows Server image. Replace xxxx with the version of Windows you selected (e.g., windows10):
dd if=windowsxxxx.img | gzip -c > windowsxxxx.gzInstall Apache to serve the file over the web:
apt install apache2Allow Apache access through the firewall:
sudo ufw allow 'Apache'Copy the compressed Windows Server file to the Apache web directory:
cp windowsxxxx.gz /var/www/html/Once the file is moved, access it through your droplet's IP address:
http://[IP_Droplet]/windowsxxxx.gz
Example:
http://188.166.190.241/windows10.gz
To run Windows Server on a new droplet, use the following command. Replace LINK with the download link for the previously compressed file:
wget -O- --no-check-certificate LINK | gunzip | dd of=/dev/vda- Make sure to replace the placeholder xxxx with the correct Windows version.
- Don’t forget to replace LINK with the actual URL of your file.