containerd / containerd/nerdctl

Rootless on WSL2 arm64 not working (`failed to create bridge \"nerdctl0\": could not add \"nerdctl0\": operation not permitted`)

Open
#3,423 1 comment 0 reactions 0 assignees View on GitHub
area/rootless kind/unconfirmed-bug-claim platform/Windows/WSL2
Dominant language
Go
Stars
10.4k
Forks
826
Avg merge
1d 23h
Merged PRs (30d)
44

Description

### Description

Since Homebrew does not support Linux on arm, I've installed manually using `containerd-rootless-setuptools.sh`, along with manually installing the cni plugins at `/opt/cni/bin`. I'm also using the recommended configuration for getting cgroups2 working in WSL. Everything seems to work fine, except that when I run a nerdctl command, I get an error, e.g.:

```
$ nerdctl run hello-world
FATA[0000] failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error running hook #0: error running hook: exit status 1, stdout: , stderr: time="2024-09-08T14:00:32-04:00" level=fatal msg="failed to call cni.Setup: plugin type=\"bridge\" failed (add): failed to create bridge \"nerdctl0\": could not add \"nerdctl0\": operation not permitted"
Failed to write to log, write /.local/share/nerdctl/1935db59/containers/default/14c2b8b90c39addeec86e7f538c8df69edc12138bf129e7a809d0cede07bc62c/oci-hook.createRuntime.log: file already closed: unknown
```

Running `systemctl --user status containerd` reveals the same error in the startup logs for containerd. If I run `nerdctl` with `sudo`, everything works as expected, so I'm thinking this must be something to do with the rootlesskit wrapper.

### Steps to reproduce the issue

1.
2.
3.

### Describe the results you received and expected

Received: nerdctl only works with sudo

Expected: nerdctl should work without sudo (rootless)

### What version of nerdctl are you using?

```
$ nerdctl version
Client:
Version: v1.7.6
OS/Arch: linux/arm64
Git commit: 845e989f69d25b420ae325fedc8e70186243fd93
buildctl:
Version: v0.16.0-rc1
GitCommit: c958c686e9ebf6b7d754881b92ba23b7859c5e59

Server:
containerd:
Version: v1.7.21
GitCommit: 472731909fa34bd7bc9c087e4c27943f9835f111
runc:
Version: 1.1.13
GitCommit: v1.1.13-0-g58aa9203-dirty
```

### Are you using a variant of nerdctl? (e.g., Rancher Desktop)

None

### Host information

```
$ nerdctl info
Client:
Namespace: default
Debug Mode: false

Server:
Server Version: v1.7.21
Storage Driver: overlayfs
Logging Driver: json-file
Cgroup Driver: systemd
Cgroup Version: 2
Plugins:
Log: fluentd journald json-file syslog
Storage: native overlayfs
Security Options:
seccomp
Profile: builtin
cgroupns
rootless
Kernel Version: 5.15.153.1-microsoft-standard-WSL2
Operating System: Ubuntu 22.04.4 LTS
OSType: linux
Architecture: aarch64
CPUs: 12
Total Memory: 15.35GiB
Name: malenia
ID: 5d9fd62a-bc4f-4747-a105-53fccff4f6a1

WARNING: No swap limit support
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.