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

QWT: redirect known folders instead of relocating user profile #5916

Open
iamahuman opened this issue Jun 29, 2020 · 7 comments
Open

QWT: redirect known folders instead of relocating user profile #5916

iamahuman opened this issue Jun 29, 2020 · 7 comments
Labels
C: windows-tools P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.

Comments

@iamahuman
Copy link

iamahuman commented Jun 29, 2020

The problem you're addressing (if any)

  • To move towards removing "move user profile" which does not always work properly in Windows 10.
  • To use a documented and supported way of relocating user data for moving user data to the private volume.

Describe the solution you'd like

  • Remove the NT native application responsible for relocating the user profile.
  • Use Win32 IKnownFolderManager::Redirect (COM) to migrate individual user directories instead.

Where is the value to a user, and who might that user be?
Properly working user profile migration, without risking Windows Update.

Describe alternatives you've considered
Not applicable.

Additional context
Moving the user profile to another volume is unsupported by Microsoft and known to break updates which involve filesystem transactions spanning both system files and user profiles. See the following docs from Microsoft for more information.

TODO: decide specifically which directories are suitable for migration. Specifically, redirecting AppData (Local, LocalRow, and Roaming) seems possible, but would it break if the destination is another volume?

Relevant documentation you've consulted

Related, non-duplicate issues
TBD

@iamahuman iamahuman added P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality. labels Jun 29, 2020
@marmarek
Copy link
Member

Isn't that going to break user registry changes (HKEY_CURRENT_USER branch)? When only some folders will be moved to "private" volume (the only persistent in TemplateBasedVM), other parts of the user profile will be reset on VM restart.

@iamahuman
Copy link
Author

iamahuman commented Jun 29, 2020

@marmarek You mean Ntuser.dat?

Thinking about it, if an update makes changes to the user registry, it won't be applied to TemplateBasedVMs, but moving Ntuser.dat to foreign volume might break the update.

Perhaps do some weird tricks to HKU and HKCU, in the same manner as how Qubes Linux VMs bind mount /rw/home to /home?

@marmarek
Copy link
Member

Thinking about it, if an update makes changes to the user registry, it won't be applied to TemplateBasedVMs, but moving Ntuser.dat to foreign volume might break the update.

How is that different from performing update on one user and then logging into another? That should work by design.

@iamahuman
Copy link
Author

iamahuman commented Jun 30, 2020

@marmarek If both users are local, then Windows Update will apply changes to both of them at the same time.

For Qubes however, the user profiles in the TemplateBasedVMs are not visible at the time the update is applied.

Since "roaming profiles" are a thing, perhaps we can do away with somehow tricking Windows into thinking a user profile migration has happened when starting a TemplateBasedVM after updating its TemplateVM. This might perhaps trigger the annoying "getting user profile ready" dialog, but I know nothing about this route yet.

The most ideal scenario is that Windows will automatically recognise outdated registry and perform changes accordingly.

Side note: in a Windows system with multiple local users, does it attempt to update the system and all the users atomically at once even if one or more of them are logged out at the moment and will not necessarily require completely synchronised update in the same transaction?

@andrewdavidwong andrewdavidwong added C: windows-tools help wanted This issue will probably not get done in a timely fashion without help from community contributors. labels Jun 30, 2020
@andrewdavidwong andrewdavidwong added this to the TBD milestone Jun 30, 2020
@andrewdavidwong andrewdavidwong removed this from the Release TBD milestone Aug 13, 2023
@bi0shacker001
Copy link

Out of curiosity... Windows allows folder mounts. Can't we just mount the private disk on C:/Users ?

@DemiMarie
Copy link

DemiMarie commented Mar 28, 2024

@bi0shacker001 To me, that seems like the best option by far. A user profile migration can be triggered to handle system updates. Windows used to not support updates in this case, but that has been fixed. I think.

@omeg
Copy link
Member

omeg commented Apr 29, 2024

The current profile mover creates a symlink instead of a mount point. I'll be testing various methods soon to see how they behave (might be tricky with needing a system update to properly test...).

From the docs the IKnownFolderManager::Redirect API only allows redirecting particular user's profile, not the whole Users directory -- this might be enough if the user won't create new accounts or there's a way to set a default location for new profiles.

Edit:
Apparently even the user's profile root can't be relocated (%USERPROFILE% (%SystemDrive%\Users\%USERNAME%))

Note The user profile root folder (FOLDERID_Profile) does not support redirection.

Only subfolders of the profile (like Downloads, Documents etc) can be relocated by this method. This is useless for our purposes then because user's registry data is kept in a file in the root of their profile.

@omeg omeg removed the help wanted This issue will probably not get done in a timely fashion without help from community contributors. label Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: windows-tools P: default Priority: default. Default priority for new issues, to be replaced given sufficient information. T: enhancement Type: enhancement. A new feature that does not yet exist or improvement of existing functionality.
Projects
None yet
Development

No branches or pull requests

6 participants