Technical articles, news, and insights
for Oracle's Infrastructure Software offerings

Oracle VM 3.4: build your own Oracle VM Templates for Microsoft Windows Virtual Machine

Simon Coter
Director of Product Management

As you know on Oracle VM you can find different ready-to-run Appliances or Templates based on Oracle Linux. Oracle VM Templates allows to configure a Virtual-Machine on the first boot and apply configurations like:

  • Hostname
  • Network Boot Protocol (DHCP or STATIC)
  • Network IP Address
  • Network Subnet Mask
  • Network Gateway
  • Network DNS Servers
  • root (Administrator) Password
  • .....and more!

This blog article will show how-to create the same kind of automation (with examples) for Microsoft Windows OS.


Step-by-Step How To:

  • Extract "ovm-template-config.zip" under the Oracle VM Windows PV Drivers Folder
    • "C:\Program Files (x86)\Oracle Corporation\Oracle VM Windows PV Drivers"

  • Verify that you have a Virtual-NIC configured and named "LAN"; if not, change the name to "LAN"

On the same window you can also verify that the Virtual-NIC is an "Oracle VM Virtual Ethernet Adapter" that means Windows is correctly using Windows PV Drivers.

  • Apply all the customization required on your Microsoft Windows Virtual Machine; consider that the deployment automation will execute:
  • Enable the Microsoft Windows Task "ovm-template-config" by executing following "Windows Registry" file:
    • "C:\Program Files (x86)\Oracle Corporation\Oracle VM Windows PV Drivers\ovm-template-config\enable-ovm-template-config.reg" (double-click on it to execute and confirm as in the example below)

  • By Windows "Start Menu" run "gpedit.msc" to open "Local Group Policies Editor"; once opened, select:

"Computer Configuration" => "Windows Settings" => "Scripts (Startup/Shutdown)" => "Startup"

On the "Startup Properties" windows add the "ovm-template-config.bat" batch, as in the following picture:

Confirm with OK and close.

  • Shutdown your Microsoft Windows Virtual Machine by Oracle VM Manager

  • Create an Oracle VM Template (or Virtual Appliance) starting from the Microsoft Windows Virtual Machine by Oracle VM Manager

Now your Oracle VM Template for Microsoft Windows is ready to be used and by leveraging the same you can automate the deployment of Microsoft Windows Virtual Machine on your Oracle VM Infrastructure; here the example of a Microsoft Windows Server 2016 deployment:

  • Create a Virtual Machine starting from your desired Oracle VM Template or Virtual Appliance
  • Configure the Virtual Machine based on your requirements (CPU, RAM, Disk, Network); consider that one vNIC is required
  • Start the Virtual Machine created and proceed with the deployment automation
    • In the following diagram you can see how the deployment process works

  • By using your preferred Oracle VM Manager interface (WS-API, CLI or BUI) send the expected messages to proceed to the configuration
sendVmMessage VM name=win2016srv key=com.oracle.windows.network.hostname message=win2k16-static log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.network.bootproto message=STATIC log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.admin.password message=Welcome2 log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.network.ipaddr message= log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.network.netmask message= log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.network.gateway message= log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.network.dns message=, log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.network.hostname message=win2k16-dhcp log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.network.bootproto message=DHCP log=yes
sendVmMessage VM name=win2016srv key=com.oracle.windows.admin.password message=Welcome3 log=yes

Consider following requirements while sending VM Messages for different values:

  • "com.oracle.windows.network.bootproto" accepts only "DHCP" and "STATIC", both uppercase

  • "com.oracle.windows.admin.password" accepts only passwords >= 8 characters with at least 1 uppercase and 1 number

  • "com.oracle.windows.network.dns" accepts not more than 2 entries supplied into an unique string (no spaces) as in the example above

  • This deployment automation has been tested on Microsoft Windows Server 2016; possible adjustments could be required on other supported Microsoft Windows Operating Systems.

The Microsoft Windows Virtual Machine will execute the following steps:

  • Boot
  • Start "ovm-template-config" batch in the background waiting for Oracle VM Messages
  • Intercept the Oracle VM Messages coming from Oracle VM Manager interface
  • Execute the proper configuration on the Virtual Machine based on VM Messages received
  • Disable "ovm-template-config" batch on boot
  • Reboot the Virtual Machine to reflect the changes applied

I also think that this solutions can be easily improved and/or extended, so feel free to add you comments on this blog entry!

Oracle VM Resources:

Oracle VM Software Download

Oracle VM can be downloaded, used and distributed free of charge, and all updates and errata are freely available. Instructions to download the Oracle VM Release 3.4.5, Oracle VM Windows PV drivers, tools, and utilities can be found on the Oracle Technology Network.

Oracle VM Support

Oracle VM Support offers access to award-winning Oracle support resources and virtualization support specialists, zero-downtime updates using Ksplice, additional management tools such as Oracle Enterprise Manager, and lifetime support, all at a low cost.

Additional Oracle VM Information

For the latest product information, best practices white papers and webinars, please visit Oracle Virtualization HomePage.

The latest education and training information for Oracle VM can be found on a recent Virtualization Blog entry here

Join the discussion

Comments ( 3 )
  • Stem Narayam Monday, August 27, 2018
    This is so great! but...
    Are this tool and procedures officially supported by Oracle?
    I'm afraid that oracle does not support this officially, and Service Request regarding problems with using this tool will be rejected.
  • Simon Monday, August 27, 2018
    Hi Stem,

    here the important thing is that automating Windows deployment is possible and also supported by using Windows PV Drivers and VM-Messaging, part of the same.
    My scripts are an automation example and everyone can build their own; obviously there is no support on the scripts but this is valid always, not only on this case.
    It's like building your own template for a Linux distribution, the same is granted by Oracle Software but Oracle won't support your custom scripts :)

  • Greg King Thursday, August 30, 2018
    Nicely done!
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.Captcha