<div dir="ltr">Hello<div><br></div><div>Is there a way to set custom environment variables for LXC containers so that it is available for all processes within the container?</div><div><br></div><div>The libvirt-lxc driver seems to be setting up only the below variables (as per the docs), but there doesn't seem to be a way customize it.</div><div><dl style="padding:0px;margin:1em 0px;color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13.3333px"><dt style="margin-left:1em;margin-right:2em">container</dt><dd style="margin-left:2em;margin-right:2em;margin-bottom:0.5em">The fixed string <code>libvirt-lxc</code> to identify libvirt as the creator</dd><dt style="margin-left:1em;margin-right:2em">container_uuid</dt><dd style="margin-left:2em;margin-right:2em;margin-bottom:0.5em">The UUID assigned to the container by libvirt</dd><dt style="margin-left:1em;margin-right:2em">PATH</dt><dd style="margin-left:2em;margin-right:2em;margin-bottom:0.5em">The fixed string <code>/bin:/usr/bin</code></dd><dt style="margin-left:1em;margin-right:2em">TERM</dt><dd style="margin-left:2em;margin-right:2em;margin-bottom:0.5em">The fixed string <code>linux</code></dd><dt style="margin-left:1em;margin-right:2em">HOME</dt><dd style="margin-left:2em;margin-right:2em;margin-bottom:0.5em">The fixed string <code>/</code></dd></dl><p style="padding:0px;margin:1em 0px;color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13.3333px">In addition to the standard variables, the following libvirt specific environment variables are also provided</p><dl style="padding:0px;margin:1em 0px;color:rgb(0,0,0);font-family:Verdana,Arial,Helvetica,sans-serif;font-size:13.3333px"><dt style="margin-left:1em;margin-right:2em">LIBVIRT_LXC_NAME</dt><dd style="margin-left:2em;margin-right:2em;margin-bottom:0.5em">The name assigned to the container by libvirt</dd><dt style="margin-left:1em;margin-right:2em">LIBVIRT_LXC_UUID</dt><dd style="margin-left:2em;margin-right:2em;margin-bottom:0.5em">The UUID assigned to the container by libvirt</dd><dt style="margin-left:1em;margin-right:2em">LIBVIRT_LXC_CMDLINE</dt><dd style="margin-left:2em;margin-right:2em;margin-bottom:0.5em">The unparsed command line arguments specified in the container configuration. Use of this is discouraged, in favour of passing arguments directly to the container init process via the <code>initarg</code> config element.</dd><div><br></div><div><br></div><div>I am looking for something similar to this: <a href="https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html">https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html</a> (lxc.environment)</div><div><br></div></dl><div><div><div class="gmail_signature">Regards,<br>Harish</div></div>
</div></div></div>