因此我在 VirtualBox 中设置了一个干净的虚拟机。我按照以下说明设置了桥接设备一些 教程。 我创建了一个虚拟机,并获得了一个 DHCP 地址。但之后,我无法从容器 ping 通本地网络上的任何 IP,更不用说外部了。但我可以从主机 ping 通虚拟机。
所以问题仍然存在,我做错了什么?我正在运行主机和 VM Ubuntu 16.04 LTS,带有 LXD 2.0.8:
root@ubuntu:/home/test# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s3
iface enp0s3 inet manual
auto br0
iface br0 inet dhcp
bridge_ports enp0s3
root@ubuntu:/home/test# lxc profile list
default
docker
root@ubuntu:/home/test# lxc profile show default
config:
environment.http_proxy: ""
user.network_mode: ""
description: Default LXD profile
devices:
eth0:
name: eth0
nictype: bridged
parent: br0
type: nic
name: default
used_by: []
root@ubuntu:/home/test#
root@ubuntu:/home/test# lxc list
+------+---------+-----------------------+------+------------+-----------+
| NAME | STATE | IPV4 | IPV6 | TYPE | SNAPSHOTS |
+------+---------+-----------------------+------+------------+-----------+
| u1 | RUNNING | 192.168.192.12 (eth0) | | PERSISTENT | 0 |
+------+---------+-----------------------+------+------------+-----------+
任何帮助我都感激不尽,因为我快疯了。谢谢!