HELP WITH LXC NOT STARTING AUTOMATICALLY AT BOOT

dva411

New Member
Feb 13, 2024
29
0
1
I have an unprivileged lxc for jellyfin that supports hardware transcoding and Authentik integration, however, IT NEVER boots automatically. It fails in pre-start. However, when I start it manually, it starts every time and works perfectly. It has bindmounts to a samba share on the host. The samba share is a LUKS encrypted drive that is passed through to an Ubuntu VM, that unlocks at boot with Clevis. That takes a little time for it to unlock, and I'm running Samba in a docker container, so that has a little delay.... I thought it might be a timing issue with the LXC, so I tried delaying the start of the lxc, but that doesnt work. It doesnt matter how big of a delay I put on the lxc, it fails almost instantly on startup (seems the delay doesnt impact the pre-start? Maybe timing isnt the issue in the first place?
:
Code:
run_buffer: 322 Script exited with status 19
lxc_init: 844 Failed to run lxc.hook.pre-start for container "120"
__lxc_start: 2027 Failed to initialize container "120"
TASK ERROR: startup for container '120' failed
 
Last edited:
Hello,

Did you check the system logs at the time of one such error?
 
It turned out to be timing as I assumed. The LXC was starting before the SMB mount on the host was available. I finally came across a thread that indicated that I needed to put the "START DELAY" on the VM that contains samba, not the LXC. I think the verbage is very confusing, but that's how it works. So in this case my order would be VM100 order 0 start delay 60; LXC order 1. I had been putting the start delay on the LXC, and it was having no impact. Apparently the start delay impacts the 'next' container/VM in the order (not the current).
 
I thought it was working for a while, now the LXC starts, but for some reason my SMB share never finishes mounting on the host. I guess SAMBA isn't available in the VM until after boot is complete on the host. So while my Jellyfin lxc starts, I have to manually mount my CIFS on the host before it can be used. I need a better solution that would wait for smb before mounting. Probably outside of fstab?