-
-
Notifications
You must be signed in to change notification settings - Fork 15.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
lxd: fails to launch containers #25280
Comments
Solved this a while ago with:
I'm not 100% sure if both of these are required or are still relevant, so please keep that in mind. EDIT: These instructions are misleading/inaccurate. Please refer to #25280 (comment). |
We should fix this in the lxd module. |
I would love to, but I don't have much free time right now; salvaging what looks relevant from my configuration.nix gives me security.apparmor = {
enable = true;
profiles = [
"${pkgs.lxc}/etc/apparmor.d/usr.bin.lxc-start"
"${pkgs.lxc}/etc/apparmor.d/lxc-containers"
];
packages = [ pkgs.lxc ];
} EDIT: fixed typo in code |
Just a note to say that although I have added the configuration suggested in #25280 (comment) I still cannot start containers. Specifically, System information:
(but I have also tried unsuccessfully with the stock kernel and the 4.13 one) # /etc/nixos/lxd.conf
{ config, pkgs, ... }:
{
virtualisation.lxd.enable = true;
virtualisation.lxc.enable = true;
# https://github.com/NixOS/nixpkgs/issues/25280#issuecomment-316971140
security.apparmor = {
enable = true;
profiles = [
"${pkgs.lxc}/etc/apparmor.d/usr.bin.lxc-start"
"${pkgs.lxc}/etc/apparmor.d/lxc-containers"
];
packages = [ pkgs.lxc ];
};
} (I also tried to add
Error log
|
I reinstalled NixOS on my laptop for an unrelated reason so I was forced to go through setting up lxd again; I'm documenting what works along with links that helped. Hopefully someone with a bit more NixOS expertise can update the module so we don't have to deal with this. Apologies to @stefano-m; #25280 (comment) was kind of misleading.
This will give you errors as shown here: #25280 (comment) and raphael/linux-samus#103
This will now give you these messages as shown here: lxc/lxc#1895
The lxc issue in question has a comment with a workaround that seems to involve disabling apparmor altogether, but this can also be fixed by adding the relevant apparmor profiles (I can't remember where or how I found this information).
security.apparmor = {
enable = true;
profiles = [
"${pkgs.lxc}/etc/apparmor.d/usr.bin.lxc-start"
"${pkgs.lxc}/etc/apparmor.d/lxc-containers"
];
packages = [ pkgs.lxc ];
}; Now |
Now #34803 has been merged, I believe all you need to do to get lxd up and running is to enable lxd in configuration.nix, |
This issue seems relevant: https://github.com/lxc/lxd/issues/2834 |
As of 18.09, |
AFAIK this is now solved ( |
Issue description
Trying to launch a container produces an error.
$ lxc info --show-log test | grep ERROR
Steps to reproduce
set
virtualisation.lxd.enable = true;
and add use to group"lxd"
, then run$ lxc launch ubuntu:16.04 test
Technical details
nixos-version
, Ubuntu/Fedora:lsb_release -a
, ...)17.09pre106117.c90998d5cf (Hummingbird)
nix-env --version
)nix-env (Nix) 1.11.8
nix-instantiate --eval '<nixpkgs>' -A lib.nixpkgsVersion
)"17.09pre106117.c90998d5cf"
2.0.2
The text was updated successfully, but these errors were encountered: