How do I create a bridge between two virtualbox VMs? CentOS and Ubuntu

Discussions about using Linux guests in VirtualBox.
Post Reply
llIlllIlllIllIl
Posts: 6
Joined: 20. Dec 2016, 18:38

How do I create a bridge between two virtualbox VMs? CentOS and Ubuntu

Post by llIlllIlllIllIl »

Hi everyone,
My main OS upon which virtualbox is installed is a *nix laptop. On virtualbox,I have two virtual machines, one is CentOS, the other is a Ubuntu box. I have created with brctl a bridge on CentOS called br0, I have added the interface enp0s3 to it (my ethernet interface), and CentOS is connected (in virtualbox) in bridged mode AND in internal mode (internal-network is the name of the network) with to my ethernet cable. Ubuntu is, anyway, connected ONLY in internal network (with internal-network as the name of the network). And it does not connect (i.e. no network connection at all, ping refuses to work).

I want the two virtual machines to be connected. Ubuntu should connect through the bridge on CentOS and eventually, I wish to create a proxy on CentOS to block a website on Ubuntu, hence the two vm must be connected. Here is the output of my brctl show on CentOS

Code: Select all

bridge name  bridge id  STP enabled   interfaces
virbr0       8000--etc   yes          virbr0-nic
br0          8000--etc   no           enp0s3
Any advices? Thanks.
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How do I create a bridge between two virtualbox VMs? CentOS and Ubuntu

Post by mpack »

Why do you need a bridge? Just create a local (virtual) network and make sure that both VMs are connected to it.

Moved to "Linux Guests".
llIlllIlllIllIl
Posts: 6
Joined: 20. Dec 2016, 18:38

Re: How do I create a bridge between two virtualbox VMs? CentOS and Ubuntu

Post by llIlllIlllIllIl »

That's the purpose of my assignment, I have to do this in this way. It this even possible?
mpack
Site Moderator
Posts: 39134
Joined: 4. Sep 2008, 17:09
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Mostly XP

Re: How do I create a bridge between two virtualbox VMs? CentOS and Ubuntu

Post by mpack »

You can do pretty much anything with a VM that you can do with a physical PC, so naturally it's possible, but that discussion is not within the scope of these forums. Just make sure that both VMs are on one network, which can be local, NAT network, or bridged (the latter having nothing to do with the bridge feature of your OS).
llIlllIlllIllIl
Posts: 6
Joined: 20. Dec 2016, 18:38

Re: How do I create a bridge between two virtualbox VMs? CentOS and Ubuntu

Post by llIlllIlllIllIl »

Where should I ask, on which forum? Thanks.
socratis
Site Moderator
Posts: 27329
Joined: 22. Oct 2010, 11:03
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Win(*>98), Linux*, OSX>10.5
Location: Greece

Re: How do I create a bridge between two virtualbox VMs? CentOS and Ubuntu

Post by socratis »

I will point you to the answer given to you by BillG in the last question you had:
BillG wrote:Before you can emulate a network setup with virtual machines and networks, you need to know how to do it with physical ones. Then work out how to emulate that setup.
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Post Reply