Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows system drive letter is assumed #142

Open
3 tasks
lukasfazik opened this issue Dec 2, 2024 · 0 comments · May be fixed by #143
Open
3 tasks

Windows system drive letter is assumed #142

lukasfazik opened this issue Dec 2, 2024 · 0 comments · May be fixed by #143
Labels
category: context windows Windows OS contextualization packages community Issue created by OpenNebula Community status: accepted The issue is valid and will be planned for fix or implementation type: bug Something isn't working

Comments

@lukasfazik
Copy link

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)
@rsmontero rsmontero added type: bug Something isn't working category: context windows Windows OS contextualization packages status: accepted The issue is valid and will be planned for fix or implementation community Issue created by OpenNebula Community labels Dec 3, 2024
@rsmontero rsmontero added this to the Release 6.10.2 milestone Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: context windows Windows OS contextualization packages community Issue created by OpenNebula Community status: accepted The issue is valid and will be planned for fix or implementation type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants