我一直在尝试通过命令行设置 VirtualBox 应该支持的 8 个网络适配器。我需要它们作为桥接网络(因为我使用它们来转发安装在 VM 中的服务器的端口)。
因此,我使用的命令如下:
VBoxManage modifyvm <myvmname> --nic5 bridged
VBoxManage modifyvm <myvmname> --bridgeadapter5 "Realtek PCIe GBE Family Controller"
VBoxManage modifyvm <myvmname> --nicpromisc5 allow-all
其他 3 个也是如此。我将它们设置为桥接,将适配器名称设置为我的主机网络适配器名称,并将混杂模式设置为允许所有。它们使用适配器 PCnet-FAST III (Am79C973)。使用 showvminfo 命令检查,我得到以下信息:
C:\Program Files>cd Oracle
C:\Program Files\Oracle>cd VirtualBox
C:\Program Files\Oracle\VirtualBox>VBoxManage showvminfo XP2
Name: XP2
Groups: /
Guest OS: Windows XP (32 bit)
UUID: b53a67f9-7fba-43a0-9f2c-a13e9f1249ab
Config file: C:\Users\MyUserName\VirtualBox VMs\XP2\XP2.vbox
Snapshot folder: C:\Users\MyUserName\VirtualBox VMs\XP2\Snapshots
Log folder: C:\Users\MyUserName\VirtualBox VMs\XP2\Logs
Hardware UUID: b53a67f9-7fba-43a0-9f2c-a13e9f1249ab
Memory size: 256MB
Page Fusion: off
VRAM size: 18MB
CPU exec cap: 40%
HPET: off
Chipset: piix3
Firmware: BIOS
Number of CPUs: 1
PAE: off
Long Mode: off
Synthetic CPU: off
CPUID overrides: None
Boot menu mode: message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: off
Time offset: 0ms
RTC: local time
Hardw. virt.ext: on
Nested Paging: on
Large Pages: on
VT-x VPID: on
VT-x unr. exec.: on
State: running (since 2014-04-30T11:22:59.596000000)
Monitor count: 1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration:
Autostart Enabled: off
Autostart Delay: 0
Default Frontend:
Storage Controller Name (0): IDE
Storage Controller Type (0): PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 2
Storage Controller Port Count (0): 2
Storage Controller Bootable (0): on
IDE (0, 0): E:\Programas\VirtualBox\Guindous XP.vdi (UUID: 70549b55-f222-4b47-be
78-52ba486e880d)
IDE (1, 0): Empty
NIC 1: MAC: 08002780847C, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: on, Trace: off (file: none), Type: Am79
C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandw
idth group: none
NIC 2: MAC: 080027B2180A, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: on, Trace: off (file: none), Type: Am79
C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandw
idth group: none
NIC 3: MAC: 080027803511, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: on, Trace: off (file: none), Type: Am79
C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandw
idth group: none
NIC 4: MAC: 080027DE9E9D, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: on, Trace: off (file: none), Type: Am79
C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandw
idth group: none
NIC 5: MAC: 080027918504, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: on, Trace: off (file: none), Type: Am79
C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandw
idth group: none
NIC 6: MAC: 08002719AAFC, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: off, Trace: off (file: none), Type: Am7
9C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Band
width group: none
NIC 7: MAC: 08002739E2E1, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: off, Trace: off (file: none), Type: Am7
9C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Band
width group: none
NIC 8: MAC: 0800277BD34B, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: off, Trace: off (file: none), Type: Am7
9C973, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Band
width group: none
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1: disabled
UART 2: disabled
LPT 1: disabled
LPT 2: disabled
Audio: enabled (Driver: DSOUND, Controller: AC97)
Clipboard Mode: Bidirectional
Drag'n'drop Mode: Bidirectional
Session type: GUI/Qt
Video mode: 1920x1002x16 at 0,0
VRDE: disabled
USB: enabled
EHCI: disabled
USB Device Filters:
<none>
Available remote USB devices:
<none>
Currently Attached USB Devices:
<none>
Bandwidth groups: <none>
Shared folders: <none>
VRDE Connection: not active
Clients so far: 0
Video capturing: not active
Capture screens: 0
Capture file: C:\Users\MyUserName\VirtualBox VMs\XP2\XP2.webm
Capture dimensions: 1024x768
Capture rate: 512 kbps
Capture FPS: 25
Guest:
Configured memory balloon size: 0 MB
OS type: WindowsXP
Additions run level: 3
Additions version: 4.1.10 r76836
Guest Facilities:
Facility "VirtualBox Base Driver": active/running (last update: 2014/04/30 11:23
:09 UTC)
Facility "VirtualBox System Service": active/running (last update: 2014/04/30 11
:23:15 UTC)
Facility "VirtualBox Desktop Integration": active/running (last update: 2014/04/
30 11:23:25 UTC)
Facility "Seamless Mode": active/running (last update: 2014/04/30 11:23:09 UTC)
Facility "Graphics Mode": active/running (last update: 2014/04/30 11:23:09 UTC)
因此,除了 MAC 地址之外,所有适配器都具有完全相同的配置,这是正常的。
但打开虚拟机(使用 Windows XP)时,似乎无法同时管理超过四个网络适配器。最后连接的四个适配器都会显示错误图标并且不起作用。
所以现在我不知道我还能做什么。我没有找到任何信息说我应该在 VirtualBox 中修改任何设置,我不确定这是 VBox 错误还是 Windows XP 错误。
我找不到任何关于 XP 支持的最大网卡数量的官方参考资料。不过,我发现了线,其中用户声称:
我见过安装 VMWare Workstation 后有多达 8 个设备在运行(它们是虚拟 NIC)。我认为这主要取决于您选择的硬件。
所以从技术上来说我尝试的应该是可行的。
我尝试了一些虚拟硬件类型,但它们就是不工作。
有人试过吗?有什么建议吗?
提前谢谢了。
更新:它似乎在 Windows 7 客户机中正常工作,可能是因为它使用了不同的虚拟化网卡(Intel PRO/1000 MT Desktop)。
答案1
尝试提供 uuid(尝试命令 -VBoxManage list vms
并从列表中找到机器名称的 uuid)而不是机器名称。上述命令对我有用。我使用的是 NAT 模式。我已经使用了 4 个适配器。现在使用以下命令创建第五个适配器:(关闭虚拟机后输入这些命令)
VBoxManage modifyvm "enter-your-machine's-uuid-here" --nic5 nat
,然后输入:
VBoxManage modifyvm "enter-your-machine's-uuid-here"--nicpromisc5 allow-all
之后,启动虚拟机。然后在 cmd 中尝试 ipconfig 并检查 IP。如果所有设置都正常工作并且新适配器已成功添加,则在登录后,您将看到一个提示,指示“设备驱动程序软件安装成功”。通过查看 IP,我们可以确定新设置是否已生效。您可以根据命令中的要求提供所需的模式。我提供了 NAT,正如开头提到的。
答案2
看来我遇到了同样的问题,只是客户操作系统是 Windows 2000(主机是 CentOS 7)。我尝试了所有不同的可用适配器类型,但都没有成功(某些适配器不受旧 Windows 版本支持)。
您可能会在 Windows 事件查看器中注意到启动时出现此错误:
“AMD PCNET 系列 PCI 以太网适配器 #[n]:遇到资源冲突,无法加载。”
查看注册表,所有 5 个(或定义的数量)适配器均已列出,并且所有 PCI 位置均未出现冲突。
我只能假设 VBox 对 Windows 客户机 XP 及更早版本仅支持最多 4 个网络适配器。