-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prebuilt lxc/lxd images of nixos? #43781
Comments
Hi, #9735 has some discussion as to the past situation of LXC images of nixos. Earlier this year I wrote this hacky walkthrough to get an LXC container of NixOS going in Proxmox. As far as support? I don't know if the issues I had with I don't know what differences Promox has with other LXC solutions, so I can't really say how much of it applies. And as far as distributing images elsewhere, it's kind of a hassle, just as our iso images aren't distributed and mirrored at many locations. This is because every time the nixos release updates, a new iso image (and container images) have been built for that new update. It would need a constant feed of not-that-long-lived images. |
Fixes NixOS#43781 Add an LXD-based container. Based on some documentation found here: https://github.com/lxc/lxd/blob/master/doc/image-handling.md It’s very close to the lxc container image, but with the toplevel in rootfs/ and some meta information in metadata.yaml. I took some basic info from the NixOS configuration for this. My main use case is getting a Chrome OS laptop setup with Crostini. Eventually, I want to try to get this in some image registries like https://us.images.linuxcontainers.org/, but they don’t appear to have any process for including new distros. I’ve opened an issue here: lxc/lxc-ci#38
I guess the most convenient way for now would be that hydra builds that image. This could be easily imported via |
Hello, I'm a bot and I thank you in the name of the community for opening this issue. To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human. The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it. If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them. Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel. |
This issue is not stale for me, a new-comer to nixos. I use lxd images for development and prototyping, so it would be my primary platform for a nixos installation. |
I'm also still interested in using NixOS inside of LXC containers as the overhead compared to VMs is that much lower. A variety of issues I encountered are also mentioned in #9735 |
Tbh I'm unsure if this will happen. Someone would need to invest quite some time to make NixOS a first class citizen of lxc/lxd. That guy needs to be educated in NixOS and LXC/LXD with is I guess a rare combination. I tried to get generating NixOS in distrobuilder somehow but failed due the lack of knowledge. Maybe it's worth starting a dedicated discourse thread or updating the wiki to gather which problems currently occur and which tasks might be performed. But as you see it's quite hard to get some momentum to that topic. |
I marked this as stale due to inactivity. → More info |
Could you post your distrobuilder yaml config? I was hoping to give this a try |
@mberry I don't think I still have it. Even if I find it it's not in a state of being used. Your best chance of getting it to work you'll find here: https://discourse.nixos.org/t/running-nixos-18-09-in-an-lxd-3-8-container/1804 But I'm not sure it's still working tbh. |
There are hydra jobs that can be used to import a new image:
I believe The distrobuilder config requires more work to get going. matthewbauer has made an attempt, and so have I. Neither are complete. |
This should work without
|
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/lxd-distrobuilder-support-for-nixos/21375/1 |
The container images have been renamed and VM images have been added, for both aarch64 and x86_64. I should note that aarch64 has not been well tested, so please open an issue if you encounter problems. Container images should have https://hydra.nixos.org/job/nixos/trunk-combined/nixos.lxdContainerImage.x86_64-linux Virtual machines should have https://hydra.nixos.org/job/nixos/trunk-combined/nixos.lxdVirtualMachineImage.x86_64-linux custom imagesYou can also build your own images by importing the relevant LXD module (lxc-container or lxd-virtual-machine) and then building the necessary outputs. containerimport virtual-machineimport |
I can't find much information about running nixos in an lxc container. Are there any images for nixos such as those found on https://us.images.linuxcontainers.org/ ? Would it be difficult to create and list an image there?
The text was updated successfully, but these errors were encountered: