[Nix-dev] nixos inside lxc container on non-NixOS host

Tomas Hlavaty tom at logand.com
Sat Oct 24 17:28:55 CEST 2015


Hi,

I would like to run NixOS inside a lxc container on ubuntu.  There seems
to be support for this but it is not clear to me, how to use it.

I can build a container:

$ nix-build release.nix -A containerTarball.i686-linux

I tried lxc-create -t ubuntu and then swapping the rootfs.  This seems
to work, except the container is bare and I would like to customize it
with my configuration.  Also the trick with the ubuntu template is not
great.

I followed https://nixos.org/wiki/NixOS_and_libvirt#mw-content-text but
that doesn't work, probably obsolete.  I also found
https://github.com/NixOS/nixpkgs/issues/1088#issuecomment-44971585
http://lists.science.uu.nl/pipermail/nix-dev/2014-August/013914.html so
it should be possible somehow.

Have somebody managed to install NixOS inside lxc container on non-NixOS
host?  Is there some documentation or other reading for this?

Thank you,

Tomas


More information about the nix-dev mailing list