Skip to content

Instantly share code, notes, and snippets.

@ajxchapman
Last active August 20, 2024 19:02
Show Gist options
  • Save ajxchapman/187f8f5220cfc15f703e0019a8fc1f2a to your computer and use it in GitHub Desktop.
Save ajxchapman/187f8f5220cfc15f703e0019a8fc1f2a to your computer and use it in GitHub Desktop.
Install Windows on Digital Ocean droplet

TL;DR

Steps

  • Create a build droplet with 4GB RAM
  • Install QEMU and run the Windows 10 installation ISO
$ apt-get update && apt-get install qemu -y
$ qemu-img create -f raw windows10.img 16G
$ wget https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso
$ qemu-system-x86_64 \
  -m 3G \
  -cpu host \
  -enable-kvm \
  -boot order=d \
  -drive file=Win10.iso,media=cdrom \
  -drive file=windows10.img,format=raw,if=virtio \
  -drive file=virtio-win.iso,media=cdrom \
  -vnc :0
  • Connect via VNC and install Windows 10
  • Install the following drivers from the virtio-win ISO
    • f:\NetKvm\w10\amd64
    • f:\viostor\w10\amd64
  • Continue the Windows 10 installation
  • Power off the QEMU vm at the point the Windows 10 installation requires a reboot
  • On build droplet host the created disk image via a HTTP server
$ python3 -m http.server
  • Create a target droplet with 4GB - 8GB RAM
  • Boot the target droplet into recovery mode by setting Recovery mode to Boot from Recovery ISO
  • SSH into the target droplet
  • Download the Windows 10 QEMU disk image from the build instance and write it to the droplet disk
$ wget -O- http://82.196.0.147:8000/windows10.img | dd of=/dev/vda
$ shutodwn 0
  • Change the target droplet Recovery mode back to Boot from Hard Drive
  • Boot Windows and attach via the web console
  • In a CMD prompt configure IP, RDP and Firewall settings:
$ netsh interface ip set address "connection name" static <IP Address> <Net Mask> <Default Gateway>
$ reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server" /v fDenyTSConnections /t REG_DWORD /d 0 /f
$ netsh advfirewall firewall set rule group="remote desktop" new enable=Yes
  • Connect via RDP
@amjiddader
Copy link

Try using tight vnc , update your windows...

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