我有一个 lxc 容器,其工作方式类似于 php 和 mysql 服务器。当我这样做时:
sudo lxc-shutdown -n [name of container]
我的所有系统都停止工作了。我唯一能做的就是直接按按钮关闭计算机,因为在 lxc 容器关闭过程之后,ubuntu 不再响应任何命令。这个问题变得无聊,因为每次我需要关闭我的 lxc 容器时,我的计算机也会停止工作。我该如何解决这个问题?
谢谢
我的ubuntu版本是13.04,我通过简单的方式创建了这个容器:
lxc-create -n ubuntu-server
然后我开始使用。
以下是我的容器的配置文件:
lxc.network.type = veth
lxc.network.hwaddr = 00:16:3e:e0:00:ee
lxc.network.link = lxcbr0
lxc.network.flags = up
lxc.rootfs = /var/lib/lxc/ubuntu-server/rootfs
lxc.mount = /var/lib/lxc/ubuntu-server/fstab
lxc.pivotdir = lxc_putold
lxc.devttydir = lxc
lxc.tty = 4
lxc.pts = 1024
lxc.utsname = ubuntu-server
lxc.arch = amd64
lxc.cap.drop = sys_module mac_admin mac_override
# When using LXC with apparmor, uncomment the next line to run unconfined:
#lxc.aa_profile = unconfined
lxc.cgroup.devices.deny = a
# Allow any mknod (but not using the node)
lxc.cgroup.devices.allow = c *:* m
lxc.cgroup.devices.allow = b *:* m
# /dev/null and zero
lxc.cgroup.devices.allow = c 1:3 rwm
lxc.cgroup.devices.allow = c 1:5 rwm
# consoles
lxc.cgroup.devices.allow = c 5:1 rwm
lxc.cgroup.devices.allow = c 5:0 rwm
#lxc.cgroup.devices.allow = c 4:0 rwm
#lxc.cgroup.devices.allow = c 4:1 rwm
# /dev/{,u}random
lxc.cgroup.devices.allow = c 1:9 rwm
lxc.cgroup.devices.allow = c 1:8 rwm
lxc.cgroup.devices.allow = c 136:* rwm
lxc.cgroup.devices.allow = c 5:2 rwm
# rtc
lxc.cgroup.devices.allow = c 254:0 rwm
#fuse
lxc.cgroup.devices.allow = c 10:229 rwm
#tun
lxc.cgroup.devices.allow = c 10:200 rwm
#full
lxc.cgroup.devices.allow = c 1:7 rwm
#hpet
lxc.cgroup.devices.allow = c 10:228 rwm
#kvm
lxc.cgroup.devices.allow = c 10:232 rwm
我的容器的 fstab 文件(cat /var/lib/lxc/ubuntu-server/fstab):
proc proc proc nodev,noexec,nosuid 0 0
sysfs sys sysfs defaults 0 0