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 | |
| 17 | 1. 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 | }}} |
| 22 | 2. Configure a guest to use it. Under Network → Adapter 1: |
| 23 | |
| 24 | |||| ☑ Enable Network Adapter || |
| 25 | || Attached to: || Bridged Adapter || |
| 26 | || Name: || vlan1387 || |
| 27 | 3. Start the guest. Obtain the error dialog quoted above. Notice that "vlan1387" has been truncated in "HostInterfaceNetworking-vlan138". |
| 28 | |
| 29 | If I try the same steps with a shorter interface name (e.g. `vlan0`), it works. |
| 30 | |
| 31 | = Dumps |
| 32 | |
| 33 | Excerpts from `Logs/VBox.log`: |
| 34 | |
| 35 | {{{ |
| 36 | … |
| 37 | 00:00:00.978878 ************************* CFGM dump ************************* |
| 38 | … |
| 39 | 00:00:00.979128 [/Devices/virtio-net/0/Config/] (level 4) |
| 40 | 00:00:00.979129 CableConnected <integer> = 0x0000000000000001 (1) |
| 41 | 00:00:00.979129 LineSpeed <integer> = 0x0000000000000000 (0) |
| 42 | 00:00:00.979130 MAC <bytes> = "00 02 b3 a8 1d 00" (cb=6) |
| 43 | 00:00:00.979131 |
| 44 | 00:00:00.979131 [/Devices/virtio-net/0/LUN#0/] (level 4) |
| 45 | 00:00:00.979132 Driver <string> = "IntNet" (cb=7) |
| 46 | 00:00:00.979133 |
| 47 | 00:00:00.979133 [/Devices/virtio-net/0/LUN#0/Config/] (level 5) |
| 48 | 00:00:00.979134 IfPolicyPromisc <string> = "deny" (cb=5) |
| 49 | 00:00:00.979135 IgnoreConnectFailure <integer> = 0x0000000000000000 (0) |
| 50 | 00:00:00.979135 Network <string> = "HostInterfaceNetworking-vlan138" (cb=32) |
| 51 | 00:00:00.979136 Trunk <string> = "vlan138" (cb=8) |
| 52 | 00:00:00.979137 TrunkType <integer> = 0x0000000000000003 (3) |
| 53 | 00:00:00.979137 |
| 54 | 00:00:00.979138 [/Devices/virtio-net/0/LUN#999/] (level 4) |
| 55 | 00:00:00.979138 Driver <string> = "MainStatus" (cb=11) |
| 56 | … |
| 57 | 00:00:00.979194 ********************* End of CFGM dump ********************** |
| 58 | … |
| 59 | 00:00:01.009297 IntNet#0: szNetwork={HostInterfaceNetworking-vlan138} enmTrunkType=3 szTrunk={vlan138} fFlags=0x8000 cbRecv=325632 cbSend=196608 fIgnoreConnectFailure=false |
| 60 | 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 |
| 61 | 00:00:01.009364 VMSetError: Failed to open/create the internal network 'HostInterfaceNetworking-vlan138' |
| 62 | 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 |
| 63 | 00:00:01.009395 VMSetError: Failed to attach the network LUN |
| 64 | 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. |
| 65 | 00:00:01.012019 TxTimer stats (avg/min/max): 0 usec -1 usec 0 usec |
| 66 | 00:00:01.012467 GIM: KVM: Resetting MSRs |
| 67 | 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). |
| 68 | 00:00:01.013531 Failed to attach the network LUN (VERR_INTNET_FLT_IF_NOT_FOUND)}, preserve=false aResultDetail=0 |
| 69 | 00:00:01.013629 Console: Machine state changed to 'PoweredOff' |
| 70 | 00:00:01.014587 Power up failed (vrc=VERR_INTNET_FLT_IF_NOT_FOUND, rc=NS_ERROR_FAILURE (0X80004005)) |
| 71 | 00:00:01.025969 GUI: UIMediumEnumerator: Medium-enumeration finished! |
| 72 | 00:00:01.520187 GUI: UIMachineViewNormal::resendSizeHint: Restoring guest size-hint for screen 0 to 800x600 |
| 73 | 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 |
| 74 | 00:00:01.520267 GUI: Aborting startup due to power up progress issue detected... |
| 75 | }}} |
| 76 | |
| 77 | = Diagnosis |
| 78 | |
| 79 | In `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++ |
| 82 | 5309 # if defined(RT_OS_DARWIN) |
| 83 | 5310 /* The name is on the form 'ifX: long name', chop it off at the colon. */ |
| 84 | 5311 char szTrunk[8]; |
| 85 | 5312 RTStrCopy(szTrunk, sizeof(szTrunk), pszBridgedIfName); |
| 86 | 5313 char *pszColon = (char *)memchr(szTrunk, ':', sizeof(szTrunk)); |
| 87 | … |
| 88 | 5328 if (pszColon) |
| 89 | 5329 *pszColon = '\0'; |
| 90 | 5330 const char *pszTrunk = szTrunk; |
| 91 | … |
| 92 | 5511 # endif |
| 93 | 5512 |
| 94 | 5513 InsertConfigString(pLunL0, "Driver", "IntNet"); |
| 95 | 5514 InsertConfigNode(pLunL0, "Config", &pCfg); |
| 96 | 5515 InsertConfigString(pCfg, "Trunk", pszTrunk); |
| 97 | 5516 InsertConfigInteger(pCfg, "TrunkType", kIntNetTrunkType_NetFlt); |
| 98 | 5517 InsertConfigInteger(pCfg, "IgnoreConnectFailure", (uint64_t)fIgnoreConnectFailure); |
| 99 | 5518 InsertConfigString(pCfg, "IfPolicyPromisc", pszPromiscuousGuestPolicy); |
| 100 | 5519 char szNetwork[INTNET_MAX_NETWORK_NAME]; |
| 101 | }}} |
| 102 | |
| 103 | The 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++ |
| 106 | 1052 /** The maximum length of a network name. */ |
| 107 | 1053 #define INTNET_MAX_NETWORK_NAME 128 |
| 108 | 1054 |
| 109 | 1055 /** The maximum length of a trunk name. */ |
| 110 | 1056 #define INTNET_MAX_TRUNK_NAME 64 |
| 111 | }}} |