Comments (7)
Having not had much luck in fixing this without reintroducing one form or another of the error it was introduced to eliminate, it appears Microsoft releasing their own systemd support has eliminated the problem (in newer versions of WSL, anyway) by eliminating the need to futz with binfmts at all.
Which is a cheap way out, but I'm going to take it, I'm afraid, given that said support has put a horizon on genie's long-term life anyway.
from genie.
Point of clarity:
It doesn't break WSL interop outside the bottle unless something else is wrong with your system. binfmts aren't namespaced; only the configuration filesystem for the feature is as part of the mount namespace.
So while you can't modify the state of your binfmts outside the bottle, any binfmts configured inside the bottle will be active outside and should work just fine. If they don't, you've got another problem.
from genie.
Maybe "break" is the wrong word.
The issue is that genie first unmounts /proc/sys/fs/binfmt_misc
, then sets up the bottle namespace and lets systemd mount it itself. Thus, after bottle initializiation and outside of the bottle, /proc/sys/fs/binfmt_misc
remains unmounted and programs that rely on it being mounted will fail.
One such example: wslvar
tries to grep /proc/sys/fs/binfmt_misc/WSLInterop
for the enabled flag, which causes grep to print a file not found error and wslvar to print an annoyinig warning message.
from genie.
On a freshly installed Ubuntu-20.04 WSL image with genie 2.3:
First without genie:
>wsl --shutdown
>wsl
$ genie -b
no-bottle
$ wslvar USERPROFILE
C:\Users\Elberet
$ grep binfmt_misc /proc/self/mounts
binfmt_misc /proc/sys/fs/binfmt_misc binfmt_misc rw,relatime 0 0
And after genie has booted the bottle:
$ genie -i
Waiting for systemd....!!
$ genie -b
outside
$ grep binfmt_misc /proc/self/mounts
$ wslvar USERPROFILE
grep: /proc/sys/fs/binfmt_misc/WSLInterop: No such file or directory
WSL Interopability is disabled. Please enable it before using WSL.
from genie.
Hm.
I'm going to think about this one.
To clarify why I'm going to think about this one, it's because this feature will make it easier for people to do something I really don't want them to do, namely operate outside the bottle with genie running. That wasn't something I expected people to try and do deliberately, and in fairness to that assumption, most of the cases I've seen where they have been doing it have been in error.
Because here's the thing: genie uses a container-light setup for the bottle, but it's a really leaky abstraction. It gets the pid and mnt namespaces it needs to make systemd run happily, and AppArmor support uses its own AA namespace to avoid contaminating other distributions, but in the interests of maintaining usability/simplicity, it shares all the others. And even if it didn't, there would still be a lot of things that leak even between distros (all the networking config, sysctl values, the actual implementation of binfmts, and on and on), and the list of things that leak between outside and inside the bottle is even worse.
This is why the warning that using genie in multiple distributions simultaneously is there, because they'll mutually interfere, and likewise that warning about how anything that needs systemd or a systemd-powered service (such as dbus) will fail unpredictably when executed outside the bottle. There's always been a tacit design implication that outside-the-bottle is left there as a life-support system for inside-the-bottle, not intended to continue as an environment in itself.
So I must contemplate whether this is a usage worth supporting/implicitly endorsing, or whether I wouldn't be better off just adding a much more explicit DO NOT DO THIS instruction to the documentation.
from genie.
Fair enough, my bashrc
actually contains a block to get me into the bottle by default.
This is more about cases where programs interact with WSL from the Windows side. Such tools will expect a 'standard' WSL environment, not a heavily customized userland in a systemd-controller namespace, and in my humble opinion, breaking that expectation on purpose is not a good idea.
Genie should not force users to choose between it and, for instance, the VSCode WSL remote plugin.
from genie.
That's a very good point. (And one I probably undervalue, since I tend to use the Linux-native VS Code from its snap.)
I won't be making changes for this in 2.4 (which has been delayed long enough already), but I'm going to think seriously about what can or can't be supported in 2.5.
from genie.
Related Issues (20)
- Manual page contains three dashes for each full name parameter instead of two HOT 1
- Genie with powerline HOT 9
- Genie 2.4 breaks WSL interop on Windows 10 HOT 7
- VSCode Will Not Load After Upgrading to 2.4 HOT 1
- installing gnome desktop (and its dependencies) breaks login (and potentially other commands) HOT 4
- Broken `systemctl status`
- logrotate.service fails HOT 2
- Cannot start genie propperly, "Failed to read server status". HOT 6
- Running wsl.exe from within distribution appears to hang forever [WSLInterop fails] HOT 2
- wslg-xwayland.service & wslg-xwayland.socket does not exist. HOT 4
- Systemd cannot enter unknown state and Genie cannot list any failed units HOT 5
- Failed to detect WSL2 instance HOT 1
- Systemd support is now available in WSL! HOT 1
- AUR package is missing HOT 1
- genie 2.5 showing as 2.4 HOT 1
- Is there a way to totally undo all the changes and make my system run as before? HOT 2
- Windows Update KB5015684 - Blackscreen when log in HOT 1
- Anyone has already tried on CentOS 7 ? HOT 3
- make install ERROR HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from genie.