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

[Feature]: User Data Separation #955

Open
thecreativeone91 opened this issue Dec 4, 2024 · 2 comments
Open

[Feature]: User Data Separation #955

thecreativeone91 opened this issue Dec 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@thecreativeone91
Copy link

Is your proposal related to a problem?

No, enhancement only

Describe the solution you'd like.

Still thinking of ideas on this one but I think it would be good to make the docker container and the VM disk image more disposable. It would be good to see a way with container variables to configure more options; to keep user data outside the disk image. User Profile disks is one option but ideally something file level instead of block would be great. Folder redirection could be an option but with user profiles this can bring other issues and some data not captured (appdata etc) maybe something like fslogix might be an option as well but still block storage but better than user profile disks.

Application separation while extreme would be neat too; though I don't see this doable today as there is no real open source method for this that I know of. Only VMware App Volumes really exists in this space.

Describe alternatives you've considered.

N/A

Additional context

No response

@thecreativeone91 thecreativeone91 added the enhancement New feature or request label Dec 4, 2024
@harb88
Copy link

harb88 commented Dec 14, 2024

I think this should be as simple as adding something like this to the Microsoft-Windows-Shell-Setup component in the unattended answer files:

<FolderLocations>
    <ProfilesDirectory>D:\Users</ProfilesDirectory>
</FolderLocations>

Just add a second drive and point this at it. Could either be another virtual disk or another hard drive mounted into the container. This would at least allow persistence of user data between re-installs of windows. But it doesn't solve the problem of storing the data outside of the virtual disk, it just seperates it from the main windows virtual disk.

This could also allow for some seperation of applications as well since a lot of apps that are installed for "This user only" are generally installed in the users appdata folder.

Source: https://www.tenforums.com/tutorials/1964-move-users-folder-location-windows-10-a.html

@harb88
Copy link

harb88 commented Dec 14, 2024

I just tested the above and it almost works as expected.

I had to add a second disk to the unattended answer file so it mounts with the correct drive letter:

        <!-- Second hard drive -->
        <Disk wcm:action="add">
          <DiskID>1</DiskID>
          <WillWipeDisk>false</WillWipeDisk>
          <CreatePartitions>
            <!-- Data partition -->
            <CreatePartition wcm:action="add">
              <Order>1</Order>
              <Type>Primary</Type>
              <Extend>true</Extend>
            </CreatePartition>
          </CreatePartitions>
          <ModifyPartitions>
            <!-- Data partition -->
            <ModifyPartition wcm:action="add">
              <Order>1</Order>
              <PartitionID>1</PartitionID>
              <Label>Data</Label>
              <Letter>D</Letter>
              <Format>NTFS</Format>
            </ModifyPartition>
          </ModifyPartitions>
        </Disk>

Then I added the FolderLocations section to the Microsoft-Windows-Shell-Setup component under the <settings pass="oobeSystem"> section:

  <settings pass="oobeSystem">
    ... other components ...
    <component name="Microsoft-Windows-Shell-Setup" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
      <FolderLocations>
        <ProfilesDirectory>D:\Users</ProfilesDirectory>
      </FolderLocations>

This gets me a second virtual disk with the user folder on it. I added some files to the desktop and then stopped the container and deleted the windows virtual disk. When I restarted it ran through the install process again. Unfortunately it didn't automatically start the partitioning like it did on the first run but I just clicked Next and it did the re-install:
image

And yay I have a freshly installed windows with the existing secondary virtual disk with the users folder on it. The part where this all falls down though is that the re-install has added a new folder for my user account instead of re-using my old one. I can fix this by changing the user profile directory in the registry and then restarting.

So if I can get the registry change to be part of the unattended answer files, clean up the extra user folders that get created and figure out why it doesn't automatically do the disk partitioning anymore then we should at least have a way to keep user data persistent between windows installs.

I'll keep testing and post if I figure anything else out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants