無法在 centos 7 lxc 容器上啟動 nfs-server

無法在 centos 7 lxc 容器上啟動 nfs-server

我在主機上Linux Mint 19.2 Tina安裝了內核,並且版本為 lxc4.15.0-54-generic3.0.3

問題是我無法啟動nfs-server在容器中啟動。

我所做的步驟:

$ sudo systemctl stop apparmor
$ sudo apt-get install nfs-kernel-server
$ ls -l /lib/modules/$(uname -r)/kernel/fs | grep nfs
drwxr-xr-x 5 root root  4096 июл 29 13:48 nfs
drwxr-xr-x 2 root root  4096 июл 29 13:48 nfs_common
drwxr-xr-x 2 root root  4096 июл 29 13:48 nfsd
$ cat /etc/mtab | grep nfs
nfsd /proc/fs/nfsd nfsd rw,relatime 0 0
$ lxc launch images:centos/7 centos-nfs
$ lxc exec centos-nfs bash
# yum install nfs-utils
# systemctl start nfs-server
A dependency job for nfs-server.service failed. See 'journalctl -xe' for details

systemctl -t mount我看到錯誤時

在此輸入影像描述

UPD

# journalctl --no-pager -u nfs-server
Jan 12 13:30:45 centos-nfs systemd[1]: Dependency failed for NFS server and services.
Jan 12 13:30:45 centos-nfs systemd[1]: Job nfs-server.service/start failed with result 'dependency'.

可能是什麼問題以及如何解決它?

答案1

這可能與內核模組有關。當嘗試在容器內載入核心模組時,LXC 會導致問題。嘗試使用 KVM 代替。

相關內容