Podman unable to run container with pasta error "Error: pasta failed with exit code 1" and "Failed to open() /dev/net/tun: No such file or directory"

Solution Unverified - Updated -

Environment

  • Red Hat Enterprise Linux 9
  • Podman
  • passt

Issue

  • pasta is failing to setup a tap device for the network namespace used with Podman when running a container
Error: pasta failed with exit code 1:
Failed to open() /dev/net/tun: No such file or directory
Failed to set up tap device in namespace

Resolution

  • Ensure that the tun kernel module is loaded and that the device file exists. To do this, you can run modprobe tun

Root Cause

  • The tun kernel module should be loaded automatically on system startup. If the kernel module or the device associated with the kernel module are removed, this issue will occur as pasta uses this device when setting up a tap device in a user's network namespace when running Podman containers.
  • If for some reason the tun module is not starting during system startup, please review the following link to enable it at system startup: https://access.redhat.com/solutions/230963

Diagnostic Steps

  • Check to see if the device file exists with ls -l /dev/net/tun.
  • Check to see if the kernel module is loaded with lsmod | grep tun. If the kernel module is loaded, you will see output.
  • Review the systems logs to determine if anything happened with the module or the device file.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments