Opened 6 years ago
Closed 5 years ago
#17963 closed defect (fixed)
Trunk interface names truncated to 7 characters on macOS hosts
| Reported by: | DWPoon | Owned by: | |
|---|---|---|---|
| Component: | network | Version: | VirtualBox 5.2.18 |
| Keywords: | Cc: | ||
| Guest type: | all | Host type: | Mac OS X |
Description
If the name of a trunk interface on a macOS host is 8 characters or longer, then it causes an error when starting a VirtualBox guest:
Change History (7)
comment:2 by , 6 years ago
I just wanted to say "KUDOS!!!" for a perfectly documented and formatted ticket. It's a rarity these days, so much so, that it almost brought tears in my eyes! :D
I'm building VirtualBox for OSX on a 10.9.6 VM that I have just for that purpose. I'll try your suggestion, which pretty boils down to:
- char szTrunk[8]; + char szTrunk[INTNET_MAX_TRUNK_NAME];
Right? I can't run not even DOS after I'm done building VirtualBox (nested virtualization, blah, blah...) but I can definitely see if it's going to work at the configuration level.
Will keep you posted...
comment:3 by , 6 years ago
The command
sudo ifconfig vlan1387 vlan 1387 vlan en0
didn't work for me, I had to issue the command
sudo ifconfig vlan1387 vlan 1387vlandeven0
maybe it was a typo. Anyway, after that, ifconfig shows:
vlan1387: flags=8842<BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=23<RXCSUM,TXCSUM,TSO4>
ether 08:00:27:8a:5a:42
vlan: 1387 parent interface: en0
media: autoselect (1000baseT <full-duplex>)
status: active
and if I start the VM, the VBox.log shows that vlan1387 is indeed chopped off:
00:00:10.546906 [/Devices/pcnet/0/LUN#0/Config/] (level 5) 00:00:10.546909 IfPolicyPromisc <string> = "deny" (cb=5) 00:00:10.546911 IgnoreConnectFailure <integer> = 0x0000000000000000 (0) 00:00:10.546914 Network <string> = "HostInterfaceNetworking-vlan138" (cb=32) 00:00:10.546916 Trunk <string> = "vlan138" (cb=8) 00:00:10.546918 TrunkType <integer> = 0x0000000000000003 (3)
Applying the patch described in my previous post, I get:
00:00:01.501953 [/Devices/pcnet/0/LUN#0/Config/] (level 5) 00:00:01.501956 IfPolicyPromisc <string> = "deny" (cb=5) 00:00:01.501957 IgnoreConnectFailure <integer> = 0x0000000000000000 (0) 00:00:01.501959 Network <string> = "HostInterfaceNetworking-vlan1387" (cb=33) 00:00:01.501960 Trunk <string> = "vlan1387" (cb=9) 00:00:01.501962 TrunkType <integer> = 0x0000000000000003 (3)
Success! \o/
And just for completion, here's the full patch. Not sure if it's going to be applied as is. Maybe there needs to be a change in the INTNET_MAX_TRUNK_NAME to 256, and applied "globally" for Win, OSX, Linux and Solaris (which is fixed at 256).
Index: src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- src/VBox/Main/src-client/ConsoleImpl2.cpp (revision 73978)
+++ src/VBox/Main/src-client/ConsoleImpl2.cpp (working copy)
@@ -5308,7 +5308,7 @@
# if defined(RT_OS_DARWIN)
/* The name is on the form 'ifX: long name', chop it off at the colon. */
- char szTrunk[8];
+ char szTrunk[INTNET_MAX_TRUNK_NAME];
RTStrCopy(szTrunk, sizeof(szTrunk), pszBridgedIfName);
char *pszColon = (char *)memchr(szTrunk, ':', sizeof(szTrunk));
// Quick fix for @bugref{5633}
comment:4 by , 6 years ago
Thanks for the confirmation and patch. You're right, I had intended to write sudo ifconfig vlan1387 vlan 1387 vlandev en0.
comment:5 by , 6 years ago
Related discussion in the forums: https://forums.virtualbox.org/viewtopic.php?f=10&t=90129
comment:7 by , 5 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |


If the name of a trunk interface on a macOS host is 8 characters or longer, then it causes an error when starting a VirtualBox guest:
Steps to reproduce
vlan1387:If I try the same steps with a shorter interface name (e.g.
vlan0), it works.Dumps
Excerpts from
Logs/VBox.log:… 00:00:00.978878 ************************* CFGM dump ************************* … 00:00:00.979128 [/Devices/virtio-net/0/Config/] (level 4) 00:00:00.979129 CableConnected <integer> = 0x0000000000000001 (1) 00:00:00.979129 LineSpeed <integer> = 0x0000000000000000 (0) 00:00:00.979130 MAC <bytes> = "00 02 b3 a8 1d 00" (cb=6) 00:00:00.979131 00:00:00.979131 [/Devices/virtio-net/0/LUN#0/] (level 4) 00:00:00.979132 Driver <string> = "IntNet" (cb=7) 00:00:00.979133 00:00:00.979133 [/Devices/virtio-net/0/LUN#0/Config/] (level 5) 00:00:00.979134 IfPolicyPromisc <string> = "deny" (cb=5) 00:00:00.979135 IgnoreConnectFailure <integer> = 0x0000000000000000 (0) 00:00:00.979135 Network <string> = "HostInterfaceNetworking-vlan138" (cb=32) 00:00:00.979136 Trunk <string> = "vlan138" (cb=8) 00:00:00.979137 TrunkType <integer> = 0x0000000000000003 (3) 00:00:00.979137 00:00:00.979138 [/Devices/virtio-net/0/LUN#999/] (level 4) 00:00:00.979138 Driver <string> = "MainStatus" (cb=11) … 00:00:00.979194 ********************* End of CFGM dump ********************** … 00:00:01.009297 IntNet#0: szNetwork={HostInterfaceNetworking-vlan138} enmTrunkType=3 szTrunk={vlan138} fFlags=0x8000 cbRecv=325632 cbSend=196608 fIgnoreConnectFailure=false 00:00:01.009355 VMSetError: /Users/vbox/tinderbox/5.2-mac-rel/src/VBox/Devices/Network/DrvIntNet.cpp(1768) int drvR3IntNetConstruct(PPDMDRVINS, PCFGMNODE, uint32_t); rc=VERR_INTNET_FLT_IF_NOT_FOUND 00:00:01.009364 VMSetError: Failed to open/create the internal network 'HostInterfaceNetworking-vlan138' 00:00:01.009393 VMSetError: /Users/vbox/tinderbox/5.2-mac-rel/src/VBox/Devices/Network/DevVirtioNet.cpp(2198) int vnetConstruct(PPDMDEVINS, int, PCFGMNODE); rc=VERR_INTNET_FLT_IF_NOT_FOUND 00:00:01.009395 VMSetError: Failed to attach the network LUN 00:00:01.009406 PDM: Failed to construct 'virtio-net'/0! VERR_INTNET_FLT_IF_NOT_FOUND (-3600) - The networking interface to filter was not found. 00:00:01.012019 TxTimer stats (avg/min/max): 0 usec -1 usec 0 usec 00:00:01.012467 GIM: KVM: Resetting MSRs 00:00:01.013521 ERROR [COM]: aRC=NS_ERROR_FAILURE (0x80004005) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={Failed to open/create the internal network 'HostInterfaceNetworking-vlan138' (VERR_INTNET_FLT_IF_NOT_FOUND). 00:00:01.013531 Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND)}, preserve=false aResultDetail=0 00:00:01.013629 Console: Machine state changed to 'PoweredOff' 00:00:01.014587 Power up failed (vrc=VERR_INTNET_FLT_IF_NOT_FOUND, rc=NS_ERROR_FAILURE (0X80004005)) 00:00:01.025969 GUI: UIMediumEnumerator: Medium-enumeration finished! 00:00:01.520187 GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen 0 to 800x600 00:00:01.520233 ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={76eed314-3c72-4bbb-95cf-5eb4947a4041} aComponent={DisplayWrap} aText={The console is not powered up}, preserve=false aResultDetail=0 00:00:01.520267 GUI: Aborting startup due to power up progress issue detected...Excerpt from the
.vboxXML:<VirtualBox xmlns="http://www.virtualbox.org/" version="1.16-macosx"> <Machine uuid="{6fe9d89c-998f-42d3-879a-3d32ea1fbe73}" name="foo" OSType="Ubuntu_64" snapshotFolder="Snapshots" lastStateChange="2018-08-29T21:51:08Z"> … <Hardware> … <Network> <Adapter slot="0" enabled="true" MACAddress="0002B3A81D00" type="virtio"> <DisabledModes> <InternalNetwork name="intnet"/> <NATNetwork name="NatNetwork"/> </DisabledModes> <BridgedInterface name="vlan1387"/> </Adapter> </Network> … </Hardware> … </VirtualBox>Diagnosis
In
src/VBox/Main/src-client/ConsoleImpl2.cpp, at line 5309:The 8-byte buffer
char szTrunk[8]is much too short. The Solaris port uses a 256-byte buffer. Another decent choice would beINTNET_MAX_TRUNK_NAME(include/VBox/intnet.h):