Slow boot times with lxc

An old thread but wanted to say that I have the same issues with slow starting Containers (LXC) . Searched for about two days for a solution, read logs etc and then finally stumbled over this thread.

Changed the IPv6 Settings for the container from DHCP to SLAAC and now the container start in seconds and is accessible over ssh also in seconds after start.

Thank you for your help. And sorry if this makes some mod angry because I dug up an old thread!

Thank you very much and have a nice day!
 
Just wanted to reply that I've had this issue for well over a year and never found an answer. But, changing IPv6 for SLAAC also solved my problems. I guess when the network was starting it was stuck at DHCP for IPv6 on my network. I will have to read up on what SLAAC is and why it solved the problem...

The strange part is that when I first create and start a container it never has this issue, only when it starts for the second and subsequent times.
Still relevant (e.g. if you change fixed IP setting to DHCP and did not think about your router not handing out ipv6). Thanks!
 
One more year, now PVE 7.4-3, and ... I run into the same issues: my 1st lxc container required minutes to boot. But thanx to this thread, the issue is solved :D, start is more or less instantaneous. Great !

Best Regards, Wumpus
 
Last edited:
Still relevant (e.g. if you change fixed IP setting to DHCP and did not think about your router not handing out ipv6). Thanks!
Setting IPv6 to `Static` with no address also works.

SLAAC generates an address and then runs some duplicate detection, which adds some small overhead at least. I'm not sure what the overhead of SLAAC is but if you don't intend to use IPv6 (and you probably don't if you're reading this thread because IPv6 DHCP didn't work for you) you may as well disable IPv6 entirely.
 
I had the same problem. LXC boot was taking ~5 min, which I traced back to the networking service in systemd.

Switching IPv6 to static (and leaving the value blank) fixed the issue, and startup is now much faster.

[[ I am running Debian 12 LXC (kernel Linux 6.8.8-4-pve) with the Proxmox 8.2.4 hypervisor. ]]
 
I had the same issue with slow boot times for containers , and the issue was the IPV6 , changed to SLAAC and now the container loads in 1 second.
Thanks to commenters on this post :)
 
The SLAAC Saga
by a tired dad who just wanted a Minecraft server to boot




It is the year 2025, and an evil monster named DHCP IPv6 Virtual Assassin (DiVa) terrorizes the land of LXC containers, randomly forcing long boot times. With smug laughter and overconfidence, DiVa had no idea what was coming.


From the mist appeared SLAAC Against Protocols (SlaP), a misfit hero with its own lexicon and a story to tell. After years of dodging network traffic and unnecessary highways, SlaP finally emerged to confront DiVa’s whirlwind.


Packets drawn, with a 5000-yard stare, DiVa snarled. SlaP approached slowly and asked one question:


“What’d the five fingers say to the face?!”


“SLAAPPP!”


And just like that, the curse of slow boots was broken.
 
The SLAAC Saga
by a tired dad who just wanted a Minecraft server to boot




It is the year 2025, and an evil monster named DHCP IPv6 Virtual Assassin (DiVa) terrorizes the land of LXC containers, randomly forcing long boot times. With smug laughter and overconfidence, DiVa had no idea what was coming.


From the mist appeared SLAAC Against Protocols (SlaP), a misfit hero with its own lexicon and a story to tell. After years of dodging network traffic and unnecessary highways, SlaP finally emerged to confront DiVa’s whirlwind.


Packets drawn, with a 5000-yard stare, DiVa snarled. SlaP approached slowly and asked one question:


“What’d the five fingers say to the face?!”


“SLAAPPP!”


And just like that, the curse of slow boots was broken.
I’d watch this movie.

Sincerely,
A soldier who began fighting this war as the 6th comment in this thread, back in 2017, before anyone had identified the solution. Never thought this would still be an issue all these years later…
 
TLDR: I had to change the interface name from eth0 to eth1.

Full story:
So I had a bunch of slow starts just now. Some were also painfully show to shut down too. Probably been an issue for a while but I just didn't notice.
Anyway, in my case, I had a mix of containers which had
* no IPv6 address showing - slow to boot. Just over 2 minute delay from start to pingable... That's the clue it was a timeout. :(
* no IPv4 and no IPv6 - no idea if they were slow but obviously no networking at all:oops:
* IPv6 set to static with "none" showing a link local address (and some set to SLAAC with that working), and IPv4 working fine - I think these all booted up fast:)

I tried enabling SLAAC as others have suggested, but noticed no IPv6 address showed up still. This was true for both groups without IPv6 addresses. They still had no IPv6 (and no IPv4 for the ones in that group).
I then tried changing the interface name from eth0 to eth1. Everything suddenly appeared. IPv4 and IPv6. I then changed back to eth0 and it stayed. I tried shutting down one of the containers that previously was very slow to start, and it was now just 2 or 3 seconds.

Many of my containers date back to around late 2010. I started with PVE 1.6, and most of the core containers were built back then on OpenVZ and eventually migrated to LXC. I suspect this is part of the issue. Maybe old configs on the containers (all debian) have some references to the interface that block Proxmox either from trying or from making changes. Changing the interface name perhaps allows proxmox to recreate the whole config or something, either it's own or the one inside the container... I don't know LOL


Edit: Sigh... Just noticed one of the containers running Samba had not loaded Samba, so I rebooted it. It got stuck shutting down, then when I forced it off and back on, networking failed to load again. This time I've left the interface name changed to see if that helps. But I have doubts now.
 
Last edited: