Downloads
Windows Server 2016 trial iso
https://software-download.microsoft.com/download/pr/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO
or
http://download.microsoft.com/download/6/2/A/62A76ABB-9990-4EFC-A4FE-C7D698DAEB96/9600.17050.WINBLUE_REFRESH.140317-1640_X64FRE_SERVER_EVAL_EN-US-IR3_SSS_X64FREE_EN-US_DV9.ISO
virtIO Drivers (windows x64)
stable-virtio/virtio-win.iso
ADK for new version of DISM
https://docs.microsoft.com/en-us/windows-hardware/get-started/adk-install
Requirements
A VPS with KVM via VNC or similar, not OpenVZ.
If you require virtio drivers (often the case) you also need a Windows Machine to modify boot.wim for adding the drivers.
References
A working GRUB entry for Windows Installer by Will Haley
menuentry "Windows 10 Installer" {
insmod ntfs
search --set=root --file /bootmgr
ntldr /bootmgr
boot
}
How to add virtio drivers to Windows Installer with DISM on Windows (in case you need it)
- Install ADK from Download link above (for new version of DISM)
- Download the Windows ISO
- Mount or extract the ISO to copy boot.wim from /sources/boot.wim to your preferred working directory
- Create a folder where you will mount boot.wim, eg C:/mount
- Open CMD with Administrator Privileges
- Mount the boot.wim with DISM /mount-image /imagefile:/path/to/boot.wim /index:2 /mountdir:C:/mount
- Put the folder with your drivers into C:/mount/sources/<your folder>
- Unmount boot.wim and commit changes with DISM /unmount-image /mountdir:C:/mount /commit
- Where ever you put your boot.wim before mounting has now been modified with your changes
Steps on your target system
- (optional) Install some linux operating system with grub (eg. Debian)
- or create a grub partition with grub-install from a live boot or rescue mode
Creating the Windows Installer Partition
- Boot into a rescue system or live boot (eg. SystemRescueCd or Debian Live)
- Change your partitions to make about 8 GB free space for a new NTFS partition which will be the Windows Installer (eg. gparted or fdisk)
- Set a “boot” flag on your new 8 GB NTFS partition
- In case you don’t know already, type lsblk to show your partitions and locate your new 8 GB partition. Mine is called /dev/sda3
- mkfs.ntfs /dev/sda3 (maybe use –quick option)
Transfer Windows ISO and boot.wim
Note: Instead of doing these steps you could also just upload the ISO contents directly to your 8GB NTFS partition including the modified boot.wim which goes here: /sources/boot.wim
- Leave rescue and boot back into Debian
- Put your modified boot.wim and Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO in /root.
- apt-get install ntfs-3g -y
- Mount your 8 GB ntfs partition mkdir /mnt/winboot && mount -t ntfs-3g /dev/sda3 /mnt/winboot
- Wait until the Windows iso is fully transferred then do mkdir /mnt/winiso && mount -o loop /root/Windows_Server_2016_Datacenter_EVAL_en-us_14393_refresh.ISO /mnt/winiso
- Copy the Windows iso contents to your 8 GB partition with cp -rv /mnt/winiso/* /mnt/winboot
- Replace boot.wim cp /root/boot.wim /mnt/winboot/sources/boot.wim confirm overwrite if required
Adding Windows Installer to GRUB2
- (optional) Type os-prober you should see something like this /dev/sda3:Windows Recovery Environment (loader):Windows:chain
- Edit /boot/grub/grub.cfg and add snippet references above, might need to mount your grub partition first.
- or enter the commands referenced above directly into grub rescue
Hint: If Windows 2016 Installer fails with System Thread Exception try Windows 2012 instead.