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
lxc #19
Conversation
@Lassulus suggestion for the
|
I was wrong, |
can we somehow set the profile from inside the rootfs or metadata tarball? |
Just read the metadata code, I don't see the way to do this, seems like the only way is to create symlink to init path in image (like you did). @stgraber any suggestions on topic? thx! |
Testing thisSetup LXC & LXD
Add your user to group "lxd".
Logout and login to have a new session with that group membership. configure lxd
install from this branch
import image
show image
launch container from image
And finally, you can enter the container!
|
@Lassulus what is the problem there? i can run stuff :D
Even when including in the image with |
We specifically do not allow images to pass container configuration or profiles through as we treat images as untrusted and so they shouldn't have access to mechanisms that would allow privilege escalation or access to the host filesystem. For the init binary specifically, this is something that in theory could be added to the metadata (as it's not security sensitive), but there would be quite a bit of complexity related to storing that information and passing it on to containers that were created from it (just pre-filling Is there a reason why you can't create a |
@davidak If I remember correctly, it was because, if you run it with the default shell it was not able to find any binaries. If that is the intended usecase this is not a problem at all, but I guess people without prior NixOS experience would be confused by the non default location of bash. @stgraber thanks a lot for your answer, in the current approach I do this symlink, but I have to rebuild the upstream tarball again. If I could use /sbin/init directly I could use the upstream tarball which would speedup evaluation time and reduce code amount. If this is to complex I will stick with this approach. |
maybe add another symlink :D /bin/sh exists on NixOS but that's a general discussion about the philosophy of NixOS and probably had been taken with any newcomer... In any case, i would like to have this merged since it's already working quiet well. Any issue can be documented and fixed later. NixOS on LXC is requested in some places! |
@davidak I wonder how you get My guest
|
I have documented every step here: #19 (comment) I havn't done any additional commands to get it working. It just worked for me. So it would be interesting what's the difference between our setups. My system nixpkgs is at version nixos-19.03.173202.31d476b8797. You probably have a newer version since i havn't updates some weeks. Please create a new issue since this PR is merged and closed. |
should fix: #18
run with:
lxc image import $(./nixos-generate -f lxc-metadata) $(./nixos-generate -f lxc)
shell can be entered with
lxc exec $my-nixos-lxc -- /run/current-system/sw/bin/bash
stuff to do: