Hi!
I am currently working on trying to configure my virtual machine to, as far as it is possible, mirror my real hardware. For that I need to configure my network adapters to create adapters with "the same physical location".
The hardware and OS (centos8) creates network interfaces of enp-type. And this is also what I get when I install my operating system in a virtual machine. But! The location identifier and slot number is wrong.
Is It possible to somehow configure the network adapter(s) so that I can decide what numbers is used in the enp#s#f#-naming?
In the vbox-file i find <Network> <Adapter> which contain "slot", but I do not think that this is the correct to change due to the different naming in the operating system.
Thank you!
Predictable network naming, configure enp**-naming?
-
- Volunteer
- Posts: 5668
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Predictable network naming, configure enp**-naming?
In the VM configuration, the 4 Network Adapters automatically correspond to enp0s3, enp0s8, enp0s9 and enp0s10. If you need other PCI bus addresses, tell us what exactly you like to achieve, and we'll see if we come up with an idea.
-
- Site Moderator
- Posts: 20965
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Predictable network naming, configure enp**-naming?
Just to add a bit to fth0's comments: Virtualbox only provides the 'hardware' in the designated 'slots', same as if one bought a motherboard and added network cards to the slots. It is up to the VM's installed OS to decide or be told how to name the devices. A web-search in your chosen OS's help channels on how to name devices might help, too.
Re: Predictable network naming, configure enp**-naming?
Thanks for the replies.
I am aware of the udev-rules and how to change name of interfaces. But this is another problem. We install software om a virtual machine before testing it on the real hardware. If it is not possible to change the name on the interfaces from the VM ( the pci buss location) then we need to add special software just for the use of virtual machine which is not needed on the real hardware.
For example, If i want
enp23s1f1
Is it possible?
I am aware of the udev-rules and how to change name of interfaces. But this is another problem. We install software om a virtual machine before testing it on the real hardware. If it is not possible to change the name on the interfaces from the VM ( the pci buss location) then we need to add special software just for the use of virtual machine which is not needed on the real hardware.
For example, If i want
enp23s1f1
Is it possible?
-
- Site Moderator
- Posts: 20965
- Joined: 30. Dec 2009, 20:14
- Primary OS: MS Windows 10
- VBox Version: PUEL
- Guest OSses: Windows, Linux
Re: Predictable network naming, configure enp**-naming?
Not through Virtualbox. That naming is made by the OS inside the VM and needs to be changed inside the OS. Web-search the OS to see how to change that name.
-
- Volunteer
- Posts: 5668
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Predictable network naming, configure enp**-naming?
It may not be impossible, but it could be a lot of work to figure out, especially if your example (enp23s1f1) is realistic. Using udev rules would be much easier in that case.
In a VM, VirtualBox emulates a PCI device tree with fixed PCI addresses, and the individual devices either exist or not. You can see the results in the VBox.log file, for example:
and as long as you use the PCI device number of a non-existing device of the same type, it would probably work. But going further than that, the problems will start. For example, if you'd change the PCI bus number, you'd also have to create this PCI bus beforehand ... and at some point, you'd probably have to change the VirtualBox implementation yourself ...
In a VM, VirtualBox emulates a PCI device tree with fixed PCI addresses, and the individual devices either exist or not. You can see the results in the VBox.log file, for example:
You can change the PCI device number usingVBox.log wrote:00:00:01.575715 [/Devices/e1000/0/] (level 3) 00:00:01.575726 PCIBusNo <integer> = 0x0000000000000000 (0) 00:00:01.575727 PCIDeviceNo <integer> = 0x0000000000000003 (3) 00:00:01.575727 PCIFunctionNo <integer> = 0x0000000000000000 (0)
Code: Select all
VBoxManage setextradata "VM name" "VBoxInternal/Devices/e1000/0/PCIDeviceNo" 8
Re: Predictable network naming, configure enp**-naming?
Thank you! This is a couple of steps towards my goal!fth0 wrote:...
About the pci-bus numbering. I had to try to change this and as you said, it would crash. Trying to find anything about pci-bus in the vbox-file but cannot find anything. Is it possible to add extra pci-busses and if so, how?
Thank you!
-
- Volunteer
- Posts: 5668
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: PUEL
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Predictable network naming, configure enp**-naming?
I don't know if there is any provision for that. You'd probably have to read, understand, change and build the VirtualBox source code yourself.EasyRider wrote:About the pci-bus numbering. I had to try to change this and as you said, it would crash. Trying to find anything about pci-bus in the vbox-file but cannot find anything. Is it possible to add extra pci-busses and if so, how?