# How install windows vm?

**URL:** <https://forum.opennebula.io/t/how-install-windows-vm/3072>\
**Category:** Product Support\
**Created:** [October 5, 2016, 4:02pm UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072 "2016-10-05T16:02:19Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeffrey](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jeffrey](https://forum.opennebula.io/u/jeffrey)\
**Post date:** [October 5, 2016, 4:02pm UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/1 "2016-10-05T16:02:19Z")

</div>

there is no cdrom or hd,so how can I install windows vm from cdrom? or how create the cdrom device?  
 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/f/fe98af0fa1a515c131b12a80bb0f4277338f2116.png)

---

<div class="post-metadata">

**Author:** ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)\
**Post date:** [October 5, 2016, 4:14pm UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/2 "2016-10-05T16:14:59Z")

</div>

Hi,  
In Sunstone User Interface, go to Storage -\> Images. There you can create an image selecting Type -\> Readonly CDROM.

You can upload an ISO file with the Operating System installer or if you have the same file in an URL you can use “Path in OpenNebula server”. Once you have that CDROM you can add it from the Storage tab when creating an new VM Template. I’d set it to boot in 2nd place after the disk0 called win7 in your screenshot. That way the VM will try too boot from disk0, as it has no operating system on it, it will try to use the CDROM and boot the installer. Once you install Windows, the machine will be rebooted but that time the CDROM won’t be used as it is placed 2nd in boot order 😉

Use the search in this forum and in OpeNebula’s documentation to find out more info about Windows VM

See ya!

---

<div class="post-metadata">

**Author:** ![jeffrey](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jeffrey](https://forum.opennebula.io/u/jeffrey)\
**Post date:** [October 5, 2016, 5:22pm UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/3 "2016-10-05T17:22:32Z")

</div>

I created a cd-rom device, but it doesn’t work, I don’t know where is the problem?

 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/e/eb928eeaf8c7eca5688f69b90bb8abdedc7e5432.png)

 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/6/65140f1b55035a09e2e14a47f65af23651e116a3.png)

---

<div class="post-metadata">

**Author:** ![Thomas\_Stein](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Thomas\_Stein](https://forum.opennebula.io/u/Thomas_Stein)\
**Post date:** [October 5, 2016, 6:19pm UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/4 "2016-10-05T18:19:22Z")

</div>

“Size 1MB” seems a little bit small.

---

<div class="post-metadata">

**Author:** ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)\
**Post date:** [October 5, 2016, 6:43pm UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/5 "2016-10-05T18:43:00Z")

</div>

I agree with Thomas, 1 MB for a Windows CDROM looks weird.

Anyway, though it was posted some months ago maybe the info provided in this discussion: [How to create Windows VM?](https://forum.opennebula.io/t/how-to-create-windows-vm/1190/9) can help you to prepare your windows VM, try to read it as it has lots of info. For example you’ll need some drivers if you want to use Virtio devices like disks, network interfaces… if you use KVM, it’s always a good idea to use Virtio for enhanced performance.

Cheers

---

<div class="post-metadata">

**Author:** ![jeffrey](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jeffrey](https://forum.opennebula.io/u/jeffrey)\
**Post date:** [October 6, 2016, 6:38am UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/6 "2016-10-06T06:38:15Z")

</div>

Still could not execute boot from the CD-ROM,is it wrong with my configuration on CD-ROM or HD？

 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/9/94c4179c46a5439b045e088549ddf340402d71a2.png)  
 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/7/71ad858f224bd86f4ec2df670e38000924ec60f7.png)

---

<div class="post-metadata">

**Author:** ![Thomas\_Stein](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Thomas\_Stein](https://forum.opennebula.io/u/Thomas_Stein)\
**Post date:** [October 6, 2016, 7:31am UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/7 "2016-10-06T07:31:05Z")

</div>

Well first you should set the DATABLOCK to persistent. At least for the installation. Can you show us the VM config?

---

<div class="post-metadata">

**Author:** ![jeffrey](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jeffrey](https://forum.opennebula.io/u/jeffrey)\
**Post date:** [October 6, 2016, 8:07am UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/8 "2016-10-06T08:07:20Z")

</div>

Thank you for your reply,after i set the DATABLOCK to persistent and run the instance, but there is the same hints:could not read from CDROM (code 0004).my vm config like this:

Template  
AUTOMATIC\_DS\_REQUIREMENTS = "“CLUSTERS/ID” @\> 0"  
AUTOMATIC\_REQUIREMENTS = "(CLUSTER\_ID = 0) & !(PUBLIC\_CLOUD = YES)"  
CPU = "0.8"  
DISK = [  
CLONE = “NO”,  
CLONE\_TARGET = “SYSTEM”,  
CLUSTER\_ID = “0”,  
DATASTORE = “default”,  
DATASTORE\_ID = “1”,  
DEV\_PREFIX = “sd”,  
DISK\_ID = “0”,  
DISK\_SNAPSHOT\_TOTAL\_SIZE = “0”,  
DISK\_TYPE = “FILE”,  
DRIVER = “qcow2”,  
IMAGE = “CD-ROM”,  
IMAGE\_ID = “25”,  
IMAGE\_STATE = “2”,  
IMAGE\_UNAME = “oneadmin”,  
LN\_TARGET = “SYSTEM”,  
ORDER = “1”,  
READONLY = “YES”,  
SAVE = “NO”,  
SIZE = “1847”,  
SOURCE = “/var/lib/one//datastores/1/8c7bfb4c62acd6acec3176757374500b”,  
TARGET = “sda”,  
TM\_MAD = “ssh”,  
TYPE = “CDROM” ]  
DISK = [  
CLONE = “NO”,  
CLONE\_TARGET = “SYSTEM”,  
CLUSTER\_ID = “0”,  
DATASTORE = “default”,  
DATASTORE\_ID = “1”,  
DEV\_PREFIX = “sd”,  
DISK\_ID = “1”,  
DISK\_SNAPSHOT\_TOTAL\_SIZE = “0”,  
DISK\_TYPE = “FILE”,  
DRIVER = “raw”,  
IMAGE = “hd”,  
IMAGE\_ID = “26”,  
IMAGE\_STATE = “8”,  
IMAGE\_UNAME = “oneadmin”,  
LN\_TARGET = “SYSTEM”,  
ORDER = “2”,  
PERSISTENT = “YES”,  
READONLY = “NO”,  
SAVE = “YES”,  
SIZE = “8000”,  
SOURCE = “/var/lib/one//datastores/1/0e0e13d4bc511b27668b943712f20227”,  
TARGET = “sdb”,  
TM\_MAD = “ssh”,  
TYPE = “FILE” ]  
GRAPHICS = [  
LISTEN = “0.0.0.0”,  
PORT = “5965”,  
TYPE = “VNC” ]  
MEMORY = "800"  
NIC = [  
AR\_ID = “0”,  
BRIDGE = “br0”,  
CLUSTER\_ID = “0”,  
IP = “192.168.137.130”,  
MAC = “02:00:c0:a8:89:82”,  
NETWORK = “br0”,  
NETWORK\_ID = “2”,  
NIC\_ID = “0”,  
SECURITY\_GROUPS = “0”,  
TARGET = “one-87-0”,  
VN\_MAD = “dummy” ]  
OS = [  
ARCH = “x86\_64”,  
BOOT = “disk0,disk1”,  
KERNEL\_CMD = “virtio” ]  
SECURITY\_GROUP\_RULE = [  
PROTOCOL = “ALL”,  
RULE\_TYPE = “OUTBOUND”,  
SECURITY\_GROUP\_ID = “0”,  
SECURITY\_GROUP\_NAME = “default” ]  
SECURITY\_GROUP\_RULE = [  
PROTOCOL = “ALL”,  
RULE\_TYPE = “INBOUND”,  
SECURITY\_GROUP\_ID = “0”,  
SECURITY\_GROUP\_NAME = “default” ]  
TEMPLATE\_ID = "13"  
VCPU = "1"  
VMID = “87”

---

<div class="post-metadata">

**Author:** ![mcabrerizo](https://yyz1.discourse-cdn.com/flex031/user_avatar/forum.opennebula.io/mcabrerizo/32/4829_2.png) [@mcabrerizo](https://forum.opennebula.io/u/mcabrerizo)\
**Post date:** [October 6, 2016, 8:14am UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/9 "2016-10-06T08:14:46Z")

</div>

Mmm, maybe you’ve already tried… but try CDROM to be raw instead of qcow2 and change DEV\_PREFIX to hd instead of sd.

Cheers!

---

<div class="post-metadata">

**Author:** ![Thomas\_Stein](https://avatars.discourse-cdn.com/v4/letter/t/3d9bf3/32.png) [@Thomas\_Stein](https://forum.opennebula.io/u/Thomas_Stein)\
**Post date:** [October 6, 2016, 8:15am UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/10 "2016-10-06T08:15:54Z")

</div>

I seems you are trying to use qcow2 for the cdrom. Thats not gonna work. Use raw and try again.

---

<div class="post-metadata">

**Author:** ![jeffrey](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jeffrey](https://forum.opennebula.io/u/jeffrey)\
**Post date:** [October 7, 2016, 6:03am UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/11 "2016-10-07T06:03:12Z")

</div>

I tried,but it’s always the same hints,can’t read from cdrom,I don’t know why.how set cdrom can read

 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/c/ca61d39195a085bc763d6d8185ff035e4b08afb5.png)  
 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/5/5a505cf156d29a11dbeb4b1cf723a176795491f2.png)

---

<div class="post-metadata">

**Author:** ![jeffrey](https://avatars.discourse-cdn.com/v4/letter/j/d6d6ee/32.png) [@jeffrey](https://forum.opennebula.io/u/jeffrey)\
**Post date:** [October 7, 2016, 8:13am UTC](https://forum.opennebula.io/t/how-install-windows-vm/3072/12 "2016-10-07T08:13:07Z")

</div>

I found the problem finally,the iso file has issue,after changed another ISO file,then the cdrom going to work and install vm.

thanks

 ![](https://canada1.discourse-cdn.com/flex031/uploads/opennebula/original/2X/b/b014fdb9a489b176c746fb4c8c2b7fc5ceef2269.png)
