VirtualBox主机网络无法保存

-
-
2024-08-01

VBox ≥ 6.1.28 主机网络无法保存  E_ACCESSDENIED (0x80070005)

错误:仅主机网络 - 无法保存主机网络接口参数 - E_ACCESSDENIED - virtualbox.org --- Error: Host Only Network- Failed to save host network interface parameter - E_ACCESSDENIED

如果我尝试更改仅主机网络的 IP 地址(如10.0.0.1)或子网掩码,我会收到以下错误代码:
保存主机网络接口参数失败。

Callee RC:   
E_ACCESSDENIED (0x80070005)

原因

查找新版本的VirtualBox手册:

On Linux, Mac OS X and Solaris Oracle VM VirtualBox will only allow IP addresses in 192.68.56.0/21 range to be assigned to host-only adapters. For IPv6 only link-local addresses are allowed. If other ranges are desired, they can be enabled by creating /etc/vbox/networks.conf and specifying allowed ranges there. For example, to allow 10.0.0.0/8 and 192.168.0.0/16 IPv4 ranges as well as 2001::/64 range put the following lines into /etc/vbox/networks.conf:
在 Linux、Mac OS X 和 Solaris Oracle VM VirtualBox 上,仅允许将 192.68.56.0/21 范围内的 IP 地址分配给仅主机适配器。对于 IPv6,仅允许链路本地地址。如果需要其他范围,可以通过创建 /etc/vbox/networks.conf 并在其中指定允许的范围来启用它们。例如,要允许 10.0.0.0/8 和 192.168.0.0/16 IPv4 范围以及 2001::/64 范围,请将以下行放入 /etc/vbox/networks.conf 中:

* 10.0.0.0/8 192.168.0.0/16
* 2001::/64

Lines starting with the hash # are ignored. Next example allows any addresses, effectively disabling range control:
以 # 开头的行将被忽略。下一个示例允许任何地址,从而有效地禁用范围控制:

* 0.0.0.0/0 ::/0

If the file exists, but no ranges are specified in it, no addresses will be assigned to host-only adapters. The following example effectively disables all ranges:
如果该文件存在,但其中未指定范围,则不会将地址分配给仅主机适配器。以下示例有效地禁用所有范围:

# No addresses are allowed for host-only adapters
# 仅主机适配器不允许使用任何地址

这一更改的根本原因是

The old method had a permissions security hole on non-Windows hosts. The networks.conf file requires admin privileges to change, which plugs the security hole.
旧方法在非 Windows 主机上存在权限安全漏洞。 Networks.conf 文件需要管理员权限才能更改,这会堵塞安全漏洞。

“您的支持是我持续分享的动力”

微信收款码
微信
支付宝收款码
支付宝

目录