Skip to content

Windows system drive letter is assumed #142

@lukasfazik

Description

@lukasfazik

Description

Windows contextualization script context.ps1 assumes that Windows system partition drive letter is "C:". This is in most cases true, but the drive letter can be changed or it rarely changes during some system restore/recovery operations.

To Reproduce

  • Prepare fresh virtual machine
  • Install Windows 10, but do not finish OOBE (Out of box experience)
  • Boot to audit mode by pressing CTRL + ALT + F3 on first page of OOBE
  • Install OpenNebula contextualization package
  • Ensure the Windows partition is the last one on the system drive
    • If that's not the case, remove Windows RE partition at the end of the drive or shrink the Windows partition
  • Run command prompt as Administrator
  • Export the registry key HKEY_LOCAL_MACHINE\SYSTEM\MountedDevices by using the following command:
    • reg export HKLM\SYSTEM\MountedDevices C:\registry_backup.reg
  • Change the C: drive letter to something other in C:\registry_backup.reg file
    • Recommend opening notepad as administrator in command prompt window
      • notepad C:\registry_backup.reg
  • Run the Windows Sysprep tool with the following parameters:
    • %WINDIR%\system32\sysprep\sysprep.exe /generalize /quit /oobe
  • Import the changed registry file using the following command:
    • reg import C:\registry_backup.reg
  • Reboot the virtual machine and finish the OOBE (Out of the box experience)
  • Expand the system drive in OpenNebula
  • Change some contextualization parameters to trigger the contextualization
    • Example: Add variable TEMP with some value to the context
  • Wait at least 30+ seconds for context to pick up the changes and rerun the contextualization
  • Check that Windows partition has not been expanded by contextualization-script

Expected behavior

  • Contextualization script should resize the Windows partition even if it's drive letter is different from default drive letter C:

Recommendation

  • Environmental variable SYSTEMDRIVE should be used instead of C:

Details

  • Affected Component: context-windows
  • Version: 6.10.0-2

Additional context

Progress Status

  • Code committed
  • Testing - QA
  • Documentation (Release notes - resolved issues, compatibility, known issues)

Metadata

Metadata

Assignees

No one assigned

    Labels

    category: context windowsWindows OS contextualization packagescommunityIssue created by OpenNebula Communitystatus: acceptedThe issue is valid and will be planned for fix or implementationtype: bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions