<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta content="text/html;charset=UTF-8" http-equiv="Content-Type"></head><body ><div style='font-size:10pt;font-family:Verdana,Arial,Helvetica,sans-serif;'>Mario,<br><br>You may refer below two tutorials posted in the OpenNebula wiki to get some hints<br><br>This one is with VBSCRIPT and WINDOWS SHELL SCRIPT:<br><br>OpenNebula 3.4.1- Easy and faster  way to create a Windows XP VM and perform MIGRATION & LIVE MIGRATION  of the Windows VM   [<a href="http://cloudblab.files.wordpress.com/2012/05/opennebula-3-4-1-and-windows-xp-vm-try-migration-and-live-migration1.pdf" class="urlextern" title="http://cloudblab.files.wordpress.com/2012/05/opennebula-3-4-1-and-windows-xp-vm-try-migration-and-live-migration1.pdf" rel="nofollow">http://cloudblab.files.wordpress.com/2012/05/opennebula-3-4-1-and-windows-xp-vm-try-migration-and-live-migration1.pdf</a> <br><br>This one is with VBSCRIPT + WINDOWS POWERSHELL SCRIPT<br><br>Tutorial on creating Windows XP VM with OpenNebula R 3.4 and Ubuntu 11.10 64 bit server<a href="http://cloudblab.wordpress.com/2012/03/08/how-to-create-windows-xp-vm-with-opennebula-r-3-4-and-ubuntu-11-10-64-bit-server/" class="urlextern" title="http://cloudblab.wordpress.com/2012/03/08/how-to-create-windows-xp-vm-with-opennebula-r-3-4-and-ubuntu-11-10-64-bit-server/" rel="nofollow">http://cloudblab.wordpress.com/2012/03/08/how-to-create-windows-xp-vm-with-opennebula-r-3-4-and-ubuntu-11-10-64-bit-server/</a><br><br>Regards,<br>Anil<br><br><div id="1"><br>---- On Wed, 06 Jun 2012 02:13:12 -0700 <b>mario wu<<a href='mailto:iamokcn@gmail.com' target='_blank'>iamokcn@gmail.com</a>></b> wrote ---- <br></div><br><blockquote style="border-left: 1px solid #0000FF; padding-left: 6px;">hi,all <div>     i writed a trivial script for windows guest OS user, for automatic setting ip address,gateway address,dns server, and change the hostname:) . in the attachment.</div><div><br></div><div>the vm template sample like this:</div> <div><br></div><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">CONTEXT = [<br>  HOSTNAME   = "$NAME",<br>   IP_PUBLIC = "$NIC[IP]",<br>  NET_MASK = "$NETWORK[NETWORK_MASK,NETWORK_ID=27]",<br>        DNS_ADDR="$NETWORK[DNS_ADDR,NETWORK_ID=27]",<br>        GATEWAY_ADDR="$NETWORK[GATEWAY_ADDR,NETWORK_ID=27]"<br> ]</blockquote></div><div><br></div><div><br></div><div>and the vnet template must have this attribute:</div><div><br></div><div><div><br></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> DNS_ADDR="192.168.180.102"<br>GATEWAY_ADDR="192.168.173.254"<br>NETWORK_MASK="255.255.255.0"</blockquote></div><div><br></div><div><br></div><div><br></div><div>just put the vbscript in the schedule task and set run as computer start. </div> <div><br></div><div>run as:</div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">cscript.exe \some\path\for\set-network.vbs</blockquote> <div><br></div><div> the context.sh like this:</div><div><br></div><div><blockquote style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> # Context variables generated by OpenNebula<br>DNS_ADDR="192.168.180.102"<br>GATEWAY_ADDR="192.168.173.254"<br>HOSTNAME="test-win2003"<br>IP_PUBLIC="192.168.173.100"<br>NET_MASK="255.255.255.0"<br> TARGET="hdb"</blockquote></div><div><br></div><div><br></div> _______________________________________________ <br>Users mailing list <br><a subj="" mailid="Users%40lists.opennebula.org" href="mailto:Users@lists.opennebula.org" target="_blank">Users@lists.opennebula.org</a> <br><a href="http://lists.opennebula.org/listinfo.cgi/users-opennebula.org" target="_blank">http://lists.opennebula.org/listinfo.cgi/users-opennebula.org</a> <br></blockquote><br></div></body></html>