I installed lxd to use linux containers. For some reason I keep using lxc commands to install and start my containers. Since lxd seems to be close to lxc maybe there is a reason for that (but it is not clear).
I wanted to bind two lxc containers to two different bridges, different from the default lxcbr0 one. I created br1 and br2 and gave them IP addresses. They work fine and are pingable.
I am now trying to locate …
我正在尝试将 LXD ZFS 循环存储从 10GB 增加到 700GB,我该怎么做?
NAME SIZE ALLOC FREE EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
test-tao 9.94G 6.95G 2.98G - 46% 69% 1.00x ONLINE -
Run Code Online (Sandbox Code Playgroud) 我正在试验 LXD,但我遇到了一个非常简单的问题:我无法使我的网桥配置持久化。
主机服务器有一个小鸟br0。默认情况下,lxd 托管容器将使用lxcbr0并位于另一个网络上。
我想要的是一个容器,它将从我的主 DHCP 服务器获取其 IP,并与我的其他服务器共享相同的网络。
我设法使用这个节来做到这一点:
lxc config set mycontainer raw.lxc 'lxc.network.link = br0'
Run Code Online (Sandbox Code Playgroud)
这似乎有效,但时不时地,配置丢失,并且容器退回到 lxcbr0 !
一些教程(例如linuxcontainers.org 上的入门)建议在用于在 LXD 容器内运行程序--时使用双连字符 ( ) lxc exec,如
$ lxc exec my-container -- apt update
Run Code Online (Sandbox Code Playgroud)
我怀疑--告诉lxc exec将提供的标志传递给程序,因为例如lxc exec my-container apt list --upgradable失败
error: flag provided but not defined: --upgradable
Run Code Online (Sandbox Code Playgroud)
但是,我找不到有关该问题的任何文档。有人可以确认或澄清这是否不完全是它的作用吗?
此外,我看到人们--在不同地方使用的实例,例如:
$ lxc exec my-container apt -- list --upgradable
$ lxc exec my-container apt list -- --upgradable
Run Code Online (Sandbox Code Playgroud)
有什么不同?
运行 conjure-up 并选择 OpenStack with LXD 后,当我尝试部署到 localhost 时出现此错误
找不到任何网络或存储设备以继续。请确保您至少有 1 个网桥和 1 个存储池。
当我运行 lxc 网络列表时,我有以下内容
NAME TYPE MANAGED DESC USEDBY
docker0 bridge NO 0
eth0 physical NO - 0
lxdbr0 bridge YES - 1
When I run lxc storage list I have the following
NAME-default
DESC -
DRIVER - dir
SOURCE - /var/lib/lxd/storage-pools/default
USED BY -2
Run Code Online (Sandbox Code Playgroud)
同样在运行 lxc list 时,输出如下
NAME - valued-kangaroo
STATE - RUNNING
IPV4 - 10.x.x.x (eth0)
IPV6 -
TYPE - PERSISTENT
SNAPSHOTS -0
Run Code Online (Sandbox Code Playgroud)
我哪里错了? …
我有一台带有 LXD来宾(基于 ubuntu18.04 映像)的主机(KVM 和 Kubuntu 18.04 )。
我可以从客人到主机 ssh。
但是尝试从主机到访客 ssh 会导致
权限被拒绝(公钥)
错误
重现步骤:
我做错了什么?
在完整的会话记录下方
sysop@kvmneo4j:~$ lxc list
+----------+---------+-------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+----------+---------+-------------------+------+------------+-----------+
| base1804 | RUNNING | 10.0.0.205 (eth0) | | PERSISTENT | 0 |
+----------+---------+-------------------+------+------------+-----------+
sysop@kvmneo4j:~$ lxc exec base1804 bash
root@base1804:~# exec login …Run Code Online (Sandbox Code Playgroud) 我正在清理我的新 Ubuntu 20.04 安装,但似乎无法删除core18snap。
$ snap list
Name Version Rev Tracking Publisher Notes
core18 20200427 1754 latest/stable canonical? base
lxd 4.1 15359 latest/stable/… canonical? -
snapd 2.45 7777 latest/stable canonical? snapd
$ snap remove core18
error: cannot remove "core18": snap "core18" is not removable: snap is being used by snap lxd.
Run Code Online (Sandbox Code Playgroud)
什么是core18,为什么我如此需要它以至于它不会让我删除它?我发现的大多数在线参考资料都说它适用于物联网或嵌入式设备。由于我的工作站就是这样的设备,我不明白为什么需要它。我打算使用lxc容器,但为什么我需要这样做core18?
15.10 使用新的基于数据库的配置系统。完成此操作需要使用lxc config edit containernanme. 问题是我在任何地方都找不到配置文档(15.10 版)。
有很多关于基于旧文件的配置的信息。
我想从命令行编辑 LXD 配置文件。这是由lxc profile set:
lxc profile get <profile> <key>获取配置文件配置。
lxc profile set <profile> <key> <value>设置配置文件配置。
的预期格式是<key> <value>什么?来自的输出lxc show profile表明了一个点状结构:
root@ubuntu ~# lxc profile show zoneminder
name: zoneminder
config:
raw.lxc: lxc.aa_allow_incomplete=1
description: ""
devices:
eth0:
name: eth0
nictype: bridged
parent: zoneminder0
type: nic
Run Code Online (Sandbox Code Playgroud)
但我get什么也没做(更不用说 - set)。我尝试了各种咒语(例如lxc profile get zoneminder name, lxc profile get zoneminder lxc.name, ... 以获得上述值name),但它们都没有返回任何内容。
我想使用 LXD 引导根文件系统,以便从运行 ubuntu 16.04 的 AMD64 主机部署在嵌入式 ARM 系统上。以前,我使用脚本和chroot命令完成了此操作,但我使用的脚本容易出错,并且有删除 /dev 条目的坏习惯。
我已经能够使用 本地复制映像lxc image copy
images:ubuntu/16.04/arm64 --alias=ubuntu-server-arm64,并且已经安装了 qemu-user-static,但实际上无法从该映像启动容器。我收到以下错误:
$ lxc launch ubuntu-server-arm64 bootstrap
Creating bootstrap
error: Requested architecture isn't supported by this host
Run Code Online (Sandbox Code Playgroud)
有没有办法强制 lxd 忽略架构不匹配并用于
qemu-user-static运行子容器?
lxd ×10
lxc ×7
networking ×2
16.04 ×1
arm64 ×1
conjure-up ×1
kvm ×1
openstack ×1
permissions ×1
server ×1
snap ×1
ssh ×1
ubuntu-core ×1
zfs ×1