NOTE: This Gist concerns the old Linode KVM Beta, NOT the current Manager. Please see linode/docs#501 (comment) for more up-to-date instructions.
You will need:
- Windows Server 2012 R2 iso. Obtain from MSDN
- A server with libvirt/virt-manager/KVM/etc set up.
- Fedora-sourced Windows virtio drivers: https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/archive-virtio/virtio-win-0.1.103-2/virtio-win-0.1.103.iso
- A Linode 1GB in the KVM beta, booted into Rescue mode, with a 20GB(20480MB) "raw" image.
On the KVM source, run the following to create a VM:
virt-install --name=Winode --controller type=scsi,model=virtio-scsi --disk path=/dev/LVM/Winode,bus=scsi --graphics spice --vcpus=1 --ram=1024 --network bridge=br1 --os-type=windows --boot cdrom --location=/data/software/OSes/Windows\ Server\ 2012\ R2\ Update\ x64.iso
Assumptions are made about the path of an existing LVM device and the iso location. Open virt-manager. Add a second IDE CDROM device pointing to the virtio iso. Delete the provided NIC and create one using the virtio driver. Set the MAC address to that of the existing Linode(use ip link show
to get it).
Boot the VM, and go through the windows installation process slecting a Core install. It will fail to find a disk. Add a driver, and navigate to the second CD drive, viostor/2k12r2/amd64/. It should find the "RHEL Virtio SCSI" driver. Add it, then repeat the process with NetKVM/2k12r2/amd64/ for the network driver. Finish the wizard, and let the VM reboot. It will prompt you for a new password, then login.
In the command prompt provided, enable the EMS(serial management, for Lish):
bcdedit /emssettings EMSPORT:1 EMSBAUDRATE:115200
bcdedit /ems {current} on
Next use the "sconfig" utility. Use option 7 to enable Remote Desktop. Verify the network driver loaded with option 8. Shutdown the VM with option 14.
On your Rescue Mode Linode, run passwd
to set a password for root, then service ssh start
. From your KVM host, send the disk image up:
# dd if=/dev/LVM/Winode | pv -s 20480M | gzip -1 | ssh [email protected] "gzip -d | dd of=/dev/sda"
In the Linode Dashboard, create a Configuration Profile. Kernel should be set to "Direct Disk". root device of /dev/sda. Disable all of the "Boot Helpers". Try to boot the Linode, watching Lish for any BSOD messages. Ask Eugene on IRC if you have any problems. Good luck!
NOTE: These instructions(excluding the Windows-specific commands, including bcdedit) should be valid for any OS which can be booted under qemu.
@ClickSimply - How stable is this versus running a windows VM on azure or AWS? Have to run windows for IIS servers, and worried about kernel panics and other issues.
Thanks!