{"id":147,"date":"2016-12-23T12:57:14","date_gmt":"2016-12-23T12:57:14","guid":{"rendered":"http:\/\/www.beer.org\/blog\/?p=147"},"modified":"2018-12-08T14:04:29","modified_gmt":"2018-12-08T14:04:29","slug":"nfs-client-mount-within-a-proxmox-lxc-container","status":"publish","type":"post","link":"https:\/\/www.beer.org\/blog\/index.php\/2016\/12\/23\/nfs-client-mount-within-a-proxmox-lxc-container\/","title":{"rendered":"NFS client mount within a Proxmox LXC container."},"content":{"rendered":"<p>Another &#8220;memo to self&#8221; &#8230;<\/p>\n<p>&nbsp;<\/p>\n<p>[ Edit: minor change for Proxmox 5.x at bottom]<\/p>\n<p>Having trouble doing an NFS mount from within a Proxmox LXC container? \u00a0A google search took me\u00a0<a href=\"https:\/\/forum.proxmox.com\/threads\/lxc-nfs.23763\/\">here<\/a>\u00a0and it pretty much answers the question but doesn&#8217;t work with Proxmox 4.4-1. \u00a0The error I was seeing after following the advice in the above was:<\/p>\n<pre>apparmor=\"STATUS\" operation=\"profile_replace\" profile=\"unconfined\" name=\"lxc-container-default-cgns\" pid=11339 comm=\"apparmor_parser\"<\/pre>\n<p>So you also need to edit \/etc\/apparmod.d\/lxc\/lxc-container-default-cgns and make it look like so:<\/p>\n<pre># Do not load this file. Rather, load \/etc\/apparmor.d\/lxc-containers, which\r\n# will source all profiles under \/etc\/apparmor.d\/lxc\r\n\r\nprofile lxc-container-default-cgns flags=(attach_disconnected,mediate_deleted) {\r\n #include &lt;abstractions\/lxc\/container-base&gt;\r\n\r\n# the container may never be allowed to mount devpts. If it does, it\r\n # will remount the host's devpts. We could allow it to do it with\r\n # the newinstance option (but, right now, we don't).\r\n deny mount fstype=devpts,\r\n mount fstype=nfs,\r\n mount fstype=cgroup -&gt; \/sys\/fs\/cgroup\/**,\r\n}<\/pre>\n<p>and then subsequently do:<\/p>\n<pre>service apparmor reload<\/pre>\n<p>Edit: On proxmox 5.2-1 the file is\u00a0\/etc\/apparmor.d\/lxc\/lxc-default-cgns.\u00a0 The rest of the above is still correct.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Another &#8220;memo to self&#8221; &#8230; &nbsp; [ Edit: minor change for Proxmox 5.x at bottom] Having trouble doing an NFS mount from within a Proxmox LXC container? \u00a0A google search took me\u00a0here\u00a0and it pretty much answers the question but doesn&#8217;t work with Proxmox 4.4-1. \u00a0The error I was seeing after following the advice in the&#8230; <a class=\"moretag\" href=\"https:\/\/www.beer.org\/blog\/index.php\/2016\/12\/23\/nfs-client-mount-within-a-proxmox-lxc-container\/\">Continue reading &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,7],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-memotoself","category-tech-stuff"],"_links":{"self":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=147"}],"version-history":[{"count":3,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":198,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/posts\/147\/revisions\/198"}],"wp:attachment":[{"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.beer.org\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}