LXC container will not start

BullToad

Member
Jan 15, 2021
3
0
6
54
while attempting to setup learning more about containers I made my DNS file on my container immutable inside of the container ( I was trying to get localdomain dns resolution working). After rebooting i now cannot start my container, knowing the issue is the DNS file in the container itself am i able to somehow crack the container open and fix the file? I have a backup so i can easily delete and restore if needed but would rather learn if i can fix this.
Also how do i enable snapshots? They always seem to be grey on all of my containers and i can't figure out why.
 
If this helps verify it, below is the log file from foreground mode, how do i change this ?


lxc-start 102 20210115175900.641 DEBUG conf - conf.c:run_buffer:326 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 102 lxc pre-start with output: close (rename) atomic file '/etc/resolv.conf' failed: Operation not permitted
 
So this is an ask a question solve it yourself type of deal.... I believe i resolved this after digging through some old fourm topics. Namely this one helped https://forum.proxmox.com/threads/lxc-container-didnt-start.27440/

Below is how i solved my issue


Code:
root@prox:~# pct mount 102
mounted CT 102 in '/var/lib/lxc/102/rootfs'



root@prox:~# lsattr /var/lib/lxc/102/rootfs/etc/resolv.conf
----i---------e---- /var/lib/lxc/102/rootfs/etc/resolv.conf
root@prox:~# chattr -i /var/lib/lxc/102/rootfs/etc/resolv.conf
root@prox:~# lsattr /var/lib/lxc/102/rootfs/etc/resolv.conf
--------------e---- /var/lib/lxc/102/rootfs/etc/resolv.conf
root@prox:~# pct unmount 102
 
Great that you found the solution yourself and for taking the time to share it!
Please mark the thread as 'SOLVED' this helps other users who also run into this kind of issue

Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!