Container with 4.15.18-1-pve kernel / kernel-headers

Thorsten119

Active Member
Jan 4, 2018
10
0
41
51
Ratingen
Hi,

I just rolled out a new container (based on template Ubuntu 18.04 standard). "uname -a" reports me:
Linux vlr-6 4.15.18-1-pve #1 SMP PVE 4.15.18-15 (Wed, 04 Jul 2018 15:42:56 +0200) x86_64 x86_64 x86_64 GNU/Linux

I want to install Asterisk from source and I tried to install the kernel header with:
apt-get install linux-headers-$(uname -r)

... but the headers are not found. Do I have to add another repo in sources.list?

Best regards, Thorsten
 
This package is not found per default. Maybe I have to add "Proxmox VE Test Repository"?

admin@test:~$ sudo apt install pve-headers-$(uname -r)
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package pve-headers-4.15.18-1-pve
E: Couldn't find any package by glob 'pve-headers-4.15.18-1-pve'
E: Couldn't find any package by regex 'pve-headers-4.15.18-1-pve'
 
You have to install the headers on the Proxmox VE host (not in the container).
 
Let me explain: I want to install Asterisk (from source) within a container. For that I need the kernel headers to compile asterisk. So I need the headers within the container itself. Or do I missing something?
 
A container is using the kernel from the host.

So if you need kernel modifications inside, a VM is probably a better choice.
 
before install asterisk, shutdown container
you need to disable all lxc apparmor security

add this code at /etc/pve/lxc/<vid>.conf
Code:
lxc.apparmor.profile: unconfined
lxc.mount.auto: cgroup:rw
lxc.mount.auto: proc:rw
lxc.mount.auto: sys:rw