Page 1 of 1
Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 12:20
by jtt89
I would like to connect Linux guest on Windows host and there is not too much info about it in the manual. Does anybody know if Bridged Adapter option (a lot of people recommend that, about 80%) is reserved only for people who have a router (physical device at home), and if I dont have one I need to stick to Host-only option? As far as I understand both Bridged, and Host-only can be mixed with NAT in order to provide access to the internet for the guest (Linux).
Thank you in advance for any info.
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 13:36
by mpack
Lets not go overcomplicated: if your guest is using bridged, it generally does not also need to use either NAT or host only, as a bridged network can do everything that those do.
But yes, bridged works best if it provides a connection (using NIC or wireless) to a physical router which incorporates a DHCP server to assign IP addresses. Otherwise you would have to know how set such things up manually.
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 14:58
by jtt89
So that means that I can use either one of these options? (not having a router)
1) Bridged Adapter only (but it is more complicated to set it up)
2) Host-only Adapter + NAT at the same time
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 16:23
by Perryg
@jtt89,
As I have explained several times to you is several different topics, "you CAN NOT use Bridged if you do not have a router".
I don't know how much clearer to make this.
You must use host-only and a second adapter set to NAT.
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 16:44
by jtt89
Thank you. I am still trying to piece all the information and eliminate some of the options, so I can make sure I am going in the righgt direction with this. I updated VB to the newest version and reinstalled Linux all over again. I have it at Host-only and NAT and I am sure that all the settings are correct as I wasnt making any changes. I am trying to use Putty to connect to the guest from Windows, and it doesnt seem to work...
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 16:46
by mpack
Perryg wrote:you CAN NOT use Bridged if you do not have a router
Was what I said above not correct? Is it not only the DHCP stuff which will fail? Can this not be corrected using a fixed IP?
OTOH I agree that jtt89 is
effectively prohibited from using bridged without a router, because he doesn't have enough experience to work around it.
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 17:05
by Perryg
Effectively the VirtualBox Bridged adapter is going to be looking at a router to handle the hand-off of the packets regardless of DHCP. Yes there are work-arounds but natively it is going to struggle and fail.
jtt89 just has a cable modem or similar plugged directly into the host, nothing that can handle the routing. You don't have a real address to put in the guest and can't share the same IP that is associated to the host. So short of buying a cheap router or setting the host to provide the routing I don't see a way this will work other than host-only with NAT as second adapter for the Internet.
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 17:11
by mpack
Ah - ok. Bridged requires a NIC or a wireless adapter, so obviously it will not work on systems that don't have that (e.g. a USB/ADSL dialup modem). I mistakenly assumed that if the OP was considering bridged then he must have the basic architecture for it.
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 18:23
by jtt89
How would NAT "only" with port forwarding fit into the picture?
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 18:30
by mpack
NAT uses your hosts network connection at a higher level, so doesn't care about whether your lower levels include a NIC or wireless or not.
Re: Bridged Adapter vs. Host-only
Posted: 25. Nov 2011, 18:55
by jtt89
I was thinking about something like this:
Edit the xml configuration file for our virtual machine. On Windows, it’s inside the .VirtualBox/Machines subdirectory in your home folder.
At the top of the file you should see an <ExtraData> tag. Inside that tag, copy in the following tags:
Code: Select all
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/HostPort" value="2222"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/GuestPort" value="22"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/ssh/Protocol" value="TCP"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/HostPort" value="8888"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/GuestPort" value="80"/>
<ExtraDataItem name="VBoxInternal/Devices/pcnet/0/LUN#0/Config/apache/Protocol" value="TCP"/>
These lines configure VirtualBox to forward requests to specific ports on the host system onto other specified ports on the guest system. For SSH, we’re forwarding port 2222 of the host system to port 22 of the guest system (where OpenSSH is listening). The same principle applies to the Apache configuration items, with port 8888 on the host mapping to port 80 on the guest.
Again, I am asking mostly from my point of view (cable modem, no router). I know that the primary method is Host-only + NAT, but thats another option, so I am wondering what are the pros and cons.
Thank you.