Skip to content
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

nixos-containers: allow writable api fs #73467

Open
wants to merge 1 commit into
base: master
from

Conversation

@xwvvvvwx
Copy link
Contributor

@xwvvvvwx xwvvvvwx commented Nov 15, 2019

Motivation for this change

I run network-manager and dhcpcd in containers as part of a namespace based whole internet wireguard vpn solution. Both of these packages will not work unless they can write to /proc/sys/net, so require the SYSTEMD_NSPAWN_API_VFS_WRITABLE environment variable (see here for docs) to be set.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @

Copy link
Contributor

@bjornfor bjornfor left a comment

The commit message doesn't say why we need writeable api fs. Also, I thought this enabled that feature by default. Saying "nixos-containers: add ... option" in commit subject might make that clearer.

@asymmetric
Copy link
Contributor

@asymmetric asymmetric commented Nov 16, 2019

Also, I would add a link to the relevant systemd documentation to the commit - the option's documentation is very hard to find!

@xwvvvvwx xwvvvvwx force-pushed the xwvvvvwx:containers/writeable-apivfs branch from ca58961 to 9f2bca4 Nov 16, 2019
@xwvvvvwx
Copy link
Contributor Author

@xwvvvvwx xwvvvvwx commented Nov 16, 2019

rebased on master and addressed review comments. Thanks @bjornfor and @asymmetric :)

@asymmetric
Copy link
Contributor

@asymmetric asymmetric commented Dec 7, 2019

This is good stuff, I've been using it on one of my servers and it works. Can we get it merged?

@flokli @NinjaTrappeur @arianvp @andir

@flokli
Copy link
Contributor

@flokli flokli commented Dec 7, 2019

@xwvvvvwx, @asymmetric can you add a simple nixos vm test that exercises this functionality?

@flokli
Copy link
Contributor

@flokli flokli commented Dec 7, 2019

Also note #74761

@xwvvvvwx xwvvvvwx force-pushed the xwvvvvwx:containers/writeable-apivfs branch from 9f2bca4 to f9a8787 Dec 11, 2019
@xwvvvvwx
Copy link
Contributor Author

@xwvvvvwx xwvvvvwx commented Dec 11, 2019

rebased on master and added tests 🙂

@xwvvvvwx xwvvvvwx force-pushed the xwvvvvwx:containers/writeable-apivfs branch 2 times, most recently from 34ef00b to 5ca26a8 Dec 11, 2019
@Moredread
Copy link
Contributor

@Moredread Moredread commented Dec 11, 2019

@xwvvvvwx The link to the docs din your PR description doesn't work (anymore). It is (now) https://systemd.io/ENVIRONMENT/

BTW, do you have your config for the wireshark VPN online?

Allows network-manager and dhcpcd to be run in a nixos-container when
the container is sharing the host network or has been launched using the
`--network-namespace-path` option.

env var documented here: https://systemd.io/ENVIRONMENT/
@xwvvvvwx xwvvvvwx force-pushed the xwvvvvwx:containers/writeable-apivfs branch from 5ca26a8 to a0c869b Dec 11, 2019
@xwvvvvwx
Copy link
Contributor Author

@xwvvvvwx xwvvvvwx commented Dec 11, 2019

@Moredread thanks 🙂. Updated PR description and commit message accordingly.

BTW, do you have your config for the wireshark VPN online?

This PR in combination with #71328 lets me do something like this: https://ipfs.io/ipfs/QmVzMqS5abxDku6VSVKDg2bFqqdrwb8V69WKSYJ8kq4rHH to configure a whole internet wireguard vpn using network namespaces.

@stale
Copy link

@stale stale bot commented Jun 8, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.
@stale stale bot added the 2.status: stale label Jun 8, 2020
@asymmetric
Copy link
Contributor

@asymmetric asymmetric commented Jun 9, 2020

I would still be interested in seeing this merged, once the conflicts are resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

7 participants
You can’t perform that action at this time.