canonical/lxd

GitHub: canonical/lxd

LXD 是一个基于 REST API 的系统容器与虚拟机管理器,支持从单机到集群的统一基础设施管理。

Stars: 4787 | Forks: 1026

# LXD LXD 是一个现代、安全且强大的系统容器与虚拟机管理器。 它为在容器或虚拟机内运行和管理完整的 Linux 系统提供了统一的体验。LXD 支持大量 Linux 发行版的镜像(官方 Ubuntu 镜像和社区提供的镜像),并且基于非常强大但相当简单的 REST API 构建。LXD 的规模可以从单台机器上的单个实例扩展到完整数据中心机架中的集群,使其适用于运行开发和生产环境中的工作负载。 LXD 允许您轻松搭建一个感觉像小型私有云的系统。您可以高效地运行任何类型的工作负载,同时保持资源的优化。 如果您想将不同的环境容器化、运行虚拟机,或者希望以经济高效的方式通用运行和管理您的基础设施,您应该考虑使用 LXD。 ## 快速开始 有关安装说明和入门步骤,请参阅 LXD 文档中的[入门指南](https://documentation.ubuntu.com/lxd/latest/getting_started/)。 - 版本发布公告:[`https://discourse.ubuntu.com/tags/c/project/lxd/news/143/release`](https://discourse.ubuntu.com/tags/c/project/lxd/news/143/release) - 版本发布压缩包:[`https://github.com/canonical/lxd/releases/`](https://github.com/canonical/lxd/releases/) - 文档:[`https://documentation.ubuntu.com/lxd/latest/`](https://documentation.ubuntu.com/lxd/latest/) ## 状态 类型 | 服务 | 状态 --- | --- | --- 测试 | GitHub | [![Build Status](https://static.pigsec.cn/wp-content/uploads/repos/2026/06/f9d60dd23c074039.svg)](https://github.com/canonical/lxd/actions?query=event%3Apush+branch%3Amain) Go 文档 | Godoc | [![GoDoc](https://godoc.org/github.com/canonical/lxd/client?status.svg)](https://godoc.org/github.com/canonical/lxd/client) 静态分析 | GoReport | [![Go Report Card](https://goreportcard.com/badge/github.com/canonical/lxd)](https://goreportcard.com/report/github.com/canonical/lxd) ## 通过软件包安装 LXD LXD 守护进程仅在 Linux 上运行,但客户端工具(`lxc`)可在大多数平台上使用。 操作系统 | 格式 | 命令 --- | --- | --- Linux | [Snap](https://snapcraft.io/lxd) | `snap install lxd` Windows | [Chocolatey](https://chocolatey.org/packages/lxc) | `choco install lxc` macOS | [Homebrew](https://formulae.brew.sh/formula/lxc) | `brew install lxc` LXD snap 打包仓库可在[此处](https://github.com/canonical/lxd-pkg-snap)获取。 有关在各种 Linux 发行版和操作系统上安装 LXD 的更多说明,以及如何从源码安装 LXD,请参阅文档中的[如何安装 LXD](https://documentation.ubuntu.com/lxd/latest/installing/)。 ## 客户端 SDK 软件包 LXD 项目提供了 SDK 客户端包,用于从您自己的软件与 LXD 服务器进行交互。 这些 SDK 采用 Apache-2.0 许可证。 语言 | URL --- | --- Go | https://pkg.go.dev/github.com/canonical/lxd/client Python | https://github.com/canonical/pylxd 有关使用 LXD API 的更多信息,请参阅文档中的 [REST API](https://documentation.ubuntu.com/lxd/latest/restapi_landing/)。 ## 管理工具 如果您正在寻找(`lxc` CLI 之外的)工具来大规模管理 LXD(从单台服务器到广泛的集群),以下项目可能会有所帮助: 工具 | 链接 --- | --- Ansible - 连接插件 | https://galaxy.ansible.com/ui/repo/published/community/general/content/connection/lxd/ Ansible - 资产插件 | https://galaxy.ansible.com/ui/repo/published/community/general/content/inventory/lxd/ Bolt - LXD transport | https://www.puppet.com/docs/bolt/latest/bolt_transports_reference.html#lxd MicroCloud | https://canonical.com/microcloud Packer - LXD builder | https://developer.hashicorp.com/packer/integrations/hashicorp/lxd/latest/components/builder/lxd Terraform provider | https://registry.terraform.io/providers/terraform-lxd/lxd ## 安全性 请考虑以下几个方面,以确保您的 LXD 安装是安全的: - 保持您的操作系统处于最新状态,并安装所有可用的安全补丁。 - 仅使用受支持的 LXD 版本(LTS 版本或最新功能版本)。 - 限制对 LXD 守护进程和远程 API 的访问。 - 配置安全的网络接口。 - 除非必要,否则不要使用特权容器。如果您使用特权容器,请采取适当的安全措施。 有关更多信息,请参阅[容器安全](https://documentation.ubuntu.com/lxd/latest/explanation/security/#container-security)。 有关详细信息,请参阅[安全性](https://documentation.ubuntu.com/lxd/latest/explanation/security/)。 **重要提示:** 通过 Unix socket 对 LXD 的本地访问始终授予对 LXD 的完全访问权限。 这包括将文件系统路径或设备附加到任何实例,以及调整任何实例上的安全功能的能力。 因此,您应该只将此类访问权限授予您信任可以拥有系统 root 访问权限的用户。 ## 商业支持 LXD 的 LTS 版本可获得五年的标准支持,这意味着它们会持续收到更新。LXD 的商业支持作为 [Ubuntu Pro](https://ubuntu.com/pro)(包含 Infra-only 和完整的 Ubuntu Pro)的一部分提供,包括对[运行 Ubuntu 的已附加 LXD 实例](https://documentation.ubuntu.com/lxd/latest/howto/instances_ubuntu_pro_attach/)的支持。有关详细信息,请参阅[完整的服务说明](https://ubuntu.com/legal/ubuntu-pro-description)。 LXD 部署还提供托管解决方案和紧急故障处理支持。请参阅:[托管服务](https://ubuntu.com/managed)。 ## 贡献 我们非常欢迎修复和新功能。请务必先阅读我们的[贡献指南](CONTRIBUTING.md)!
标签:EVTX分析, Go, REST API, Ruby工具, 云计算, 容器管理, 日志审计, 生成式AI安全, 系统容器, 网络测绘, 虚拟机, 规则引擎