我在尝试启动 lxc 容器时遇到错误。顺便说一句,我正在使用 LXD。我面临的错误是:
ubuntu@ubuntu-blade1:~$ sudo lxc start test
error: Error calling 'lxd forkstart test /var/lib/lxd/containers /var/log/lxd/test/lxc.conf': err='exit status 1'
Try `lxc info --show-log test` for more info
我检查了日志,它有以下内容:
Log:
lxc 20160721110431.287 INFO lxc_start - start.c:lxc_check_inherited:251 - closed inherited fd 3
lxc 20160721110431.287 INFO lxc_start - start.c:lxc_check_inherited:251 - closed inherited fd 8
lxc 20160721110431.290 INFO lxc_container - lxccontainer.c:do_lxcapi_start:797 - Attempting to set proc title to [lxc monitor] /var/lib/lxd/containers test
lxc 20160721110431.290 INFO lxc_start - start.c:lxc_check_inherited:251 - closed inherited fd 8
lxc 20160721110431.291 INFO lxc_lsm - lsm/lsm.c:lsm_init:48 - LSM security driver AppArmor
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:342 - processing: .reject_force_umount # comment this to allow umount -f; not recommended.
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:446 - Adding native rule for reject_force_umount action 0
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:do_resolve_add_rule:216 - Setting seccomp rule to reject force umounts
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:449 - Adding compat rule for reject_force_umount action 0
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:do_resolve_add_rule:216 - Setting seccomp rule to reject force umounts
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:342 - processing: .[all].
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:342 - processing: .kexec_load errno 1.
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:446 - Adding native rule for kexec_load action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:449 - Adding compat rule for kexec_load action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:342 - processing: .open_by_handle_at errno 1.
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:446 - Adding native rule for open_by_handle_at action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:449 - Adding compat rule for open_by_handle_at action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:342 - processing: .init_module errno 1.
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:446 - Adding native rule for init_module action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:449 - Adding compat rule for init_module action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:342 - processing: .finit_module errno 1.
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:446 - Adding native rule for finit_module action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:449 - Adding compat rule for finit_module action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:342 - processing: .delete_module errno 1.
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:446 - Adding native rule for delete_module action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:449 - Adding compat rule for delete_module action 327681
lxc 20160721110431.291 INFO lxc_seccomp - seccomp.c:parse_config_v2:456 - Merging in the compat seccomp ctx into the main one
lxc 20160721110431.291 INFO lxc_conf - conf.c:run_script_argv:367 - Executing script '/usr/bin/lxd callhook /var/lib/lxd 1 start' for container 'test', config section 'lxc'
lxc 20160721110431.291 INFO lxc_start - start.c:lxc_check_inherited:251 - closed inherited fd 3
lxc 20160721110431.291 INFO lxc_start - start.c:lxc_check_inherited:251 - closed inherited fd 8
lxc 20160721110431.293 INFO lxc_monitor - monitor.c:lxc_monitor_sock_name:178 - using monitor sock name lxc/d78a9d7e97b4b375//var/lib/lxd/containers
lxc 20160721110431.307 DEBUG lxc_start - start.c:setup_signal_fd:289 - sigchild handler set
lxc 20160721110431.308 DEBUG lxc_console - console.c:lxc_console_peer_default:469 - no console peer
lxc 20160721110431.308 INFO lxc_start - start.c:lxc_init:488 - 'test' is initialized
lxc 20160721110431.308 INFO lxc_confile - confile.c:config_idmap:1500 - read uid map: type u nsid 0 hostid 100000 range 65536
lxc 20160721110431.308 DEBUG lxc_start - start.c:__lxc_start:1326 - Not dropping cap_sys_boot or watching utmp
lxc 20160721110431.308 INFO lxc_confile - confile.c:config_idmap:1500 - read uid map: type g nsid 0 hostid 100000 range 65536
lxc 20160721110431.308 INFO lxc_start - start.c:resolve_clone_flags:1013 - Cloning a new user namespace
lxc 20160721110431.309 ERROR lxc_conf - conf.c:instantiate_veth:2595 - failed to attach 'veth4IAQLB' to the bridge 'lxdbr0': Operation not permitted
lxc 20160721110431.354 ERROR lxc_conf - conf.c:lxc_create_network:2872 - failed to create netdev
lxc 20160721110431.354 ERROR lxc_start - start.c:lxc_spawn:1080 - failed to create the network
lxc 20160721110431.354 ERROR lxc_start - start.c:__lxc_start:1353 - failed to spawn 'test'
lxc 20160721110431.354 INFO lxc_conf - conf.c:run_script_argv:367 - Executing script '/usr/share/lxcfs/lxc.reboot.hook' for container 'test', config section 'lxc'
lxc 20160721110431.857 INFO lxc_conf - conf.c:run_script_argv:367 - Executing script '/usr/bin/lxd callhook /var/lib/lxd 1 stop' for container 'test', config section 'lxc'
lxc 20160721110431.992 WARN lxc_commands - commands.c:lxc_cmd_rsp_recv:172 - command get_cgroup failed to receive response
lxc 20160721110431.992 WARN lxc_commands - commands.c:lxc_cmd_rsp_recv:172 - command get_cgroup failed to receive response
lxc 20160721110431.994 INFO lxc_confile - confile.c:config_idmap:1500 - read uid map: type u nsid 0 hostid 100000 range 65536
lxc 20160721110431.994 INFO lxc_confile - confile.c:config_idmap:1500 - read uid map: type g nsid 0 hostid 100000 range 65536
lxc 20160721110505.512 INFO lxc_confile - confile.c:config_idmap:1500 - read uid map: type u nsid 0 hostid 100000 range 65536
lxc 20160721110505.512 INFO lxc_confile - confile.c:config_idmap:1500 - read uid map: type g nsid 0 hostid 100000 range 65536
lxc 20160721110505.520 INFO lxc_confile - confile.c:config_idmap:1500 - read uid map: type u nsid 0 hostid 100000 range 65536
lxc 20160721110505.520 INFO lxc_confile - confile.c:config_idmap:1500 - read uid map: type g nsid 0 hostid 100000 range 65536
答案1
你可以检查一下 ifconfig 是否有 lxdbr0 吗?除了 LXD 提供的服务器之外,您是否在此系统上安装了 DNS 或 DHCP 服务器?我刚刚遇到了同样的问题,因为我安装了 dnsmasq sudo apt-get remove dnsmasq
,现在重新启动后一切正常。您可能需要重新配置您的 LXD 桥接器,以便您应该运行sudo dpkg-reconfigure -p medium lxd
.如果你有绑定安装后,您可能需要将其删除,然后重新配置 LXD 桥。