Windows contextualization problem

Still doesnt work for us at all. The only way to get the guest os to pick up the correct IP is for us to run the ps1 script manually once logged in. It doesn’t run automatically, even using the supplied VBS script. Additionally, when we run the script manually we are always prompted for the change in execution policy. (Explains why the powershell is endlessly running when we test the automatic script run). Removing the .opennebula-context and rebooting doesn’t work either. The opennebula service installs and seems to be running just fine but it also doesn’t do anything. We see the same result on Server 2008 R2, Server 2012 and Server 2016. All Linux OS’s we have tested work just fine. We have tried one-context-5.2.0.msi as well as one-context-5.3.80.msi - Neither work automatically.

No-one have any ideas? We are still struggling with our Windows machines.

Hi Marcus,

You’ll need to set the PowerShell execution policy via local policies when you prepare the image. (I don’t actually use the OpenNebula supplied context.ps1 here, so I can’t comment on the method they use to call the script during the sysprep specialization phase)

Alternatively if you find the command line that calls the context.ps1 script, you can add “-ExecutionPolicy Unrestricted” to it to override the system execution policy and force the script to run.

C:\windows\setupact.log (sysprep log file) should have more information about what is going on.

Cheers

Hi Paul,

Thanks so much for your reply - Your comments about the sysprep log file made me realize why the execution policy kept changing; its a result of sysprep generalizing the image… So instead I created a SetupComplete.cmd script with the following details:

set LOCALAPPDATA=%USERPROFILE%\AppData\Local
set PSExecutionPolicyPreference=Unrestricted
powershell "%systemdrive%\Progra~2\OpenNebula\context.ps1" -Argument >"%systemdrive%\myscript_log.txt" 2>&1

Now the script executes after the initial EULA acceptance and password config. Thanks for pointing me in the correct place! Really appreciate the help!

Hi all,
I would like to reopen this discussion because I’m facing a similar problem. In particular I’m not able to have internet connection.
I set up a WIN7 Enterprise VM and looking at the control panel “Network Connections” section it says Unidentified network.
This is strange because the IP settings are correct and the network is working properly when used for LINUX VM.
This is what I have checked:

  1. I’m able to see my network card and it is working.
  2. I already follow your suggestion and I’m able to run at startup the .vbs script and here you can find the output:

Loading Context FileChanging Hostname to Enabling Remote Desktop
__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 0

Enabling PingConfiguring Network SettingConfiguring Network Settings for ETH_0IP Realtek RTL8139C+ Fast Ethernet
NIC__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 0

__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 0

__GENUS : 2
__CLASS : __PARAMETERS
__SUPERCLASS :
__DYNASTY : __PARAMETERS
__RELPATH :
__PROPERTY_COUNT : 1
__DERIVATION : {}
__SERVER :
__NAMESPACE :
__PATH :
ReturnValue : 0

I seems to me it does not have any errors. Am I right?

What is strange to me is that if I try to ping the Default gateway it says “Destination Host unreachable”

Could you please help me?? Any suggestions or hints are really welcome!!!

Hi Bart,

I’m presuming that the IP address and default gateway are being set correctly there. The only thing that seems strange is the name of your network adapter. It seems to be named after a physical device (Realtek RTL8139C+ Fast Ethernet). I would expect to see some sort of virtual adapter name there. Which hypervisor are you using? (e.g. vmware, linux KVM, linux XEN, etc?) Do you have the proper drivers installed for that hypervisor?

Cheers