Closed claudiusraphael closed 2 years ago
Thanks for trying Distrod first!
Are you running a Linux kernel you built by yourself? Anyway, could you try the following Python script with sudo
and see if it causes an error?
import os
from ctypes import *
libc = CDLL("libc.so.6")
source = b"/tmp"
MS_BIND = 4096
MS_SHARED = 1<<20
print(str(libc.mount(source, source, None, MS_BIND | MS_SHARED, None)))
print(str(os.error()))
Are you running a Linux kernel you built by yourself?
Nope, it is the fresh standard install provided by Microsoft on Windows 10 Stable Channel, installed from CMD/PS via wsl --install
which is the short form of wsl --install --distribution Ubuntu
and therefore installs the stable version of Ubuntu, which is at the moment Ubuntu 20.04.3 with all updates/backports from up to and including Ubuntu 21.10 (friendly name Ubuntu
in wsl --list --online
) - this is Microsoft's default release for WSL2, whereas Ubuntu-20.04
would be the original release-version of Canonical Ubuntu 20.04 LTS, so 20.04.0, which also incorporates the WSL2 customized kernel by Microsoft, but is not based on the point-releases.
Regarding the mentioned script it would be preferable if you could provide a summary of what it actually does. Also, it is not clear if you mean to run that script in the Distrod
wsl-distro as installed by distrod_wsl_launcher.exe
or if you refer to install Option 2 which uses the Ubuntu
wsl-distro default which was referenced here from the Install (Option 2) failed ... issue.
Distrod
wsl-distro (Fedora 35):[cldsrphl@D11MMWNX0SDPS66ENGUS cldsrphl]$ uname -a
Linux D11MMWNX0SDPS66ENGUS 4.4.0-19041-Microsoft #1237-Microsoft Sat Sep 11 14:32:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux
[cldsrphl@D11MMWNX0SDPS66ENGUS cldsrphl]$ sudo python3
Python 3.10.0 (default, Oct 4 2021, 00:00:00) [GCC 11.2.1 20210728 (Red Hat 11.2.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> from ctypes import *
>>> libc = CDLL("libc.so.6")
>>> source = b"/tmp"
>>> MS_BIND = 4096
>>> MS_SHARED = 1<<20
>>>
>>> print(str(libc.mount(source, source, None, MS_BIND | MS_SHARED, None)))
-1
>>> print(str(os.error()))
>>> exit()
Ubuntu
wsl-distro (Ubuntu 20.04.3)cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ uname -a
Linux D11MMWNX0SDPS66ENGUS 4.4.0-19041-Microsoft #1237-Microsoft Sat Sep 11 14:32:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux
cldsrphl@D11MMWNX0SDPS66ENGUS:/mnt/c/Users/cldsrphl$ sudo python3
[sudo] password for cldsrphl:
Python 3.8.10 (default, Sep 28 2021, 16:10:42)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> from ctypes import *
>>> libc = CDLL("libc.so.6")
>>> source = b"/tmp"
>>> MS_BIND = 4096
>>> MS_SHARED = 1<<20
>>>
>>> print(str(libc.mount(source, source, None, MS_BIND | MS_SHARED, None)))
-1
>>> print(str(os.error()))
>>> exit()
If the python-code needs to be invoked in another way than by starting the interpreter with sudo, please provide the correct way - while i am willing to invest time to investigate the issue at hand i will not invest any more time in the self-contradictory mess that is python (i guess that makes it clear what my standpoint is regarding that "language").
I hope it helps. Let me know how to go on. I am open for any kind of experiments, including time-intensive exercises as compiling a custom kernel if it might be helpful - as long as needing to understand Python is not part of the exercise, meaning executing python-code i am fine with but nothing more - i would rather rewrite Windows 95 in brainfck than wrestling that oroborus (just in case i wasn't clear enough, lol).
Hi! Thanks so much for taking your time for the investigation. It helped a lot! With that Python script, I wanted to check if the mount
system call with MS_BIND | MS_SHARED
flag succeeds or not in your environment. It does almost nothing than checking it. So, any environment was ok as far as it uses the same kernel, which is why I forgot to mention the desired test environment.
The result you shared is very interesting... So, -1
means it fails in your environment, which succeeds in my environment, 4.19.128-microsoft-standard
and 5.10.60.1-microsoft-standard-WSL2
. I guess setting MS_SHARED
with MS_BIND
at the same time is not correct usage of mount
system call, so the old kernel was returning error to it.
I've released a new version which fixed how to call mount
flag. Could you try it and check if the problem is fixed, please?
Thanks!
Hi @claudiusraphael From your output of uname -a
, it turns out that your installing Distrod as a WSL 1 instance. Set your default WSL version to 2.
This output means you're using WSL1.
Linux D11MMWNX0SDPS66ENGUS 4.4.0-19041-Microsoft #1237-Microsoft Sat Sep 11 14:32:00 PST 2021 x86_64 x86_64 x86_64 GNU/Linux
Please explain what indicates it as "installed as WSL 1 instance", for better understanding.
Besides that:
I made sure that WSL 2 was the default version, right after the initial install. WSL was indeed by default set to version 2 already.
I checked the installed instances of "Ubuntu" and "distrod" and they were setup as version 2.
I again checked for the set default, which was version 2 still.
I made sure the Kernel-Update is installed.
When installing Docker-Desktop it asked me to enable WSL 2 and install the required Kernel-Update. As it turns out this part of the installation is scripted and not actively checking the actual status, because when i did what i was asked installation/activation/update was not possible/necessary, because it was already WSL 2 active and default set to version 2 and Docker started without problems.
I nonetheless repeated the check and just in case tried to set the version of "distrod" specifically to version 2 to override it assuming the possibility it could be version 1 but showing due to unknown reasons as version 2. That was not the case, it was not offering a conversion.
I did all what is listed already on my first-try before creating the post regarding the second completely from scratch fresh setup specifically to test distrod. In both cases (on an existing system in use for months working perfectly fine regarding WSL 2 with and without Docker Desktop) as well as the fresh setup one it was identical behaviour.
In the meanwhile i repeated the task with the actual Insider Beta-Channel of Windows 10 Pro and the Dev-version of Windows 11 Pro on the otherwise mentioned two test-systems. The end-result is the exact same as i posted here. So please elaborate once more on possibilities why.
I have setup a fresh 2 TB Samsung QVO 870 SSD with Windows 11 Pro in the meanwhile to speed up testing and development.
I will repeat the install of distrod on this system once Visual Studio/Andorid Studio and diverse other stuff is done being installed in full.
Following the README, choosing Option 1 i checked that default for WSL is version 2, then downloaded the .zip linked in Step 1 and executed the .exe to run Distrod. The following is the (self-explaining) output:
The following is (redacted/freed from personal data) info about my system - commands executed in CMD:
Please advise how to go on, what commands/procedures might help to investigate the issue.
Note: I was already running the default Ubuntu wsl-distro as installed originally via
wsl --install
(not the Ubuntu-20.04 - this one was added later). After the initial setup (specifying user/passwd) i ransudo apt update
andsudo apt full-upgrade
- the latter was processing when i executeddistrod
- mentioning in case there is a need to not have a wsl-distro already running when doing the install viadistrod
.I will now try Option 2, by applying it to the fresh setup and updated
Ubuntu
wsl-distro.