跳到主要内容

LXD

  • 是什么
    • 对 LXC 的封装 - 管理容器运行
    • 运行 daemon 暴露 rest 接口
    • 支持 kvm
    • 能管理 LXC 和 QEMU
  • lxc/lxd
  • lxd package content
  • images.linuxcontainers.org - Image server for LXC and LXD
  • vs LXC
    • 因为有了 daemon 因此更方便管理使用
    • 使用 Go 实现
    • lxc 命令包含了很多功能而不是之前 lxc-* 之类的命令
    • lxd 安装后 150MB,lxc 安装后 15 MB
备注
  • lxd 的核心命令是 lxc
    • 集成了之前 lxc-* 的功能
    • 类似于 2.0
# 等同于 root 权限
usermod -a -G lxd $USER

# tuna 镜像
lxc remote add tuna-images https://mirrors.tuna.tsinghua.edu.cn/lxc-images/ --protocol=simplestreams --public
lxc image list tuna-images:

KVM in LXC/LXD

# /dev/kvm
lxc.cgroup.devices.allow = c 10:232 rwm
lxc config device add CONTAINER kvm unix-char path=/dev/kvm