How to setup WSL2 in a multi user lab environment?

FB4 IMI 11 Reputation points
2021-05-07T07:55:59.24+00:00

Hi there,

is there a way to set up WSL2 in a multi-user environment (with roaming profiles and home folders on network drives) like a school computer lab? My users may log on any of teh windows systems in the labs for the courses. They don't have administrative rights on the systems.

I'm thinking about switching from Dual Boot Windows/Ubuntu systems to Windows only with WSL2 based Ubuntu.

My next windows version will be 20H2.

Any hints?

Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,918 questions
0 comments No comments
{count} vote

3 answers

Sort by: Most helpful
  1. Teemo Tang 11,366 Reputation points
    2021-05-10T07:54:21.523+00:00

    Unfortunately, if your device is a school computer and all users use standard user accounts(without admin right), you can’t set up WSL2. From the Microsoft document we can see that all command prompt operations need admin privilege.
    Install WSL on Windows 10 | Microsoft Learn
    https://video2.skills-academy.com/en-us/windows/wsl/install-win10

    -------------------------------------------------------------------------------------

    If the Answer is helpful, please click "Accept Answer" and upvote it.
    Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. FB4 IMI 11 Reputation points
    2021-05-10T10:54:33.42+00:00

    @Teemo Tang I don't think this really is the answer. I can enable WSL as the lab admin and download the Ubuntu appx package to a folder which normal users can read . When i log in as a normal user, i can navigate to that folder and install Ubuntu, e.g. by simply right click the package and choose install. After a while i get the Ubuntu Console.

    However the problem is the Ubuntu file system is located below %USERPROFILE%\Appdata\Local\Packages\Canonical...\Localstate\rootfs, and when i log off and log on again as the same user it is gone. I'd rather like to have these files somewhere else on the local drive, so that they persist. Of course my users will always have to use the same system, but i can live with that.


  3. Cheong00 3,471 Reputation points
    2021-05-11T07:00:18.423+00:00

    There is some possibility that could work...

    I don't want to setup VM just to test it, but if you have time, you may try to relocate the rootfs to publicly accessible folder like C:\rootfs and then replace that %USERPROFILE%\Appdata\Local\Packages\Canonical...\Localstate\rootfs with symbolic link (the mklink command) pointing to C:\rootfs and see if that works. (remember to copy all contents to C:\rootfs first)

    If WSL works after this change, you may copy the symbolic link to corresponding location of "Users\Default" , and then newly created users on that machine will automatically have this symbolic link pointing to correct location.

    ======

    If that does not work, you may want to replace that with "hard link" (mklink /h) instead. The drawback is that you cannot place the link in "Users\Default" or the whole set of folder will be duplicated instead of linked together, and you have to manually create "hard link" whenever you create new user.

    Since hard link is no different than the original folder reference, it should work as long as you don't have multiple users log on and use WSL the same time, and of course, all those users would share the same default user.

    0 comments No comments