This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
一、 LXC安装和使用
apt -y install lxc
lxc-checkconfig
#启动容器,在母机上执行
lxc-start 容器名
#附加容器,在母机上执行,执行完后会进入容器命令行
lxc-attach 容器名
#在容器内执行,执行完成后会退出容器并回到母机,容器会继续运行
exit
#在容器内执行, 执行完成后会退出容器并回到母机, 容器会重启, 若要再次进入容器需要重新执行lxc-attach命令
reboot
#停止容器,在母机上执行
lxc-stop 容器名
#列出所有容器,在母机上执行
lxc-ls
#列出所有的资源开销
lxc-top
二、安装LXC_Web_Panel来管理LXC容器(仅Ubuntu)
wget https://lxc-webpanel.github.io/tools/install.sh -O - | bash
#或者
wget https://hfs.ai-life.net:8443/chfs/shared/Scipts/install.sh -O - | bash
git clone https://gitee.com/mirrors/lxc-webpanel.git
pip install flask==0.9
python lwp.py
访问项目
在浏览器输入:https://ip:5000
访问项目, 默认用户名和密码都是admin