简体   繁体   中英

How to fix network issues with LXD on Fedora 31?

Has anyone had success using LXD on Fedora 31? I have been using it on another machine with Fedora 30 just fine, but after installing Fedora 31 on a new laptop, the containers don't get an IPv4 address:

$ lxc list
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
+-------+---------+------+------+------------+-----------+
| NAME  |  STATE  | IPV4 | IPV6 |    TYPE    | SNAPSHOTS |
+-------+---------+------+------+------------+-----------+
| c1    | RUNNING |      |      | PERSISTENT | 0         |
+-------+---------+------+------+------------+-----------+

Attempting something like ping inside the container gives the error:

connect: Network is unreachable

Nothing works that needs the network, but otherwise the containers seem fine and the network is fine on the host laptop.

The one notable difference I see is the warning on Fedora 31:

WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement

The version of LXD is 3.18 on both machines (installed using snap), and I've compared with both environments but couldn't see any glaring differences that would point to a problem other the cgroup warning.

This is what the network bridge looks like:

$ lxc network show lxdbr0
WARNING: cgroup v2 is not fully supported yet, proceeding with partial confinement
config:
  ipv4.address: 10.192.103.1/24
  ipv4.nat: "true"
  ipv6.address: none
description: ""
name: lxdbr0
type: bridge
used_by:
- /1.0/containers/c1
managed: true
status: Created
locations:
- none

Any ideas on where to start looking?

I found the fix to the problem. Turns out that cgroup v2 warning was more than just a warning. If cgroup v2 is disabled, it works as expected.

To disable cgroup v2, add the following to the linux boot line:

systemd.unified_cgroup_hierarchy=0

There may be other ways to fix it, but this works for now.

根据官方文档

sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM