question

FB4IMI-1519 avatar image
1 Vote"
FB4IMI-1519 asked CharlesStevenson-5718 published

How to setup WSL2 in a multi user lab environment?

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

cheong00 avatar image
0 Votes"
cheong00 answered cheong00 edited

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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

FB4IMI-1519 avatar image
0 Votes"
FB4IMI-1519 answered CharlesStevenson-5718 published

@TeemoTang-MSFT 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.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sorry, I only give my idea from Windows side, I think you need all users setup WSL2 in Windows 10
Check this similar case for a hint.
https://github.com/microsoft/WSL/issues/3817
In fact, for WSL related issue, you’d better ask for help from github forum
The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn.
Thanks for your understanding and cooperating.

0 Votes 0 ·

@FB4IMI-1519 I have the same issue. When I log out and then back in my WSL is broken. I'd also like to know how to point to a location other than within %USERPROFILE%\Appdata ... please post something here if you find a workaround for roaming profiles.

0 Votes 0 ·
TeemoTang-MSFT avatar image
0 Votes"
TeemoTang-MSFT answered

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 Docs
https://docs.microsoft.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.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.