Building a Windows Image for OpenStack

Building a Windows Image for OpenStack


Building a Windows Image for OpenStack

Building a Windows Image for OpenStack :  Here is a how-to for building a Windows image to import into OpenStack or a KVM Hypervisor. We need to sysprep the image before we can import it into Glance.

For a tutorial on getting OpenStack Folsom up and running have a look at OpenStack Folsom Installation with Devstack Guide

System Prep

Have the windows install ISO and the VirtIO iso in the same directory that you execute the commands below.

***Note if you add index=x in the command as listed in the OpenStack admin guide it may throw an error like this:
root@openstack1:/home/brent# kvm -m 2048 -cdrom windows-2008r2.iso -drive file=windowsr2.img ,if=virtio,boot=on -boot d drive file=virtio-win-0.1-30.iso,index=3,media=cdrom -net nic,model=virtio -net user -nographic -vnc :0
kvm: -drive file=windowsr2.img: drive with bus=0, unit=0 (index=0) exists***

Build the Windows Image for OpenStack

Enter into the window. :1 = is the screen number after you put in the KVM command. This will spawn a VNC window in which you will install windows.

Figure 1. Next.


Figure 2. I used the WLH->AMD folder to locate the driver.


Figure 3. Choose the VirtIO SCSI driver which will be the only one listed.


Figure 4. Choose the 20GB image you created with the kvm-img command from the CLI earlier.


Figure 5. Windows will install.


Figure 6. Under Computer Management -> Device Manager update the drivers to the RedHat Ethernet Adaptor on the virtio ISO mounted.


Figure 7. Either disable the firewalls or open TCP 3389 and allow ICMP to test your image. RDC is the only way to reach the host for initial setup.

Import the Image into Glance
Shutdown the windows machine and import it into Glance.

After the Windows host boots you should be able to ping it. Depending on your build you may need to add a floating IP to the instance and the RDC into the host.

About the Author

Brent SalisburyI have over 15 years of experience wearing various hats from, network engineer, architect, devops and software engineer. I currently have the pleasure of working at the company that develops my favorite software I have ever used, Docker. My comments here are my personal thoughts and opinions. More at Brent's BioView all posts by Brent Salisbury →

  1. karthickkarthick08-15-2012

    Good article.Thanks..

    Unable to connect to the windows system using vnc after reboot.

    So, Unable to perform steps mentioned in fig6 and fig7

  2. karthickkarthick08-15-2012

    hi…i am able to take vnc console again after running same command.
    This time i was unable to update the driver.Please give your suggestions.

  3. Brent SalisburyBrent Salisbury08-15-2012

    Hi Karthick, Do you you mean you cannot update the NIC driver? Is it showing up as using the Redhat virtio driver? You load that driver from the red hat virtio iso.

    When you said VNC did you mean windows remote desktop? Are you trying to attach inside an OpenStack env? More info and I will try and assist.

  4. VishalVishal09-10-2012

    You guide is excellent, when it comes to install Windows Server or windows Vista as they have facility to look the drivers but what about the Windows Xp, please cater this also in you respected blog entry.

  5. VishalVishal09-11-2012

    I am not able to connect to the Windows Server machine running in Openstack. I am currently running instance using VNC Console in browser.
    I can ping other host, machines and even browse internet on same subnet and different subnet from the windows instance itself.
    I can also ping & connect other linux instance which are running in openstack from host and other machine.
    In My windows server Windows firewall is completely turned off.
    Problem is i am not able to connect using RDP or able to ping to my windows instance running in openstack. Please help me.

  6. AlexanderAlexander10-07-2012

    Hey Brent

    Been following this blog for a while now wanted to say you are making an awesome contribution to anybody who wants to learn networking and opensource cloud computing..
    Thank you.

    I wanted to ask the windows image you have prepared was it 32 or 64 bit
    For some reason I am unable to run 64bit windows images under open stack

    Prepared the image with virt-install and it updated all the drivers runs fine under kvm but as soon as i added to glance getting
    0x0000005D error

    virt-install –connect qemu:///system –arch=x86_64 -n winserver2008 -r 4096 –vcpus=2 \
    –disk path=/opt/vmimgs/windows2008.img,bus=virtio,cache=none -c /opt/isos/winserver2008.iso –vnc \
    –noautoconsole –os-type windows –os-variant=win2k8 –network=bridge:br100 \
    –force –disk path=/opt/isos/virtio-win-0.1-30.iso,device=cdrom,perms=ro

    Will appreciate any help I can get

  7. Brent SalisburyBrent Salisbury10-07-2012

    Hi Alexander, thanks for the kind comments. Wonder, do you have anymore information in syslog or /var/log/glance/* ? Might give us some hints at what is failing there. Also probably dumb but just in case run a glance index to make sure Glance is operating and maybe even suck in a cloud precise image just for good measure.

    Something like this in case you haven’t which you may very well have already.

    wget &&

    glance add name=Ubuntu-12.04 is_public=true container_format=ovf disk_format=qcow2 < precise-server-cloudimg-amd64-disk1.img Traveling some this coming week so response times may suck 🙂

    • Brent SalisburyBrent Salisbury10-07-2012

      Oh forgot to answer on the image, 64-bit.

      • AlexanderAlexander10-08-2012

        Hello Brent

        Was trying to figure out myself with no luck why i am unable to run 64 bit windows on the openstack essex install well tried all possible combinations missing something not sure what i am not what. Don’t have enough knowledge on networking and cloud computing but I am a java programmer so the the consents are not new :)..

        Well here it goes. Installed under kvm with virt-install everything runs fine and dandy but when I load image to glance and spin the instance I get this 0x0000005D error not shure what causing it tred different combinations of creating an image with qcow2 formatting and raw and then upload with no luck.
        Not shure if qemu openstack unable to run this kvm image or what. I was wondering if you could take a look for a minute maby you can help me out or pont me it to the right directions on where at list should i dig …

        Panel default log in as I have used you python installer script. So the is a clean install of openstack essex
        Through virtual machine manager you can see the is 3 instances one is running under kvm created with virt-install and the other 2 sinned in the openstack.
        Windows running under kvm boots fine but under openstack it throws me an error massage ..

        I have sent you a Metal SSH credentials via email

        Will appreciate any help I can get .

  8. John BarbeeJohn Barbee10-18-2012

    Hey Brent

    Thanks for the step by step instructions. They are a huge help. One question, after I uploaded the image to openstack the ethernet driver shows as a Realtek RTL8139C+ Fast Ethernet NIC. Details of the interface show it connected at 100Mbps. I was expecting a 1 gig connection. Do you konw if this is by design or just the limitation of the driver installed?


  9. TianyangTianyang12-14-2012

    Hi Brent, I ran line 3 of the system prep and kvm: -drive file=windowsr2.img: drive with bus=0,unit=0(index =0) exists? How to solve that?
    I did follow your steps

  10. nasirnasir12-24-2012

    Hey Brent
    When i’m try to execute “kvm -m 2048 -no-reboot -boot order=d -drive … ” to boot kvm with my iso files , i got this :
    kvm: pci_add_option_rom: failed to find romfile “pxe-virtio.bin”
    Warning: vlan 0 is not connected to host network

    Thanks 🙂

  11. Brent SalisburyBrent Salisbury01-01-2013

    Hi Nasir, Hi Nasir, Might be worth checking for the kvm-pxe dependency “dpkg –list | grep pxe” or “apt-get install kvm-pxe”


  12. Tatenda MupasoTatenda Mupaso02-08-2013

    Hey Brent, followed your guide and everything worked flawlessly in Folsom, except when I go to spin up the instance in my Horizon dashboard, I get an error. I opened up the all the ports on the VM including RDP and ICMP specifically. I even completely turned off the firewall the second time and the instance errors out at startup.

    I feel like it may be a metadata problem where openstack is having trouble getting metadata through to instance during launch. (I thought maybe the Redhat Ethernet Driver would some magic happen there)… Is there like a cloud-utils or something I need to run in windows before uploading it with glance? Any help would be truly appreciated

  13. CesarCesar03-05-2013

    Please can anybody help me???

    On this link “”, i see the latest Virtio drivers for Windows (virtio-win-0.1-52.iso) , but the directiories into this ISO show me: /VISTA, /WIN7, /WIN8, /WLH, /WNET, /WXP and finally /XP.

    But i don’t know where are the drivers for Win-Servers? (ie Win 2003, 2003R2, 2008, 2008r2, 2011 and 2012 – for 32 and 64 Bit flavors)

    Any help is welcome !!!!

    Eest regards

  14. sureshsuresh04-05-2013

    Hi Brent,

    could you provide how to windows image on RHEL .. this stpes are used on ubuntu .. so i did openstack setup on RHEL..