Skip to content

Instantly share code, notes, and snippets.

@EugeneKay
Last active May 17, 2022 17:32
Show Gist options
  • Save EugeneKay/1ff78396b57f25e69f1d to your computer and use it in GitHub Desktop.
Save EugeneKay/1ff78396b57f25e69f1d to your computer and use it in GitHub Desktop.
Winode Instructions

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:

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.

@EugeneKay
Copy link
Author

The above does not take into account the availability of Full-Virtualization mode in the large-scale KVM rollout. This mode requires less preparation on the source KVM host. It will be updated.... sometime.

@ethanpil
Copy link

Any chance for an update?

@EugeneKay
Copy link
Author

Not a full, one - I'm too lazy. Hopefully Linode will provide ISO support, at which point this will get a lot easier.

The shorter, easier version:

  1. Create a USB installer.
  2. dd the installer stick into a Raw disk image.
  3. Make a config profile, pick "Full Virtualization". Use sdb for the installer, pick it as the boot device
  4. Boot. Use glish to run through the installer
  5. At the "Rebooting" stage, do a shutdown of the Linode
  6. Remove sdb from the config profile, boot up again. Install process resumes in Glish
  7. ???
  8. Profit!

@NathanSweet
Copy link

NathanSweet commented May 15, 2016

In case it helps others, I ended up installing Windows Server 2012 R2 in Virtual Box, then booted from a Finnix ISO and copied the disk to a raw drive on the Linode. It boots just fine using Full Virtualization. Here is my Configuration Profile. To do the copy, do cat /proc/partitions in Virtual Box and note which has your Windows installation. Be sure to choose the whole drive, not just a single partition (eg choose sda and not sda2). Boot the Linode into Rescue Mode, passwd and service ssh start, then run this from Finnix in Virtual Box:

dd if=/dev/sda | pv | gzip -1 | ssh root@linodeIP "gzip -d | dd of=/dev/sda"

@b1ggjoe
Copy link

b1ggjoe commented May 15, 2016

Eugene/Nathan.

I know better than even thinking about attempting this myself. How much would either of you charge to do this for me?

Thanks!

J.

@shinji257
Copy link

Are the ems settings so that lish can produce a prompt?

@only-cliches
Copy link

only-cliches commented Jun 25, 2016

Hey guys, just produced a draft of a guide to install Windows on Linode:
https://github.com/ClickSimply/docs/blob/windows-on-linode/docs/tools-reference/windows-on-linode/installing-windows-on-linode-vps.md

Huge thanks to Nathan, that command above was the missing piece when I was originally trying to figure this out.

Edit: Fixed the link. :)

@dakser
Copy link

dakser commented Jun 25, 2016

Hi ClickSimply, it looks like the link isn't working. Thanks.

@villanus
Copy link

@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!

@pococinco
Copy link

I did this as per ClickSimply's document. It works and is very stable. This issue I am having though is that although I have 8 cores from linode, the resulting Windows 10 Pro system sees 2 CPU processors each with 2 cores. I'm still trying to figure out how to fix that. I've already gone to msconfig --> boot --> advanced settings and also there the maximum value that can be selected is 2 processors. I've searched for ideas including something with updating the HAL driver, but I haven't been able to figure this out.

@tkuehnl
Copy link

tkuehnl commented Mar 19, 2017

The above steps from Nathan and ClickSimply's tutorial and it's worked out great for me, much appreciated. It worked out of the box with Windows Server 2016, no additional drivers or steps required. I've settled on the latest build of Windows 10 Enterprise and it's working great as my Perforce version control server and remote CI build machine with Visual Studio 2016 and Jenkins CI. I'm keep it up on one of my monitors via Remote Desktop most of the day and half the time, I forget it's a remote box since RDP is working so nice for me. Thanks again.

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