-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] slirp4netns, binding to interface (wlan0), network not available #65
Comments
Hello @xiota
Definitely. Currently bubblejail is not actually using the By the way how well does the interface binding work for slirp4netns service? I never actually verified its function. |
I don't see any "crash". If I kill the network interface first and run
Then the application continues launching without internet access. (What I would like is to not launch the application, but send a notification with the reason for the failure. This could be behind an option if it's expected some people would want the application to continue running without internet access. In my case, it's a web browser that's useless without internet and slow to start/shutdown/restart.) When slirp4netns is working, it seems to do what it's supposed to do. The app is unable to access other network interfaces. |
It does exit with a non-zero exit code if a not a valid interface was passed. Therefore So it only a matter of plumbing the |
This is great. Works as expected. When the network interface is available, the program runs with internet access. When the interface is not available and run from a shortcut, I get a notification. Otherwise, I see an error message in the terminal. |
@igo95862 Having used this for a few days, I've noticed a couple issues:
|
This probably has something to do with interface binding. Could you check the stderr of bubblejail? bubblejail and slirp4netns share the stderr so whatever slirp4netns prints should be visible as the bubblejail's output.
Sure. I will add this. |
Looks like the main difference between the first run error and error when disconnected from internet is:
Also, looks like some output string is missing a newline somewhere. (See the error when disconnected from internet.) First run, network manager connected to internet. Error.
Second run, network manager connected to internet. No error.
When network manager disconnected from internet.
|
This one is interesting because I also encounter it when running the development environment and running an instance twice. Not sure what is causing it.
Pretty sure this is slirp4netns bug. |
Reopening because the underlying issue (slirp4netns not binding the interface on first run) still has not been resolved. Having some way to see the Error output from 0.8.1.r0.g806acc9 (basically same as before).
|
I can't reproduce it.
Slirp4netns is there. It shares stderr and stdout with bubblejail.
This is the output of slirp4netns. |
It is on first run only. Most reliable way to reproduce is after reboot.
Not the output. The command and options. See #75 |
I never encountered such issues. Are you using the SUID bwrap by any chance? |
By the way since its Python you can just insert a print statement somewhere here: https://github.com/igo95862/bubblejail/blob/806acc9064067f3f1342e1b10b7ff9c90066d4b1/src/bubblejail/services.py#L928C1-L928C1 |
Not as far as I can tell.
I will try. I also tried disabling and enabling different services. When only When |
Found this old issue that seems related. rootless-containers/slirp4netns#228 The last couple comments indicate that OP found a solution, but I have no idea what it was. Also found this: rootless-containers/slirp4netns#311 You point to this as the solution: bubblejail/src/bubblejail/services.py Lines 830 to 832 in 99b3c72
However, the equivalent lines in the current commit is different: bubblejail/src/bubblejail/services.py Lines 894 to 897 in 806acc9
|
Both old and new code solves the problem of a user namespace that is not bounded to any process id. Slirp4netns needs to be in the namespace that owns the network namespace you want to use slirp4netns for. Old code forked to a separate process that then switches to that unbounded user namespace and launches slirp4netns. However, it does not play that nice with async code. I realized a clever way of passing the unbounded user namespace to slirp4netns. All it takes is opening that unbounded namespace and then calling slirp4netns using |
The Currently bubblejail expects something like this (visualized with
This hierarchy happens when bwrap |
Fixed by 0.8.2 release (12307c4). |
Output of
bubblejail --version
AUR-git 0.8.0.r3.gc38a98f
Your distro name and version
Arch
Description
Frequently, when starting an instance with network limited to a specific interface (wlan0) using slirp4netns, internet is not available. Internet usually works after shutting down the program and restarting bubblejail. (Possibly some race condition causing the network interface to be unavailable during the first run.)
Would be nice if bubblejail quit with notification when it is unable to establish a connection to the interfaces through slirp4netns. This way, the user can fix the problem and try again without waiting for the program to fully load.
The text was updated successfully, but these errors were encountered: