Index: /trunk/src/VBox/Devices/Network/DevE1000.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/DevE1000.cpp	(revision 88489)
+++ /trunk/src/VBox/Devices/Network/DevE1000.cpp	(revision 88490)
@@ -2890,4 +2890,24 @@
 
 /**
+ * A helper function to detect the link state to the other side of "the wire".
+ *
+ * When deciding to bring up the link we need to take into account both if the
+ * cable is connected and if our device is actually connected to the outside
+ * world. If no driver is attached we won't be able to allocate TX buffers,
+ * which will prevent us from TX descriptor processing, which will result in
+ * "TX unit hang" in the guest.
+ *
+ * @returns true if the device is connected to something.
+ *
+ * @param   pDevIns     The device instance.
+ */
+DECLINLINE(bool) e1kIsConnected(PPDMDEVINS pDevIns)
+{
+    PE1KSTATE     pThis   = PDMDEVINS_2_DATA(pDevIns, PE1KSTATE);
+    PE1KSTATECC   pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PE1KSTATECC);
+    return pThis->fCableConnected && pThisCC->CTX_SUFF(pDrv);
+}
+
+/**
  * A callback used by PHY to indicate that the link needs to be updated due to
  * reset of PHY.
@@ -2901,5 +2921,5 @@
 
     /* Make sure we have cable connected and MAC can talk to PHY */
-    if (pThis->fCableConnected && (CTRL & CTRL_SLU))
+    if (e1kIsConnected(pDevIns) && (CTRL & CTRL_SLU))
         e1kArmTimer(pDevIns, pThis, pThis->hLUTimer, E1K_INIT_LINKUP_DELAY_US);
 }
@@ -2948,5 +2968,5 @@
         if (   (value & CTRL_SLU)
             && !(CTRL & CTRL_SLU)
-            && pThis->fCableConnected
+            && e1kIsConnected(pDevIns)
             && !PDMDevHlpTimerIsActive(pDevIns, pThis->hLUTimer))
         {
@@ -3654,5 +3674,5 @@
      * on reset even if the cable is unplugged (see @bugref{8942}).
      */
-    if (pThis->fCableConnected)
+    if (e1kIsConnected(pDevIns))
     {
         /* 82543GC does not have an internal PHY */
Index: /trunk/src/VBox/Devices/Network/DevPCNet.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/DevPCNet.cpp	(revision 88489)
+++ /trunk/src/VBox/Devices/Network/DevPCNet.cpp	(revision 88490)
@@ -3292,5 +3292,5 @@
                 | 0x0004    /* Link up. */
                 | 0x0001;   /* Extended Capability, i.e. registers 4+ valid. */
-            if (!pThis->fLinkUp || pThis->fLinkTempDown || isolate) {
+            if (!pcnetIsLinkUp(pThis) || isolate) {
                 val &= ~(0x0020 | 0x0004);
                 pThis->cLinkDownReported++;
@@ -3338,5 +3338,5 @@
         case 5:
             /* Link partner ability register. */
-            if (pThis->fLinkUp && !pThis->fLinkTempDown && !isolate)
+            if (pcnetIsLinkUp(pThis) && !isolate)
                 val =   0x8000  /* Next page bit. */
                       | 0x4000  /* Link partner acked us. */
@@ -3353,5 +3353,5 @@
         case 6:
             /* Auto negotiation expansion register. */
-            if (pThis->fLinkUp && !pThis->fLinkTempDown && !isolate)
+            if (pcnetIsLinkUp(pThis) && !isolate)
                 val =   0x0008  /* Link partner supports npage. */
                       | 0x0004  /* Enable npage words. */
@@ -3366,5 +3366,5 @@
         case 18:
             /* Diagnostic Register (FreeBSD pcn/ac101 driver reads this). */
-            if (pThis->fLinkUp && !pThis->fLinkTempDown && !isolate)
+            if (pcnetIsLinkUp(pThis) && !isolate)
             {
                 val =   0x0100  /* Receive PLL locked. */
Index: /trunk/src/VBox/Devices/Network/DevVirtioNet.cpp
===================================================================
--- /trunk/src/VBox/Devices/Network/DevVirtioNet.cpp	(revision 88489)
+++ /trunk/src/VBox/Devices/Network/DevVirtioNet.cpp	(revision 88490)
@@ -359,4 +359,23 @@
 
 #ifdef IN_RING3
+/**
+ * A helper function to detect the link state to the other side of "the wire".
+ *
+ * When deciding to bring up the link we need to take into account both if the
+ * cable is connected and if our device is actually connected to the outside
+ * world. If no driver is attached we won't start the TX thread nor we will
+ * initialize the TX semaphore, which is a problem for the TX queue handler.
+ *
+ * @returns true if the device is connected to something.
+ *
+ * @param   pDevIns     The device instance.
+ */
+DECLINLINE(bool) vnetR3IsConnected(PPDMDEVINS pDevIns)
+{
+    PVNETSTATE   pThis   = PDMDEVINS_2_DATA(pDevIns, PVNETSTATE);
+    PVNETSTATECC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PVNETSTATECC);
+    return pThis->fCableConnected && pThisCC->pDrv;
+}
+
 /**
  * Dump a packet to debug log.
@@ -524,8 +543,11 @@
 static DECLCALLBACK(int) vnetIoCb_Reset(PPDMDEVINS pDevIns)
 {
+#ifndef IN_RING3
+    RT_NOREF(pDevIns);
+    return VINF_IOM_R3_IOPORT_WRITE;
+#else
     PVNETSTATE   pThis   = PDMDEVINS_2_DATA(pDevIns, PVNETSTATE);
-#ifdef IN_RING3
     PVNETSTATECC pThisCC = PDMDEVINS_2_DATA_CC(pDevIns, PVNETSTATECC);
-#endif
+
     Log(("%s Reset triggered\n", INSTANCE(pThis)));
 
@@ -540,9 +562,9 @@
 
     /// @todo Implement reset
-    if (pThis->fCableConnected)
+    if (vnetR3IsConnected(pDevIns))
         pThis->config.uStatus = VNET_S_LINK_UP;
     else
         pThis->config.uStatus = 0;
-    Log(("%s vnetIoCb_Reset: Link is %s\n", INSTANCE(pThis), pThis->fCableConnected ? "up" : "down"));
+    Log(("%s vnetIoCb_Reset: Link is %s\n", INSTANCE(pThis), vnetR3IsConnected(pDevIns) ? "up" : "down"));
 
     /*
@@ -556,7 +578,4 @@
     memset(pThis->aVlanFilter, 0, sizeof(pThis->aVlanFilter));
     pThis->uIsTransmitting   = 0;
-#ifndef IN_RING3
-    return VINF_IOM_R3_IOPORT_WRITE;
-#else
     if (pThisCC->pDrv)
         pThisCC->pDrv->pfnSetPromiscuousMode(pThisCC->pDrv, true);
@@ -1131,8 +1150,12 @@
         if (fNewUp)
         {
-            Log(("%s Link is up\n", INSTANCE(pThis)));
             pThis->fCableConnected = true;
-            pThis->config.uStatus |= VNET_S_LINK_UP;
-            vnetR3RaiseInterrupt(pDevIns, pThis, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
+            /* The link state depends both on the cable connected and device attached. */
+            if (vnetR3IsConnected(pDevIns))
+            {
+                Log(("%s Link is up\n", INSTANCE(pThis)));
+                pThis->config.uStatus |= VNET_S_LINK_UP;
+                vnetR3RaiseInterrupt(pDevIns, pThis, VERR_SEM_BUSY, VPCI_ISR_CONFIG);
+            }
         }
         else
@@ -1344,5 +1367,5 @@
     }
 
-    if (!pThis->fCableConnected)
+    if (!vnetR3IsConnected(pDevIns))
     {
         Log(("%s Ignoring transmit requests while cable is disconnected.\n", INSTANCE(pThis)));
Index: /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
===================================================================
--- /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 88489)
+++ /trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp	(revision 88490)
@@ -5256,4 +5256,8 @@
         }
 
+        Bstr networkName, trunkName, trunkType;
+        NetworkAttachmentType_T eAttachmentType;
+        hrc = aNetworkAdapter->COMGETTER(AttachmentType)(&eAttachmentType);                 H();
+
 #ifdef VBOX_WITH_NETSHAPER
         ComObjPtr<IBandwidthGroup> pBwGroup;
@@ -5270,6 +5274,10 @@
         InsertConfigNodeF(pInst, &pLunL0, "LUN#%u", uLun);
 
+        /*
+         * Do not insert neither a shaper nor a sniffer if we are not attached to anything.
+         * This way we can easily detect if we are attached to anything at the device level.
+         */
 #ifdef VBOX_WITH_NETSHAPER
-        if (!strBwGroup.isEmpty())
+        if (!strBwGroup.isEmpty()  && eAttachmentType != NetworkAttachmentType_Null)
         {
             InsertConfigString(pLunL0, "Driver", "NetShaper");
@@ -5280,5 +5288,5 @@
 #endif /* VBOX_WITH_NETSHAPER */
 
-        if (fSniffer)
+        if (fSniffer && eAttachmentType != NetworkAttachmentType_Null)
         {
             InsertConfigString(pLunL0, "Driver", "NetSniffer");
@@ -5290,8 +5298,4 @@
         }
 
-
-        Bstr networkName, trunkName, trunkType;
-        NetworkAttachmentType_T eAttachmentType;
-        hrc = aNetworkAdapter->COMGETTER(AttachmentType)(&eAttachmentType);                 H();
         switch (eAttachmentType)
         {
