Can't install kernel-nfs-server inside lxc container
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxc (Ubuntu) |
Invalid
|
Medium
|
Unassigned |
Bug Description
I'm trying to virtualize a package that depends on NFS by installing it in an LXC container.
The commands
sudo apt-get install nfs-kernel-server
sudo lxc-create -n nfstest -t download -- -d ubuntu -r xenial -a amd64
sudo lxc-start -n nfstest
sudo lxc-attach -n nfstest apt-get update
sudo lxc-attach -n nfstest apt-get install nfs-kernel-server
should install NFS server software inside the container, but instead fail with
...
Not creating home directory `/var/lib/nfs'.
nfs-utils.service is a disabled or a static unit, not starting it.
Setting up nfs-kernel-server (1:1.2.8-9ubuntu12) ...
A dependency job for nfs-server.service failed. See 'journalctl -xe' for details.
nfs-server.service couldn't start.
Creating config file /etc/exports with new version
Creating config file /etc/default/
A dependency job for nfs-server.service failed. See 'journalctl -xe' for details.
invoke-rc.d: initscript nfs-kernel-server, action "start" failed.
dpkg: error processing package nfs-kernel-server (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin (2.23-0ubuntu3) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu4) ...
Errors were encountered while processing:
nfs-kernel-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
sudo lxc-attach -n nfstest journalctl -xe reports:
Apr 27 15:42:59 nfstest systemd[1]: Failed to mount NFSD configuration filesystem
-- Subject: Unit proc-fs-nfsd.mount has failed
-- Defined-By: systemd
-- Support: http://
-- Unit proc-fs-nfsd.mount has failed.
-- The result is failed.
Presumably this is intended, and there is a way to configure lxc to allow
running nfs servers inside it (there are rumors of success on the web), but
https:/
and doesn't even mention the word nfs.
Likewise, https:/
doesn't even mention lxc.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: lxc 2.0.0-0ubuntu2
ProcVersionSign
Uname: Linux 4.4.0-21-generic x86_64
ApportVersion: 2.20.1-0ubuntu2
Architecture: amd64
CurrentDesktop: Unity
Date: Wed Apr 27 08:19:41 2016
InstallationDate: Installed on 2016-03-26 (32 days ago)
InstallationMedia: Ubuntu 16.04 LTS "Xenial Xerus" - Beta amd64 (20160323)
PackageArchitec
SourcePackage: lxc
UpgradeStatus: No upgrade log present (probably fresh install)
defaults.conf:
lxc.network.type = veth
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.network.hwaddr = 00:16:3e:xx:xx:xx
Changed in lxc (Ubuntu): | |
importance: | Undecided → Medium |
https:/ /help.ubuntu. com/lts/ serverguide/ lxc.html did provide a workaround: in the section on nesting, it mentioned
that enabling nesting allowed all sorts of mounts. So I added
lxc.mount.auto = cgroup default- with-nesting
lxc.aa_profile = lxc-container-
to the container's config file, restarted the container, and was then able to install the package.
So consider this a minor doc enhancement request.