How to create Windows VM?

welcome!

these are the basic steps I used to get a Windows 7 VM running:

  • upload a windows installation iso to opennebula
  • create a new image to use (recommend ~50 GB or larger)
  • create or clone a template for windows and setup the basics (image/network/boot sequence)
    make sure to set the network card type to “virtio” and make sure the disk-image is setup to be mounted as “vdX”, or make sure the image has a prefix as “vd”.
  • download the virtio driver iso from Red Hat (win-drivers need to be digitally signed, red hat can sign them)
  • add the win-iso, virtio-iso and the win-image to the template, make sure to set boot sequence to cdrom first.
  • instantiate VM, install windows, use drivers from virtio-iso during installation (install driver for virtio network interface and virtio disk controller)

Here is the raw content of a template I use. (Make sure to update all fields with “SOME” to your situation)

CONTEXT=[NETWORK="YES"]
CPU="2"
DESCRIPTION="Default Windows Template"
DISK=[IMAGE="SOME_IMAGE_NAME_HERE.qcow2",IMAGE_UNAME="oneadmin"]
DISK=[IMAGE="virtio-win.iso",IMAGE_UNAME="oneadmin"]
DISK=[IMAGE="SOME_Windows7-Installation.iso",IMAGE_UNAME="oneadmin"]
FEATURES=[ACPI="yes",APIC="yes",LOCALTIME="yes"]
GRAPHICS=[LISTEN="0.0.0.0",RANDOM_PASSWD="YES",TYPE="VNC"]
HYPERVISOR="kvm"
INPUT=[BUS="usb",TYPE="tablet"]
LOGO="images/logos/windows8.png"
MEMORY="4096"
NIC=[NETWORK="SOME_NETWORK"]
NIC_DEFAULT=[MODEL="virtio"]
OS=[ARCH="x86_64",BOOT="cdrom,hd"]
SUNSTONE_CAPACITY_SELECT="YES"
SUNSTONE_NETWORK_SELECT="NO"
VCPU="4"

Hope this helps!

2 Likes