[Lxc-users] Running an NFS server within LXC

Papp Tamas tompos at martos.bme.hu
Mon Apr 15 19:23:38 UTC 2013


On 04/15/2013 09:13 PM, Istvan Balazs wrote:
> Dear Tamás!
>
> Theres is a workaround solution for this.
>
> We are using NFS mounts inside KVM guests. But can be achieved with native hosts too.
>
> 1. The KVM guest is the one who mounts the NFS mount folder , let's say:
> mount -t nfs 10.10.10.122:/nfsmount /nfsdata
>
> 2. Bind mount the NFS mounted partion into an existing custom LXC folder:
> mount --bind /nfsdata /var/lib/lxc/lxccontainer/lxcnfsmount.
>
> If the NFS base mount is /lxcnfsmount, and You would like to mount the subfolder "test1" to an other
> folder from the LXC container(/var/www/web1) You can do like this :
>
> 3.fstab entry content of the LXC container:(/var/lib/lxc/lxcontainer/fstab)
>   /var/lib/lxc/lxccontainer/rootfs/lxcnfsmount/test1 /var/lib/lxc/lxccontainer/rootfs/var/ww/web1
> none rw,bind,noatime,nodiratime,nosuid,nodev,noexec     0 0
>
> In this way you will be able to use the NFS mount in read-write mode, through the host system's
> (physical, or host KVM) NFS network stack.

AFAIK, he wants to have NFS _server_ in container. Am I wrong?

tamas





More information about the lxc-users mailing list