Skip to content

AppArmor blocks TUN device creation, breaking tools like opencode #56

@tito

Description

@tito

Description

When running greywall -- opencode, the sandbox blocks TUN device creation and RTNETLINK operations, preventing opencode from setting up its networking:

RTNETLINK answers: Operation not permitted
ioctl(TUNSETIFF): Operation not permitted
Cannot find device "tun0"
Cannot find device "tun0"
Cannot find device "tun0"
ERROR 2026-03-24T22:01:37 +62ms service=models.dev error=Unable to connect. Is the computer able to access the url? Failed to fetch models.dev

Root cause

This appears to be caused by AppArmor restricting the ioctl(TUNSETIFF) and RTNETLINK operations inside the bubblewrap sandbox. The tool tries to create a TUN device for its own networking, which AppArmor denies.

Reference: https://docs.monadical.com/j0hgdOyRQea_f8SWIYJwPw#

Environment

  • greywall v0.2.8
  • greyproxy v0.3.2
  • Linux kernel 6.17
  • Platform: linux

Steps to reproduce

  1. greywall check (all checks pass)
  2. greywall -- opencode
  3. Observe TUN/RTNETLINK errors and network failure

Expected behavior

opencode should be able to reach the network through greyproxy's SOCKS5 proxy without needing to create a TUN device, or AppArmor should allow the necessary operations for tools that require TUN devices.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions