I’ve trying with your scripts, but I’ve no success.
I’ve got a template of Windows, without sysprep, and I clone that and:
install vmware tools
add the scripts (yours, of course)
shutdown the VM
remove the network interface
restart the VM
execute sysprep and shutdown
clone to template import from ONE
Perhaps the problem is in the template?
When I assign the IP, I use:
CONTEXT=[ ETH0_IP="$NIC[IP, NETWORK=“Housing”]" ]
Did you verify that the context script runs at all?
When I created a Windows machine, I found out that this line in the VBS does not work (I think it’s a bug). The line has to be If IsEmpty(driveLetter) Then
The code in GitHub (If NOT Len(driveLetter) Then) evaluates to True even if a CD-ROM-Drive is found (because if Len is positive, NOT Len is negative, but recognized as True). This assigns C as driveLetter. Under Windows, C isn’t very common for a CD-ROM-Drive, so this is likely to fail.
At Github, they have two years old merge request which (apart from other things) fixes exactly this issue. I see the last commit is ~28 days ago, but the issues without a reply are much older. Is Github the proper place to report bugs against addon-context-windows?
@OpenNebula@jmelis we’ve wasted a good part of the day on this issue as well…
I noticed that the 4.12 documentation mentions contextualization files on a CD, but the 5.0 docs say the windows contextualization files should be on C:
(where they are doomed to be “cleaned up” by a user some day)
The problem is in the disk lookup part of startup.vbs - as mentioned in the github comment of @Yenya - the code always results in just looking at C: for context files. https://github.com/OpenNebula/addon-context-windows/pull/8/commits/54aed7ad13711d66b78c7201cf5f8d5ff2d141bc
With the changed proposed by Yenya, it also looks at D:\CONTEXT (the cdrom) for those files, so contextualization works properly, with context files on a CD, not on local filesystem C:
I wonder whether the contextualization package for Windows is maintained, and if so, what is the proper way of suggesting fixes. I have several merge requests at github for more than month without any reaction from the package authors.
Try install Windows with Contextualization. Not work for me. I put 2 files to C: and add startup script to GP. After restart Network card get IP 169.254.94.240…
Also, can you check that a file called C:\.opennebula-context exists? If that’s the case and the IP is not being configured delete it and reboot again.
Return code 66 is “Invalid subnet mask” and you don’t appear to have one set in your context that I can see. I’d recommend that the subnet mask is set in the virtual network that you are using, it should come through to the VM as ETH0_MASK for the script to read it. I would also recommend setting the default gateway if it is not set already.