Skip to content

Conversation

@robmry
Copy link
Contributor

@robmry robmry commented Oct 9, 2025

- What I did

In the dockerd-rootless.sh script, if there's no slirp4netns try pasta before falling back to VPNkit.

When pasta is the network driver, the default port driver is implicit instead of builtin.

Also (second commit), if slirp4netns is selected by env-var, still set its default MTU to 65520.

- How I did it

The notes at the top of the script say "Needs recent version of pasta (2023_12_04)" ... but I'm not sure how to check for that. The reported version number depends on the packager, and I don't know of a command line option to check for (like slirp4netns's check for `--netns-type). As it's no longer that new, perhaps a version check isn't essential ... but can add one if there's a way?

- How to verify it

On a Debian Trixie host, with moby 28.5.1, I tried ...

  • with slirp4netns installed, it was used as normal
  • without it ...
    • dockerd-rootless.sh -> ok (running with pasta)
      • started a rootless nginx with -p 8080:80 and checked it worked
    • DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=builtin dockerd-rootless.sh -> error
    • DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=implicit dockerd-rootless.sh -> ok
  • without slirp4netns or pasta or vpnkit -> error

- Human readable description for the release notes

- dockerd-rootless.sh: if slirp4netns is not installed, try using pasta (passt).

@robmry robmry self-assigned this Oct 9, 2025
@robmry robmry added kind/enhancement Enhancements are not bugs or new features but can improve usability or performance. impact/changelog area/rootless Rootless Mode labels Oct 9, 2025
@robmry robmry requested review from AkihiroSuda and vvoland October 9, 2025 17:07
@robmry robmry marked this pull request as ready for review October 9, 2025 17:44
@robmry robmry added this to the 29.0.0 milestone Oct 9, 2025
Comment on lines 114 to 123
fi
if [ -z "$net" ]; then
if command -v pasta > /dev/null 2>&1; then
net=pasta
if [ -z "$portdriver" ]; then
portdriver=implicit
fi
if [ -z "$mtu" ]; then
mtu=65520 # passt's default
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

This will still prefer slirp4netns right?
Do we want to make pasta the prefered one if it's available?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can easily swap them - but if people are happily using slirp4netns without explicitly specifying it, I figured we don't need to change things unless there's a good reason to swap them over. There may well be a good reason, I just don't know it.

At the moment, when using pasta, rootlesskit says this - which also made me think slirp4netns might still be best as a default, perhaps that warning can be removed though ...

WARN[0000] [rootlesskit:parent] "pasta" network driver is experimental. Needs very recent version of pasta (see docs/network.md).

(Once the RPM spec files are updated with a Requires: (slirp4netns | passt) ... if slirp4netns is already installed on upgrade, I don't think pasta will be installed if it's missing. And, RHEL 10 will have pasta and not slirp4netns.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, fine with that for now too, just wanted to check.

Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

LGTM, but would love to get a blessing from @AkihiroSuda!

--slirp4netns-sandbox=$DOCKERD_ROOTLESS_ROOTLESSKIT_SLIRP4NETNS_SANDBOX \
--slirp4netns-seccomp=$DOCKERD_ROOTLESS_ROOTLESSKIT_SLIRP4NETNS_SECCOMP \
$host_loopback --port-driver=$DOCKERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER \
$host_loopback --port-driver=$portdriver \
Copy link
Member

Choose a reason for hiding this comment

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

nit:

Suggested change
$host_loopback --port-driver=$portdriver \
$host_loopback --port-driver=$port_driver \

might look more consistent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

net=vpnkit
else
echo "Either slirp4netns (>= v0.4.0) or vpnkit needs to be installed"
echo "One of slirp4netns (>= v0.4.0), pasta (passt >= 2023_12_04), or vpnkit needs to be installed"
Copy link
Member

@AkihiroSuda AkihiroSuda Oct 9, 2025

Choose a reason for hiding this comment

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

The comments in L13, L14, and L15 has to be updated too

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

When DOCKERD_ROOTLESS_ROOTLESSKIT_MTU is not set, and ...
- DOCKERD_ROOTLESS_ROOTLESSKIT_NET is not set and slirp4netns
  is selected, MTU defaults to 65520.
- DOCKERD_ROOTLESS_ROOTLESSKIT_NET=slirp4netns, MTU defaults
  to 1500.

Change the logic so that, however slirp4netns is selected, MTU
defaults to 65520.

Signed-off-by: Rob Murray <[email protected]>
@robmry
Copy link
Contributor Author

robmry commented Oct 10, 2025

I've changed things around a bit ... previously, if slirp4netns was configured by env-var, MTU defaulted to 1500 rather than 65520. Similarly, the port driver for pasta would not have defaulted to implicit if it was configured by env var.

Now, both of those defaults are applied after picking a net driver (so MTU and port driver defaults both depend on net driver selection).

Also split the "no net driver found" check out of the vpnkit case.

@robmry robmry requested review from AkihiroSuda and vvoland October 10, 2025 09:28
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

Thanks

Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@vvoland vvoland merged commit d9cf791 into moby:master Oct 10, 2025
184 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/rootless Rootless Mode impact/changelog kind/enhancement Enhancements are not bugs or new features but can improve usability or performance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants