Bug 1004724

Summary: kernel.shmmax can't be changed inside an lxc container
Product: [Community] Virtualization Tools Reporter: Oskari Saarenmaa <oskari>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED WONTFIX QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: crobinso, greg, rbalakri, redhat.bugs
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-04-10 14:41:10 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Oskari Saarenmaa 2013-09-05 11:01:58 UTC
Description of problem:
Libvirt creates a new IPC namespace in containers which resets any IPC values set on the host side (such as kernel.shmmax) and mounts a new /proc readonly which won't allow kernel.shmmax (or any other sysctl) to be changed inside the container.  This is a problem for applications, such as PostgreSQL (prior to version 9.3), which require a lot of sysv shared memory.

# sysctl -w kernel.shmmax=1000000000
error: "Read-only file system" setting key "kernel.shmmax"

Version-Release number of selected component (if applicable):
libvirt-1.1.2-1.fc20

Comment 1 Gregory Haynes 2013-12-12 19:57:30 UTC
I have been able to work around this be remounting proc/sys read-writeable:

sudo mount -o remount rw /proc/sys

Comment 2 Cole Robinson 2016-04-10 14:41:10 UTC
This is basically by design. More info in this docker discussion which more or less applies to libvirt lxc as well.

https://github.com/docker/docker/issues/10176

Their suggestion is to change the shmmax value on the host