Skip to content

Instantly share code, notes, and snippets.

@rikka0w0
Last active August 31, 2025 13:53
Show Gist options
  • Save rikka0w0/1c249e6336d5025fff636ef9758241e2 to your computer and use it in GitHub Desktop.
Save rikka0w0/1c249e6336d5025fff636ef9758241e2 to your computer and use it in GitHub Desktop.
OpenWrt in a PVE container
pct create 301 local:vztmpl/openwrt_24.10_rootfs.tar.gz --rootfs local-lvm:0.256 --ostype unmanaged --hostname openwrt --arch amd64 --cores 1 --memory 256 --swap 0 --unprivileged 1

where 301 is the VMID and cannot be changed once created. --ostype unmanaged determines that this operation cannot be done in the Web Gui.

The OpenWrt container starts but ujail does not work in an unprivileged container and it prevents critical services such as dnsmasq from running. One solution is:

opkg remove procd-ujail

or switch to a privileged container (should be preferred):

pct create 301 local:vztmpl/openwrt_24.10_rootfs.tar.gz --rootfs local-lvm:0.256 --ostype unmanaged --hostname openwrt --arch amd64 --cores 1 --memory 256 --swap 0 --unprivileged 0

References

  1. https://hev.cc/posts/2022/run-openwrt-systemd-nspawn
  2. https://discuss.linuxcontainers.org/t/networking-starts-with-a-5-min-delay/16356
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment