Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Discussions related to using VirtualBox on Windows hosts.
Post Reply
WishingIHadVMware
Posts: 19
Joined: 7. Feb 2020, 15:54

Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Post by WishingIHadVMware »

I am trying to use a vagrant virtualbox vm that was setup by a Mac user. On Mac, the adapter is named vboxnet0. I am on Windows. The name of the adapter for me is "VirtualBox Host-Only Ethernet Adapter" and I am unable to change the name. The startup of the vm through vagrant is failing as a result. I found an article going through the steps to rename this adapter, but it does not work anymore: http://www.fidian.com/problems-only-tyl ... rk-adapter

Two questions: One question:
1. Am I able to rename the adapter to vboxnet0?
2. If not, how do I configure the vm I am getting via config.vm.box_url = <cloud location> to use the different name in Windows?
Last edited by WishingIHadVMware on 4. Jun 2020, 18:31, edited 1 time in total.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Post by scottgus1 »

We don't support Vagrant here. They have their own support channels. If Vagrant wants to call the Host-Only adapter "vboxnet0", you will have to ask them how to change the Vagrant specs to call it "VirtualBox Host-Only Ethernet Adapter".

Or skip Vagrant and run the VM directly in Virtualbox, then you can set the network Name: dropdown to the correct existing Host-Only adapter.
WishingIHadVMware
Posts: 19
Joined: 7. Feb 2020, 15:54

Re: Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Post by WishingIHadVMware »

So does that mean the answer to my first question is "No, there is absolutely no way to change the name of Virtualbox ethernet adapters"? If so, why? And why is it named "vboxnet0" on Mac, but "VirtualBox Host-Only Ethernet Adapter" on Windows?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Post by scottgus1 »

I don't know if it is possible to change the name of the adapter so your Vagrant setup can use it. But Vagrant can probably tell you how to modify their files so the setup will ask for what Virtualbox on Windows provides. If you read between the lines with the previous statement, you can probably figure out where you should go next.
WishingIHadVMware wrote:why is it named "vboxnet0" on Mac, but "VirtualBox Host-Only Ethernet Adapter" on Windows?
That also I don't know. Mac comes from a BSD background, if I remember right. BSD is kinda Linux-like, and the name sounds Linux-like.
WishingIHadVMware
Posts: 19
Joined: 7. Feb 2020, 15:54

Re: Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Post by WishingIHadVMware »

I did quite a bit of research on my own (both with Virtualbox and Vagrant) before making this post. Renaming an interface would a very easy fix and I am surprised to hear it may not be supported. Think of it less as reading between the lines and more of being optimistic that the simpler path is possible.

Thanks for looking into this with me.
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Post by scottgus1 »

Feel free to post an enhancemet request on the Bugtracker, if you would like. Though it will only be implemented if Oracle's paying customers also want it. User-contributed code is also considered for implementation.

"Reading between the lines" meant, ask Vagrant how to change what it is asking for, so it asks for something compatible with Virtualbox on Windows.

Let me give you a for-instance showing why this is not a Virtualbox problem and why you are barking up the wrong tree:

A Virtualbox guest disk file can be inside the guest folder next to the guest .vbox file or it can be in another folder. If the disk file is next to the .vbox file in the guest folder, the path to the disk file is relative. If the disk file is elsewhere, the path will be absolute. Windows absolute paths use backslashes between folders, Mac and Linux use forward slashes. Windows uses drive letters for the drives, Mac uses a different scheme. Linux uses /dev. If you take a Mac guest or a Linux guest that has absolute paths to a Windows host the guest won't run because the path is no good.

What you are asking for is similar to asking Windows to use /dev and forward slashes instead of the default-for-years drive letters and backslashes, just to get this guest to run. The correct solution is to modify the guest configuration file to fit the host it is supposed to run on.

Wisdom is not slamming one's head against a wall, rather, it is to move over two feet and open the door.
WishingIHadVMware
Posts: 19
Joined: 7. Feb 2020, 15:54

Re: Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Post by WishingIHadVMware »

If the names attached to ethernet adapters are ingrained into the fabric of each OS, then it sounds like I am indeed hoping for the impossible. I will figure out how to fix my problem on the Vagrant side. Again, thanks for the help today. My week has been a very slow grind, but I am finally starting to see some progress.

Your confidence in Vagrant's simplicity makes me wonder if you have used it in a production environment before XD
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Need to rename VirtualBox Host-Only Ethernet Adapter to vboxnet0

Post by BillG »

My thinking on the matter is that VIrtualBox uses the naming scheme which the host OS expects. So it uses Host-Only Ethernet Adapter for a Windows host, but vboxnet0 for a Mac host. After all, the adapter is in the host, not the guest.

I suspect that it would be Windows or MacOS which would object to a name change rather than VirtualBox. That theory seems to fit in with the workaround you reference (which no longer works). That workaround was trying to change the name using the Windows registry, not from VirtualBox.
Bill
Post Reply