Unable to create LXC with DHCP from template on Proxmox VE 9.0.3

Feb 20, 2024
6
0
1
I recently updated to Proxmox VE 9.0.3 from 8.something (it's a single Proxmox host, so no clustering or anything), and now that Debian 13 is out, I wanted to update my VMs and containers. My VMs upgraded fine, but whenever I attempted to upgrade my LXCs, they would never boot (just stayed at a black screen). So, I figured I'd just recreate them on a new container that's already on Debian 13.

To do this, I downloaded one from the linuxcontainers.org site:

Bash:
wget 'https://images.linuxcontainers.org/images/debian/trixie/amd64/default/20250808_05:24/rootfs.tar.xz' -O /mnt/pve/MYSTORAGE/template/cache/debian-13-standard_linuxcontainers_13.0_amd64.tar.xz

However, whenever I try to create a container with it, I'm receiving the following error:

Code:
extracting archive '/mnt/pve/MYSTORAGE/template/cache/debian-13-standard_linuxcontainers_13.0_amd64.tar.xz'
Total bytes read: 409671680 (391MiB, 383MiB/s)
Detected container architecture: amd64
unable to open file '/etc/network/interfaces.tmp.6356' - No such file or directory
TASK ERROR: unable to create CT 106 - error in setup task PVE::LXC::Setup::post_create_hook

What am I doing wrong here?
 
So, I was trying to use DHCP with it, but I figured that since it was failing on the network piece there, I'd try setting it up with the network defaults, and that worked. It seems the difference is leaving it on a static IP (which succeeds) for IPv4 vs changing it to DHCP (which fails). Is this supposed to happen? I don't see anything about it in the manual.

Edit: Though, it seems that trying to boot the container with DHCP selected fails with:

Code:
run_buffer: 571 Script exited with status 1
lxc_init: 845 Failed to run lxc.hook.pre-start for container "106"
__lxc_start: 2034 Failed to initialize container "106"
TASK ERROR: startup for container '106' failed
 
Last edited:
same issues here.

but when I create a CT from that image and don't change anything in the network settings, I can start the CT. And it has a DHCP connection. Changing anything in the network settings e.g. add a fixed IP or set it to DHCP gives an error.

See also https://github.com/pimox/pimox7/issues/160

This apparently happens because the container uses systemd-network instead of ifupdown2. Disabling the systemd-network service, installing ifupdown2 and enabling the networking service makes Proxmox configuration work.
 
Last edited:
  • Like
Reactions: waltar
I actually found this, which helped get me going.

What I did was essentially what that page documents:
  1. Download the newest cloud Trixie image from LinuxContainers (rootfs.tar.xz) and put it where container templates go, with a useful name
  2. Created a new container with the default settings
  3. On the Proxmox host, ran pct start <CT_ID>
  4. Then: pct enter <CT_ID>
  5. Then: mkdir /etc/network
  6. Then: exit
  7. Then: pct shutdown <CT_ID>
  8. After that, I went into the Proxmox UI and changed the container network config to DHCP
  9. Then: pct start <CT_ID>
  10. Then: pct enter <CT_ID>
  11. Then: ip link set eth0 up
  12. Then: dhclient eth0
  13. Then: ip addr | grep eth0
  14. Then: apt update
  15. Then: apt install ifupdown2
  16. Then: reboot
At that point, the container booted and ran just fine. It'd be nice to be able to use these container images directly, though.