<span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hi Stéphane,</span><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Okay finally getting back to this. It looks like option 4 doesn't appear to work on <span class="il" style="background-image:initial;background-color:rgb(255,255,204)">12.04</span>(Canonical's EC2 AMI). I've tried to use the following fstab entry located in /var/lib/<span class="il" style="background-image:initial;background-color:rgb(255,255,204)">lxc</span>/<container>/fstab;</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
/mnt/container /mnt none bind 0 0</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
When I start the container the host emits the following error in syslog;</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Aug 30 16:17:25 ip-10-58-122-168 kernel: [30146397.707635] type=1400 audit(1346343445.967:42): apparmor="DENIED" operation="mount" info="failed flags match" error=-13 parent=20530 profile="<span class="il" style="background-image:initial;background-color:rgb(255,255,204)">lxc</span>-container-default" name="/var/lib/ureadahead/debugfs/" pid=20582 comm="ureadahead" fstype="debugfs" srcname="none" flags="rw"<br>
<br>The /mnt/container folder on the host is owned by root and has 0777 permissions. Is creating an AppArmor profile my best option at this point or is there something I'm missing?</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Merci beaucoup!</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Nathan</div><br><div class="gmail_quote">On 2 August 2012 18:38, Stéphane Graber <span dir="ltr"><<a href="mailto:stgraber@ubuntu.com" target="_blank">stgraber@ubuntu.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 08/02/2012 11:59 AM, Nathan Fisher wrote:<br>
> Hi,<br>
><br>
> Previously using Ubuntu 11.10, upgraded to 12.04. Under 12.04, NFS<br>
> shares no longer function due to AppArmor constraints on the mount command.<br>
><br>
> What is the prescribed best practise to mount NFS shares within a Guest<br>
> that will minimise maintenance with future Ubuntu updates for 12.04?<br>
><br>
> I see three options at the moment;<br>
><br>
> 1) Mount within the host.<br>
<br>
</div>That might not work because of the different mount namespaces.<br>
<div class="im"><br>
> 2) Modify the AppArmor profile for lxc-containers (will this evolve<br>
> within 12.04 LTS?)<br>
<br>
</div>That's certainly an option and we might be doing it by default as I<br>
don't think nfs is really dangerous to mount.<br>
<br>
> 3) Disable AppArmor.<br>
<br>
That's obviously a pretty bad idea :)<br>
<br>
4) Add the line to /var/lib/lxc/<container>/fstab instead of /etc/fstab<br>
This will get lxc to mount it for you when creating the container. At<br>
that point of the process, the apparmor profile shouldn't prevent it<br>
from happening (though I haven't tested it).<br>
<div class="HOEnZb"><div class="h5"><br>
<br>
> Are there any other options that I've missed? Option 2 is the most<br>
> desirable as it means the guest is self-contained and *somewhat*<br>
> transportable between a cluster of hosts.<br>
><br>
> Thanks!<br>
><br>
> Nathan<br>
> w: <a href="http://junctionbox.ca/" target="_blank">http://junctionbox.ca/</a><br>
<br>
<br>
</div></div><span class="HOEnZb"><font color="#888888">--<br>
Stéphane Graber<br>
Ubuntu developer<br>
<a href="http://www.ubuntu.com" target="_blank">http://www.ubuntu.com</a><br>
<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Nathan Fisher<div> w: <a href="http://junctionbox.ca/" target="_blank">http://junctionbox.ca/</a></div><br>