Installing Windows 10 on any VPS

Using rescue mode or by booting from a live ISO, you can install Windows 10 to any KVM VPS - even if curl and wget aren't present on the rescue system!

0. If your rescue system has curl or wget skip to 2b.

1. If you don't have wget or curl then copy/paste the following into terminal first:

This will create a temporary command called download which will download the file using nothing but bash magic!

#!/bin/bash
download() {
  read proto server path <<< "${1//"/"/ }"
  DOC=/${path// //}
  HOST=${server//:*}
  PORT=${server//*:}
  [[ x"${HOST}" == x"${PORT}" ]] && PORT=80

  exec 3<>/dev/tcp/${HOST}/$PORT

  # send request
  echo -en "GET ${DOC} HTTP/1.0\r\nHost: ${HOST}\r\n\r\n" >&3

  # read the header, it ends in a empty line (just CRLF)
  while IFS= read -r line ; do 
      [[ "$line" == $'\r' ]] && break
  done <&3

  # read the data
  nul='\0'
  while IFS= read -d '' -r x || { nul=""; [ -n "$x" ]; }; do 
      printf "%s$nul" "$x"
  done <&3
  exec 3>&-
}

2a. Command: Without wget or curl:

download http://osimage.dah85.com/Win10_20H2_v2_English_x64-virtio.gz | gunzip | dd of=/dev/vda

2b. Command: With wget:

wget -O- http://osimage.dah85.com/Win10_20H2_v2_English_x64-virtio.gz | gunzip | dd of=/dev/vda

3. Next:

Default login details: "User" and "Dah85.com" (Username: User Password: Dah85.com)
Be sure to change that!
Administrator account has been disabled.

4. Reboot and should be in Windows 10

TODO: The disk image is 20GB, so you will want to extend your partition within Windows to use your entire drive..
Create a new user ASAP and delete the default "User" account for extra security. Windows requires activation.

Here's a clean ISO that I made for Windows 10 with virtio folder on the disc. I created the Windows 10 disk image by using this ISO to create the master copy. The virtio drivers have all been installed. Nothing else done.

Notes:

This will take about an hour to download/unzip/write to disk, so it's quite normal for it to appear to be downloading slowly for some time especially during the final part of the download. When using the bash 'download' command, there will be no output on the screen so be sure to not let the SSH session time out, or you could fork the command by adding & to the end of it (not recommended).