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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

d-xo
Copy link
Contributor

@d-xo d-xo 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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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

@d-xo d-xo force-pushed the containers/writeable-apivfs branch from ca58961 to 9f2bca4 Compare November 16, 2019 13:13
@d-xo
Copy link
Contributor Author

d-xo commented Nov 16, 2019

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

@asymmetric
Copy link
Contributor

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 commented Dec 7, 2019

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

@flokli
Copy link
Contributor

flokli commented Dec 7, 2019

Also note #74761

@d-xo d-xo force-pushed the containers/writeable-apivfs branch from 9f2bca4 to f9a8787 Compare December 11, 2019 16:58
@d-xo
Copy link
Contributor Author

d-xo commented Dec 11, 2019

rebased on master and added tests 🙂

@d-xo d-xo force-pushed the containers/writeable-apivfs branch 2 times, most recently from 34ef00b to 5ca26a8 Compare December 11, 2019 17:04
@Moredread
Copy link
Contributor

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/
@d-xo d-xo force-pushed the containers/writeable-apivfs branch from 5ca26a8 to a0c869b Compare December 11, 2019 17:24
@d-xo
Copy link
Contributor Author

d-xo 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 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 https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 8, 2020
@asymmetric
Copy link
Contributor

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

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 9, 2020
@stale
Copy link

stale bot commented Jun 6, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 6, 2021
@wegank wegank marked this pull request as draft March 20, 2024 15:09
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
@wegank wegank added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants