So what purpose that that chunk of code serve? Is it trying to find the network adapter that was created by virtual box? If so... which one? I don't see how knowing how many network adapters is on a system matters for this process.
Because, I don't get the process. But whatever the process is, linking it to a bit of text that is VERY COMMONLY changed by the user is simply bad form.