Is there a way to "attach" ethernet same as one does usb?

This is for discussing general topics about how to use VirtualBox.
Post Reply
HarryMan
Posts: 113
Joined: 15. Jan 2014, 13:54
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: devuan, MX-Linux, others

Is there a way to "attach" ethernet same as one does usb?

Post by HarryMan »

With USB, VirtualBox allows a VM to "attach" one or more USB ports for exclusive use by that VM (unless one attaches same USB to multiple VMs).

Is there a way to do the same for ethernet ports? I mean wired ports specifically, but it could apply to wireless also (I don't really need that at the moment as my host is hardwired).

IOW, I'd like to attach a host ethernet port to a VM for its own exclusive use. I don't want the host to be able to use it.

What I am thinking of is having a VM running something like IPCop and then routing packets over an internal or hostonly network.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Is there a way to "attach" ethernet same as one does usb

Post by mpack »

HarryMan wrote:With USB, VirtualBox allows a VM to "attach" one or more USB ports for exclusive use by that VM (unless one attaches same USB to multiple VMs).
I'm not aware of that being the case. To my knowledge VirtualBox grabs the device, not the port it's attached to - which in any case could be connected together with other ports inside the PC.
HarryMan wrote:Is there a way to do the same for ethernet ports?
That would be bridged networking (see user manual). And then if you don't want the host OS to use the selected NIC then you disable host OS networking on that device.
HarryMan
Posts: 113
Joined: 15. Jan 2014, 13:54
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: devuan, MX-Linux, others

Re: Is there a way to "attach" ethernet same as one does usb

Post by HarryMan »

Disabling host networking will not disable the guest VM's use of networking on that device?

As far as USB port vs device, I wasn't meaning to be that specific. I understand the difference. Here, I only attach one physical device to each USB port connected directly to the mainboard (knowing, of course, that there is a hub driving all the ports anyway). So when I talk about access to a "port" I really mean the device.

Thanks.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Mostly XP

Re: Is there a way to "attach" ethernet same as one does usb

Post by mpack »

HarryMan wrote:Disabling host networking will not disable the guest VM's use of networking on that device?
Not with bridged networking. With Bridged networking the VM connects to the host NIC at a very low (device) level. All software protocol elements are implemented by the guest OS.

Had it been NAT mode then yes, the guest would be communicating via the host's protocol stack.
HarryMan
Posts: 113
Joined: 15. Jan 2014, 13:54
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: devuan, MX-Linux, others

Re: Is there a way to "attach" ethernet same as one does usb

Post by HarryMan »

Then it sounds like I am good to go. I'll be trying to implement this over the next several weeks, in between other projects.

Thank you for the info. Sorry I mixed up port and device there. It makes a difference to realize this fact.
Post Reply