更改 VirtualBox DHCP 以发布 192.168.xx 地址而不是 10.0.xx 地址?

Boy*_*ema 32 networking virtualbox

我有一个 VirtualBox (v4.1.8) VM,它10.0.x.x通过 DHCP自动分配了该范围内的 IP 。

我可以更改它以使用192.168.x.x范围吗?

cut*_*tjm 27

感谢@RelaXNow,这里是问题的答案:

VBoxManage modifyvm  "NameOfVM" --natnet1 "192.168/16" 
Run Code Online (Sandbox Code Playgroud)

  • 哪个应该在主机上运行,​​而不是在 VM 上运行(从一开始对我来说并不明显) (2认同)

tom*_*l89 16

如果我已经理解了这个问题,如果你查看手册的第 6 章,它会说:

In the VirtualBox graphical user interface, you can configure all these items in the global settings via "File" -> "Settings" -> "Network", which lists all host-only networks which are presently in use. Click on the network name and then on the "Edit" button to the right, and you can modify the adapter and DHCP settings.

在此处输入图片说明