Skip to content

Commit 7741740

Browse files
benhillisBen Hillis
andauthored
Add back WSL2_VM_ID environment varialbe to the system distro. (#13835)
Co-authored-by: Ben Hillis <[email protected]>
1 parent caf38dc commit 7741740

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/linux/init/init.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2258,7 +2258,16 @@ Return Value:
22582258
if (Value != nullptr)
22592259
{
22602260
Config.VmId = Value;
2261-
unsetenv(LX_WSL2_VM_ID_ENV);
2261+
2262+
//
2263+
// Unset the environment variable for user distros.
2264+
//
2265+
2266+
Value = getenv(LX_WSL2_SHARED_MEMORY_OB_DIRECTORY);
2267+
if (!Value)
2268+
{
2269+
unsetenv(LX_WSL2_VM_ID_ENV);
2270+
}
22622271
}
22632272

22642273
//

0 commit comments

Comments
 (0)