NIC is assigning different IP in Window server 2019 VM

I have create a template for Windows Server 2019 and created a VM using that template. During the creation of the VM it ask for the driver installation . It is only showing the diver of windows 10, 8, 7 . I have downloaded the Windows virtio image from the opennebula appstore .

How can I Create a template for Windows Server 2012, 2016, 2019.

Here is my template

CPU = “4”
DISK = [
IMAGE = “windows-2019-iso”,
IMAGE_UNAME = “oneadmin” ]
DISK = [
IMAGE = “Windows VirtIO Drivers”,
IMAGE_UNAME = “oneadmin” ]
DISK = [
IMAGE_UNAME = “oneadmin” ]
DISK = [
DEV_PREFIX = “vd”,
IMAGE_UNAME = “oneadmin” ]
LISTEN = “”,
PASSWD = “”,
PORT = “5966”,
TYPE = “VNC” ]
BUS = “usb”,
TYPE = “tablet” ]
LOGO = “images/logos/windows8.png”
MEMORY = “4096”
NIC = [
NETWORK = “VNetwork-KVM-”,
NETWORK_UNAME = “oneadmin”,
MODEL = “virtio” ]
OS = [
BOOT = “disk0” ]
VCPU = “4”

I was able to get Windows server 2019 to work, were you able to run this step from the docs? My ONE system is down right now while I’m doing some upgrades, I can check what was on the virtio driver CD when it’s back up.

Are you able to tell if the NIC virtio drivers are loaded?


Download the MSI package into C:\ :

Or execute this command in powershell:

(New-Object Net.WebClient).DownloadFile(“”, “C:\one-context-6.0.0.msi”)

@christaylor . I am able to create a VM for Windows Server 2019 . But the NIC is different , and the IP are also different from my KVM node NIC i.e It is giving me the default NIC of Realteak.
So, how can we change the NIC and keep same as of the NIC of the node?
What should we use for “Default hardware model to emulate for all NICs” in the interface execpt for virtio? As my sever NIC is of Intel and I have created a bridge connection for public IP.

If I understand you correctly, It looks like you have in your template is correct, where you say

  MODEL="virtio" ]

That’s what you want- the virtualized NIC (not the same as on your bare metal KVM server).

As for the VM IP, it will pull a free address from the range in the vnet assigned when you instantiated.

What does onevm show <vm ID> say under the section “VM NICS”. One of my running VMs says

 ID NETWORK              BRIDGE       IP              MAC               PCI_ID
  0 cloudvnet15          onebr15    02:00:0a:7b:

Because I attached a NIC from the cloudvnet15 vnet. OpenNebula sets up the bridge for me automatically.

1 Like

@christaylor So, why the NIC is assigning the different IP . I can see there is one file generated in of the Context Drive. There is the information for the interface i.e public, private IP. But the NIC is showing different IP.
The Created VM template has the correct IP .

NIC = [
AR_ID = “0”,
BRIDGE = “br0”,
BRIDGE_TYPE = “linux”,
INBOUND_AVG_BW = “1000”,
IP = “148.251.146.XX”,
MAC = “02:00:94:fb:92:XX”,
NAME = “NIC0”,

But the VM NIC is assigning the IP of which is not my NIC IP.

onvm show
0 VNetwork-KVM-5.9.xx br0 148.251.146.xx 02:00:94:fb:92:53
1 NEW-VN-PRIVATE prv0 02:00:0a:0a:0f:02

@christaylor I have created a new template using the new one-context provided by you. Still it is showing different IP.

Hmm, something is strange with the configuration. An IP of is a local address a host gets when it can’t get talk to a DHCP server, or something like that.

Maybe you could check the output of the contextualization script on your Windows VM? I think it saves it in c:\one-context or some path like that- sorry, I can’t look on a VM right now. Anyway it has all the output from the context Powershell when the VM starts.Maybe there’s some clue.

Maybe you could try a very simple template with only one public IP on one NIC?

1 Like

@christaylor There is output file of contextualization script in one of the directory. This file has got all the correct information regarding public IP , gateway and netmask. But this file is not being implement inside the VM and NIC is assigning IP.

Yes, I have tried with the single NIC as well , still same issue.

I’m not sure why it’s not working for you- I’d say, just keep working with it. That IP you’re getting is like a failed DHCP request or something - I’m not sure.

On one of my templates, after the VM boots I see this part in .onecontext\opennebula-context.log:

Configuring Network Settings: Red Hat VirtIO Ethernet Adapter
- Release DHCP Lease
  ... Failed: 83
- Set Static IP
  ... Success
- Set Gateway
  ... Success
- Set DNS Server Search Order
  ... Success
- Set Dynamic DNS Registration
  ... Success
- Ping Interface IP
  ... Success (1 tries)

Then I get this when I run ipconfig:

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   Description . . . . . . . . . . . : Red Hat VirtIO Ethernet Adapter
   Physical Address. . . . . . . . . : 02-00-AC-10-64-02
   DHCP Enabled. . . . . . . . . . . : No
   Autoconfiguration Enabled . . . . : Yes
   IPv4 Address. . . . . . . . . . . :
   Subnet Mask . . . . . . . . . . . :
   Default Gateway . . . . . . . . . :
   DNS Servers . . . . . . . . . . . :
   NetBIOS over Tcpip. . . . . . . . : Enabled

Do you see any errors in .onecontext\opennebula-context.log ?

Hi, @christaylor it is working now . I have change the context ios by lates one. Releases · OpenNebula/addon-context-windows · GitHub
But I have to run win virtio exec file manually after login into the VM. After that only the NIC is visible. And it was assigning 169.254.xx.xx range IP. After that I reboot the VM and it start working.
This win virtio exec should be run automatically and also the context script right?O r do we have to do this manually every time we create a Windows server and reboot every time?

No, if the virtio NIC drivers are installed in the image and the contextualization script runs you shouldn’t have to do anything every time the VM boots- the virtio NIC should get set up for connectivity and assigned an IP.

When you created the image the first time and booted Windows, were you able to successfully run the step where it asks to install additional drivers from the virtio CD image? Something like about half way through this video:

““OpenNebula - How to Build a Windows Image - YouTube””

There’s a link to that video and some other helpful things in this link- maybe you already know about this guide:

1 Like

Thank you. Yes. I have checked this video and have deployed in the same way . Still the issue exist . I will check this once more.

When your Windows VM boots do you see something like this in the Device Manager? If you click on the “Events” tab in that properties popup do you see any errors or anything unusual?

1 Like

Hi @christaylor , Soory for late reply. There is no issue till now on device manager while reboot.

I’ve really never run into an error like that before- the only thing I can think of is to start a new template and VM creation and make sure you have the very latest version of the Redhat virtio drivers. It seems like something failed during the driver installation process and it’s only half working. I’m not sure if this helps, but I recall during the template and installation process, when the extra drivers virtual CD is mounted, I installed pretty much everything! Sorry I can’t be more specific, but it’s been a while.

Hi, I have used a latest context and virtio driver. You can try with the latest one.