[SOLVED] LXC Container Config Overwritten on Container Restart

begleysm

Member
Jun 1, 2018
15
4
8
48
I'm attempting to mount a host directory in a container as per my other thread @ (https://forum.proxmox.com/threads/expose-cifs-share-to-lxc-container.44757/#post-213868).

I am able to get this to work by modifying the container config file. Specifically I'm adding something like

lxc.mount.entry = /mnt/share /var/lib/lxc/103/rootfs/mnt/share none bind 0 0
lxc-mount

to the bottom of config file at /var/lib/lxc/103/config

When I modify this file and start the Container everything works!

Now, my problem is, when I shutdown the Container, start it, and then go view /var/lib/lxc/103/config I find that the two lines I added to the bottom are gone!

How/where do I modify the container config where it will persist through restarts?
 
/etc/pve/lxc/<ctid>.conf But I suggest to use normal container mount point syntax instead of low level lxc configs.

Thanks dietmar! I found that config file location but sorta dismissed it because the format didn't match what I was seeing at /var/lib/lxc/103/config.

Regarding using "normal container mount point syntax" I wasn't familiar with this syntax but did a little googling and found the "Bind Mount Points" section of the "Linux Container" page on the Proxmox Wiki. (https://pve.proxmox.com/wiki/Linux_Container#_bind_mount_points).

I added this line to the bottom of /etc/pve/lxc/103.conf and it worked!
mp0: /mnt/share,mp=/mnt/share
Thanks,
begleysm
 

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!