[SOLVED] LXC mountpoint breaks container

PeterMarcusH.

Member
Apr 5, 2019
99
3
13
29
LXC container instantly shutsdown when mount point is created. I have a folder i'd like to share to a privaliged container from the host.

Folder placement on lxc container id like files to be placed: /root/mnt
Folder placement on host to mount: /mnt/sdb

command used: pct set 114 -mp0 mp=/mnt/sdb,/root/mnt
 
Last edited:
hi,

can you post a debug log by running lxc-start -n 114 -l DEBUG -o /tmp/lxc.log and attach the log file here?

also please post the container configuration from pct config 114 and your pveversion -v output.
 
Running: lxc-start -n 114 -l DEBUG -o /tmp/lxc.log
Code:
root@SERVER:~# lxc-start -n 114 -l DEBUG -o /tmp/lxc.log
lxc-start: 114: lxccontainer.c: wait_on_daemonized_start: 843 No such file or directory - Failed to receive the container state
lxc-start: 114: tools/lxc_start.c: main: 308 The container failed to start
lxc-start: 114: tools/lxc_start.c: main: 311 To get more details, run the container in foreground mode
lxc-start: 114: tools/lxc_start.c: main: 314 Additional information can be obtained by setting the --logfile and --logpriority options

Container config:
Code:
root@SERVER:~# pct config 114
arch: amd64
cores: 32
hostname: Plex-igpu
memory: 50000
mp0: mp=/mnt/sdb,/root/mnt
net0: name=eth0,bridge=vmbr0,hwaddr=62:59:51:51:A0:CD,ip=dhcp,ip6=dhcp,type=veth
ostype: ubuntu
rootfs: local-lvm:vm-114-disk-0,size=50G
swap: 1000
lxc.cgroup.devices.allow: c 226:0 rwm
lxc.cgroup.devices.allow: c 226:128 rwm
lxc.cgroup.devices.allow: c 4:7 rwm
lxc.cgroup.devices.allow: c 29:0 rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file
lxc.mount.entry: /dev/tty7 dev/tty7 none bind,optional,create=file
lxc.mount.entry: /dev/fb0 dev/fb0 none bind,optional,create=file

pveversion:
Code:
root@SERVER:~# pveversion -v
proxmox-ve: 6.2-1 (running kernel: 5.4.34-1-pve)
pve-manager: 6.2-4 (running version: 6.2-4/9824574a)
pve-kernel-5.4: 6.2-1
pve-kernel-helper: 6.2-1
pve-kernel-5.4.34-1-pve: 5.4.34-2
ceph-fuse: 12.2.11+dfsg1-2.1+b1
corosync: 3.0.3-pve1
criu: 3.11-3
glusterfs-client: 5.5-3
ifupdown: 0.8.35+pve1
ksm-control-daemon: 1.3-1
libjs-extjs: 6.0.1-10
libknet1: 1.15-pve1
libproxmox-acme-perl: 1.0.3
libpve-access-control: 6.1-1
libpve-apiclient-perl: 3.0-3
libpve-common-perl: 6.1-2
libpve-guest-common-perl: 3.0-10
libpve-http-server-perl: 3.0-5
libpve-storage-perl: 6.1-7
libqb0: 1.0.5-1
libspice-server1: 0.14.2-4~pve6+1
lvm2: 2.03.02-pve4
lxc-pve: 4.0.2-1
lxcfs: 4.0.3-pve2
novnc-pve: 1.1.0-1
proxmox-mini-journalreader: 1.1-1
proxmox-widget-toolkit: 2.2-1
pve-cluster: 6.1-8
pve-container: 3.1-5
pve-docs: 6.2-4
pve-edk2-firmware: 2.20200229-1
pve-firewall: 4.1-2
pve-firmware: 3.1-1
pve-ha-manager: 3.0-9
pve-i18n: 2.1-2
pve-qemu-kvm: 5.0.0-2
pve-xtermjs: 4.3.0-1
qemu-server: 6.2-2
smartmontools: 7.1-pve2
spiceterm: 3.1-1
vncterm: 1.6-1
zfsutils-linux: 0.8.3-pve1
 
can you attach the /tmp/lxc.log logfile here?
 
can you attach the /tmp/lxc.log logfile here?
I did didnt i?

Code:
lxc-start: 114: lxccontainer.c: wait_on_daemonized_start: 843 No such file or directory - Failed to receive the container state
lxc-start: 114: tools/lxc_start.c: main: 308 The container failed to start
lxc-start: 114: tools/lxc_start.c: main: 311 To get more details, run the container in foreground mode
lxc-start: 114: tools/lxc_start.c: main: 314 Additional information can be obtained by setting the --logfile and --logpriority options
 
no - that's the output of the command, but it creates a log file in /tmp/lxc.log as well (which is the debug log, -o flag specifies the location).

please attach this file here. alternatively run cat /tmp/lxc.log and paste it here
 
thank you. here i see in the logfile:

Code:
lxc-start 114 20201116105340.291 DEBUG    conf - conf.c:run_buffer:312 - Script exec /usr/share/lxc/hooks/lxc-pve-prestart-hook 114 lxc pre-start produced output: directory '/root/mnt' does not exist
lxc-start 114 20201116105340.302 ERROR    conf - conf.c:run_buffer:323 - Script exited with status 2
lxc-start 114 20201116105340.302 ERROR    start - start.c:lxc_init:804 - Failed to run lxc.hook.pre-start for container "114"
lxc-start 114 20201116105340.302 ERROR    start - start.c:__lxc_start:1903 - Failed to initialize container "114"

can you try the following:

Code:
pct mount 114
mkdir /var/lib/lxc/114/rootfs/root/mnt
pct unmount 114
pct start 114

and see if the container starts?
 
For the following line mkdir /var/lib/lxc/114/rootfs/root/mnt, i dont have the folder root, should i just create one?
 
Something just seems off. When the folder is mounted i cant mount the container with pct mount 114. When then deleteing the original mount and then mounting via. pct mount 114 i cant run mkdir /var/lib/lxc/114/rootfs/root/mnt since the folder already exists. :confused:
 
if you've created the folder /root/mnt in the container can you try re-adding the mp0? does it start then?
 
Found the error. This command pct set 114 -mp0 mp=/mnt/sdb,/root/mnt Takes as the first mp /mnt/sdb the lxc file placement, and the second /mnt/sdb the host folder. These where switched.

The original posted, which is wrong: pct set 114 -mp0 mp=/mnt/sdb,/root/mnt
The new, which works: pct set 114 -mp0 mp=/root/mnt/sdb,/mnt/sdb
 
Found the error. This command pct set 114 -mp0 mp=/mnt/sdb,/root/mnt Takes as the first mp /mnt/sdb the lxc file placement, and the second /mnt/sdb the host folder. These where switched.

i was wondering this as well, glad the issue is solved!

please mark the thread as [SOLVED] for posterity by editing the thread title prefix :)
 

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!