<div dir="auto">Disable udev and make your own device nodes is a great idea as a beginning. I call it static dev since /dev was supposed to be tmpfs.<div dir="auto"> After make tty and other nodes you have a headless (text) linux . Make /dev/graphics/* if you want to run x11 application.</div></div><div class="gmail_extra"><br><div class="gmail_quote">2017年4月26日 下午11:11,"Spike" <<a href="mailto:spike@drba.org">spike@drba.org</a>>寫道:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">thank you Fajar and T.C.,<div><br></div><div>your experience is very precious and the lxc template looks very good as a source of inspiration. I'll try commenting out everything in fstab and see what happens. Other pages I found like this one<span style="font-size:small"> </span><a href="https://snikt.net/blog/2014/03/22/convert-kvm-image-to-lxc-container/" style="font-size:small" target="_blank">https://snikt.net/blog/<wbr>2014/03/22/convert-kvm-image-<wbr>to-lxc-container/</a> suggested other steps as the creation of devices manually as udev is not supported in the container. I guess coming from KVM that will be taken care of, however I'm wondering if things like system-udevd needs to be adjusted for example. Maybe the lxc template will clarify that.</div><div><br></div><div style="font-size:small">thanks,</div><div style="font-size:small"><br></div><div style="font-size:small">Spike</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Apr 26, 2017 at 8:01 AM Fajar A. Nugraha <<a href="mailto:list@fajar.net" target="_blank">list@fajar.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 26, 2017 at 9:40 PM, Spike <span dir="ltr"><<a href="mailto:spike@drba.org" target="_blank">spike@drba.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">yeah I've seen that link before and used the lxd image publish / export approach (it's what I'm doing right now in fact). However that post isn't very clear on what it takes to start from scratch. There is a section on "Manually building an image", but the critical step (2), says: "Configure anything that’s needed for the distribution to work properly in a container (if anything is needed)." and that's really what I'm asking here.<div><br></div><div>Because I have everything set up with a fair amount of "magic" to pxe boot and configure bare metal and KVM instances, I'd like to use that process and avoid having to write more to create the rootfs.</div><div><br></div><div>So maybe a better question would be, given a qcow2 (or raw) image created with kvm, what are the necessary steps to convert that so that it can be used inside a container?</div></div></blockquote><div><br></div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>If you have an ubuntu image, you should be able to simply comment-out all entry in fstab, and use it as container rootfs.</div><div><br></div><div>I have an ubuntu zfsroot AMI for EC2 (which already has an empty fstab). And the steps to convert THAT is 'nothing' (if you can tolerate some delays in service starting, due to zfs errors inside the containers), or simply uninstall some packages (zfsutils-linux, anything related to cloud-init, all kernel versions)</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div> that said having the same steps starting from debootstrap could be handy.</div><div><br></div></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>rootfs created by lxc templates should also be usable in lxd: <a href="https://github.com/lxc/lxc/tree/master/templates" target="_blank">https://github.com/lxc/<wbr>lxc/tree/master/templates</a></div><div>the files include debootstrap/yum and configure steps.</div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br></div><div>-- </div><div>Fajar</div></div></div></div>
______________________________<wbr>_________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org" target="_blank">lxc-users@lists.<wbr>linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.<wbr>org/listinfo/lxc-users</a></blockquote></div>
<br>______________________________<wbr>_________________<br>
lxc-users mailing list<br>
<a href="mailto:lxc-users@lists.linuxcontainers.org">lxc-users@lists.<wbr>linuxcontainers.org</a><br>
<a href="http://lists.linuxcontainers.org/listinfo/lxc-users" rel="noreferrer" target="_blank">http://lists.linuxcontainers.<wbr>org/listinfo/lxc-users</a><br></blockquote></div></div>