<div dir="ltr">Would it not be better to use a stacked file system, such as overlayfs or aufs, then discard the changes?<div><br>Cal</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Dec 19, 2013 at 12:49 AM, Antonin Bas <span dir="ltr"><<a href="mailto:antoninb@stanford.edu" target="_blank">antoninb@stanford.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I am trying to run an application container with lxc-execute. I am<br>
going to run "untrusted" student codes in this container and I want<br>
the root file system to be shared with the host but read-only. I<br>
thought this would be as easy as using the following configuration<br>
file:<br>
<br>
# Container with new network withtout network devices<br>
lxc.utsname = omega<br>
lxc.network.type = empty<br>
lxc.network.flags = up<br>
<br>
lxc.rootfs = /tmp/guest/rootfs<br>
lxc.mount.entry=/ /tmp/guest/rootfs/ none ro,bind 0 0<br>
<br>
However, when I run `sudo lxc-execute -n test -f grader.conf<br>
--logpriority=DEBUG -- /bin/bash`, I get the following message:<br>
<br>
lxc-execute: Read-only file system - error unlinking<br>
/usr/lib/x86_64-linux-gnu/lxc/dev/kmsg<br>
<br>
lxc-execute: failed to setup kmsg for 'test'<br>
lxc-execute: Read-only file system - failed to create directory<br>
'/usr/lib/x86_64-linux-gnu/lxc/lxc_putold'<br>
<br>
lxc-execute: Read-only file system - failed to create pivotdir<br>
'/usr/lib/x86_64-linux-gnu/lxc/lxc_putold'<br>
lxc-execute: failed to setup pivot root<br>
lxc-execute: failed to set rootfs for 'test'<br>
lxc-execute: failed to setup the container<br>
lxc-execute: invalid sequence number 1. expected 2<br>
lxc-execute: failed to spawn 'test'<br>
<br>
<br>
Is it possible to have some insight on what the problem is here?<br>
I am using Ubuntu 13.10, and my lxc is the one from the official repo<br>
(1.0.0.alpha1).<br>
<br>
Thanks you in advance for your help,<br>
<br>
Antonin<br>
_______________________________________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" target="_blank">http://lists.linuxcontainers.org/listinfo/lxc-users</a><br>
</blockquote></div><br></div>