VirtualBox

Changes between Initial Version and Version 1 of Ticket #17963, comment 1


Ignore:
Timestamp:
Aug 30, 2018 5:30:01 PM (6 years ago)
Author:
DWPoon

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #17963, comment 1

    initial v1  
    1 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:
     1If 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:
    22
    3 >
     3> Failed to open a session for the virtual machine '''foo'''.
     4>
     5> Details:
     6>
     7> Failed to open/create the internal network **'HostInterfaceNetworking-vlan138'** (VERR_INTNET_FLT_IF_NOT_FOUND).
     8>
     9> Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND).
     10>
     11> || Result Code: || NS_ERROR_FAILURE (0x80004005) ||
     12> || Component: || ConsoleWrap ||
     13> || Interface: || IConsole {872da645-4a9b-1727-bee2-5585105b9eed ||
     14
     15= Steps to reproduce
     16
     171. In the macOS Terminal, create a tagged VLAN on Ethernet named `vlan1387`:
     18{{{
     19~ root# ifconfig vlan1387 create
     20~ root# ifconfig vlan1387 vlan 1387 vlan en0
     21}}}
     222. Configure a guest to use it.  Under Network → Adapter 1:
     23
     24   |||| ☑ Enable Network Adapter ||
     25   || Attached to: || Bridged Adapter ||
     26   || Name: || vlan1387 ||
     273. Start the guest.  Obtain the error dialog quoted above.  Notice that "vlan1387" has been truncated in "HostInterfaceNetworking-vlan138".
     28
     29If I try the same steps with a shorter interface name (e.g. `vlan0`), it works.
     30
     31= Dumps
     32
     33Excerpts from `Logs/VBox.log`:
     34
     35{{{
     36
     3700:00:00.978878 ************************* CFGM dump *************************
     38
     3900:00:00.979128 [/Devices/virtio-net/0/Config/] (level 4)
     4000:00:00.979129   CableConnected <integer> = 0x0000000000000001 (1)
     4100:00:00.979129   LineSpeed      <integer> = 0x0000000000000000 (0)
     4200:00:00.979130   MAC            <bytes>   = "00 02 b3 a8 1d 00" (cb=6)
     4300:00:00.979131
     4400:00:00.979131 [/Devices/virtio-net/0/LUN#0/] (level 4)
     4500:00:00.979132   Driver <string>  = "IntNet" (cb=7)
     4600:00:00.979133
     4700:00:00.979133 [/Devices/virtio-net/0/LUN#0/Config/] (level 5)
     4800:00:00.979134   IfPolicyPromisc      <string>  = "deny" (cb=5)
     4900:00:00.979135   IgnoreConnectFailure <integer> = 0x0000000000000000 (0)
     5000:00:00.979135   Network              <string>  = "HostInterfaceNetworking-vlan138" (cb=32)
     5100:00:00.979136   Trunk                <string>  = "vlan138" (cb=8)
     5200:00:00.979137   TrunkType            <integer> = 0x0000000000000003 (3)
     5300:00:00.979137
     5400:00:00.979138 [/Devices/virtio-net/0/LUN#999/] (level 4)
     5500:00:00.979138   Driver <string>  = "MainStatus" (cb=11)
     56
     5700:00:00.979194 ********************* End of CFGM dump **********************
     58
     5900:00:01.009297 IntNet#0: szNetwork={HostInterfaceNetworking-vlan138} enmTrunkType=3 szTrunk={vlan138} fFlags=0x8000 cbRecv=325632 cbSend=196608 fIgnoreConnectFailure=false
     6000: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
     6100:00:01.009364 VMSetError: Failed to open/create the internal network 'HostInterfaceNetworking-vlan138'
     6200: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
     6300:00:01.009395 VMSetError: Failed to attach the network LUN
     6400: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.
     6500:00:01.012019 TxTimer stats (avg/min/max):       0 usec      -1 usec       0 usec
     6600:00:01.012467 GIM: KVM: Resetting MSRs
     6700: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).
     6800:00:01.013531 Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND)}, preserve=false aResultDetail=0
     6900:00:01.013629 Console: Machine state changed to 'PoweredOff'
     7000:00:01.014587 Power up failed (vrc=VERR_INTNET_FLT_IF_NOT_FOUND, rc=NS_ERROR_FAILURE (0X80004005))
     7100:00:01.025969 GUI: UIMediumEnumerator: Medium-enumeration finished!
     7200:00:01.520187 GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen 0 to 800x600
     7300: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
     7400:00:01.520267 GUI: Aborting startup due to power up progress issue detected...
     75}}}
     76
     77= Diagnosis
     78
     79In `src/VBox/Main/src-client/ConsoleImpl2.cpp`, at [https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp?rev=73768#L5309 line 5309]:
     80
     81{{{#!c++
     825309    # if defined(RT_OS_DARWIN)
     835310                    /* The name is on the form 'ifX: long name', chop it off at the colon. */
     845311                    char szTrunk[8];
     855312                    RTStrCopy(szTrunk, sizeof(szTrunk), pszBridgedIfName);
     865313                    char *pszColon = (char *)memchr(szTrunk, ':', sizeof(szTrunk));
     87
     885328                    if (pszColon)
     895329                        *pszColon = '\0';
     905330                    const char *pszTrunk = szTrunk;
     91
     925511    # endif
     935512   
     945513                    InsertConfigString(pLunL0, "Driver", "IntNet");
     955514                    InsertConfigNode(pLunL0, "Config", &pCfg);
     965515                    InsertConfigString(pCfg, "Trunk", pszTrunk);
     975516                    InsertConfigInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt);
     985517                    InsertConfigInteger(pCfg, "IgnoreConnectFailure", (uint64_t)fIgnoreConnectFailure);
     995518                    InsertConfigString(pCfg, "IfPolicyPromisc", pszPromiscuousGuestPolicy);
     1005519                    char szNetwork[INTNET_MAX_NETWORK_NAME];
     101}}}
     102
     103The 8-byte buffer `char szTrunk[8]` is much too short.  The Solaris port uses a 256-byte buffer.  Another decent choice would be `INTNET_MAX_TRUNK_NAME` ([https://www.virtualbox.org/browser/vbox/trunk/include/VBox/intnet.h?rev=73768#L1052 include/VBox/intnet.h]):
     104
     105{{{#!c++
     1061052    /** The maximum length of a network name. */
     1071053    #define INTNET_MAX_NETWORK_NAME     128
     1081054   
     1091055    /** The maximum length of a trunk name. */
     1101056    #define INTNET_MAX_TRUNK_NAME       64
     111}}}

© 2023 Oracle
ContactPrivacy policyTerms of Use