How to network Bridge on Windows

Discussions related to using VirtualBox on Windows hosts.

How to network Bridge on Windows

Postby bodhi.zazen » 1. Jun 2007, 10:19

The advantage of Bridging your network card is that your guest OS will obtain an IP from your router and act just like a "real" computer on your LAN. This means it will be easier to use network services such as printing, samba, ssh, ftp, ssh, cups, nfs, and http.

I wrote it here : http://doc.gwos.org/index.php/VirtualBox#Bridge_Network

Comments welcome :twisted:
If is a virtual machine, is it still broken ?
bodhi.zazen
Volunteer
 
Posts: 180
Joined: 17. May 2007, 16:02

Postby eXisor » 1. Jun 2007, 14:37

Hi bodhi, good to see another ubuntu'n on here. :)

About the howto:

1) This is sorely needed, so good one.

2) A few suggestions and additions from my own tormented experiences using XP as a host:

a) If you use vbox 1.3.8, you do not need the OpenVPN tap driver. If you open VirtualBox and click on settings->network, then type an interface name, eg: tap1, and then click 'Add a host interface' button, a compatible network adapter will be created for you. This seems easier than using the OpenVPN adapter.
(I did have to reboot after creating a tap adapter for the first time since it gave me two adapters, the tap I wanted as well as a new and broken, unneeded lan connection. After a reboot only the tap remained).

b) You forgot to show how to bridge the connection in XP, i.e, select your LAN connection, hold ctrl and then select the tap1 connection, then right click on tap1 connection and select 'bridge connection'.

c) For the XP bridge, one needs to check that your adapters have been forced into promiscuous mode, and you can do this by doing the following:

- Open a command prompt (Start, Run, cmd)
- type 'netsh bridge show adapter'. This will spew out a # of lines, one for the bridge and one for each tap you create and add to the bridge. Note the # of the adapter/s that are disabled.
- type 'netsh bridge set adapter # forcecompatmode=enable', where # is the disabled entry noted above, and do this for each disabled adapter.
- this change updates the registry and needs only be done once.
- type 'netsh bridge show adapter' again to be sure they're all enabled. If the bridge won't enable you may be OOL since not all NICs allow promiscuous mode.
- The above process may be needed for w2k as well. I dunno.

d) If you use a router as a DHCP server then an additional complexity may arise due to your NIC (Network Interface Card) exposing only a single MAC address to the router, despite it serving two or more connections.
On my router, a WRT54GL using DD-WRT software, I couldn't get the router to consistently assign a unique IP to the guest, so I sometimes got an IP conflict as soon as the guest started.
The way permanently around this conflict problem was to assign a static IP (outside the router dhcp serving range) to the bridge. Note, I did this via the TCP-IP properties tag for the bridge on the XP host. Not via the router's static ip serving service.
Oddly enough, additional guest do not have this problem, ie. they get their unique ip and even serve up their hostname.

Anyhow, I hope the above helps to fill out the XP host part of the howto.
eXisor
 
Posts: 7
Joined: 30. May 2007, 13:00

Postby bodhi.zazen » 1. Jun 2007, 15:39

eXisor wrote:Hi bodhi, good to see another ubuntu'n on here. :)


Absolutely :twisted:

About the howto:

1) This is sorely needed, so good one.


You see, the problem is, I really do not know much about Windows, yet some need help here, thus my how-to.

Thank you for looking at it and giving feedback.

2) A few suggestions and additions from my own tormented experiences using XP as a host:

a) If you use vbox 1.3.8, you do not need the OpenVPN tap driver. If you open VirtualBox and click on settings->network, then type an interface name, eg: tap1, and then click 'Add a host interface' button, a compatible network adapter will be created for you. This seems easier than using the OpenVPN adapter.
(I did have to reboot after creating a tap adapter for the first time since it gave me two adapters, the tap I wanted as well as a new and broken, unneeded lan connection. After a reboot only the tap remained).


Now you tell me :)

If you create a tap device with VirtualBox, does it then still need to be bridged ? ~ I would assume so ...

b) You forgot to show how to bridge the connection in XP, i.e, select your LAN connection, hold ctrl and then select the tap1 connection, then right click on tap1 connection and select 'bridge connection'.

c) For the XP bridge, one needs to check that your adapters have been forced into promiscuous mode, and you can do this by doing the following:

- Open a command prompt (Start, Run, cmd)
- type 'netsh bridge show adapter'. This will spew out a # of lines, one for the bridge and one for each tap you create and add to the bridge. Note the # of the adapter/s that are disabled.
- type 'netsh bridge set adapter # forcecompatmode=enable', where # is the disabled entry noted above, and do this for each disabled adapter.
- this change updates the registry and needs only be done once.
- type 'netsh bridge show adapter' again to be sure they're all enabled. If the bridge won't enable you may be OOL since not all NICs allow promiscuous mode.
- The above process may be needed for w2k as well. I dunno.

d) If you use a router as a DHCP server then an additional complexity may arise due to your NIC (Network Interface Card) exposing only a single MAC address to the router, despite it serving two or more connections.
On my router, a WRT54GL using DD-WRT software, I couldn't get the router to consistently assign a unique IP to the guest, so I sometimes got an IP conflict as soon as the guest started.
The way permanently around this conflict problem was to assign a static IP (outside the router dhcp serving range) to the bridge. Note, I did this via the TCP-IP properties tag for the bridge on the XP host. Not via the router's static ip serving service.
Oddly enough, additional guest do not have this problem, ie. they get their unique ip and even serve up their hostname.


LOL, one can not forget what one does not know :)

THANK YOU, I will add that information to the wiki (right after your mini how to using the VirtualBox interface :oops: )

Anyhow, I hope the above helps to fill out the XP host part of the howto.


LOL I think you helped more then me 8)

Do you mind if I add your information to the wiki page ?
If is a virtual machine, is it still broken ?
bodhi.zazen
Volunteer
 
Posts: 180
Joined: 17. May 2007, 16:02

Postby eXisor » 1. Jun 2007, 16:09

bodhi.zazen wrote:If you create a tap device with VirtualBox, does it then still need to be bridged ? ~ I would assume so ...


Yep, you assume correctly. Although I can't see why one can't do without the bridge and route lan->tap1 and tap1->lan. Perhaps a more savvy networking (I'm a dev) person could assist.

bodhi.zazen wrote:Do you mind if I add your information to the wiki page ?


Not at all. Providing all usual disclaimers apply, glad to help. :)

If I'da found a working wiki entry for xp host and linux client it woulda made my experience less tormented. :evil:

What I'd really like to get wiki'd is the procedure to get the xp and w2k NAT + routing. (Not that I want that solution, but it'll solve a lot of problems for people whose win OS's can't bridge).
eXisor
 
Posts: 7
Joined: 30. May 2007, 13:00

Postby bodhi.zazen » 1. Jun 2007, 17:22

eXisor :

I updated the wiki, thank you.

NAT routing is beyond my comprehension at this time

I try to read that stuff and my head starts spinning :?

I make a suggestion that they add a GUI tool to configure NAT routing on VirtualBox. IMO NAT routing will not be so easy for most folks (it is bad enough with a bridge and an IP on the Local LAN).

All the networking guru's seem to feel NAT is easy though, so go figure ...

So, please networking gurus, enlighten us :twisted:
If is a virtual machine, is it still broken ?
bodhi.zazen
Volunteer
 
Posts: 180
Joined: 17. May 2007, 16:02

Postby eXisor » 1. Jun 2007, 20:16

Good work on the wiki update.

NAt itself is easy, but the routing to make the nat'ed machine visible and reachable to the larger network is new to me.

Good luck with the rest of it.

If I have the time I'll try get the NAT + routing solution working. I have -some- experience.

edit:
For a Linux guest install on a Windows Host you may want to advise people who have partitioning problems (stalls, won't format, can't make swap partition, etc) to check if they a duo core, hyperthreading or dual processors, and if so to try setting processor affinity to just one cpu (via the processes tab of the taskbar). That worked for me (hyperthreading). After the install I set it back to both cpu's and all seems well.
eXisor
 
Posts: 7
Joined: 30. May 2007, 13:00

Postby linuxfingers » 2. Jun 2007, 03:32

i got to hand it to you guys
bodhi.zazen and eXisor you guys are nearly gods in my books 8)
i did follow the wiki down to its atom (but with mandriva) and all
went as whats on the wiki tin.

but now i got what exisor had "ip conflict on the host and guest"
i done a ipconfig and ifconfig and they both are 192.168.2.5.

i did try other ip's like 192.168.10.2 , 192.168.20.2 and i think 192.168.22.12 in the bridge icon under network connections with
a net mask of 255.255.255.0 and in all 3 tries the access to the internet was dead for windows and linux.

if i go to virtualbox settings > network and choose NAT
both host and guest gets access but then im back to square 1.
if i choose host interface "VBTap1" i get ip conflict error on
every boot (well 12- 15 tries)

so i was thinking maybe i need to change the ip address in
linux to static ip address (dont laugh if that sounds stupid) im learning linux hence why im using mandriva :lol:


its 3:26am my eyes r heavy, fags is nearly done and my 6th coffee
cup is empty. i think ill go of to the land of nod before i start to make
errors. and screw things up.

thanks again for your input
ill get back to this in some hours

8)
LF
ps. that is one frigging good wiki for windows (host) users.
linuxfingers
 
Posts: 8
Joined: 30. May 2007, 20:25

Postby rats » 2. Jun 2007, 19:33

Guys, my VB does not look like the one you discribe in your HOWTO. After installing VB v1.3.8 on Windows XP ALL the options except NEW are grayed out until a VM has been created. Therefore, it is impossible to follow the HOWTO in the order you have presented it.

Secondly, after creating a VM and trying to configure the Settings there are at least two other problems. If you configure Adapter as you suggest (Attach Adapter 0 to Host Interface with the Interface Name of tap1) you lose the internet connection on both the Host and Guest machines. You also have the problem That the Host and Guest can see one another, but not the rest of the LAN and The other machines on the LAN cannot see the Host and Guest.

Thirdly, you say the adapter for the Guest might have to be configured. It cannot be configured, it is Bridged to the Host adapter.

I have tried you HOWTO several times, uninstalling and reinstalling VB between each attempt. I have also downloaded the VB files several times to be sure I was not using a corrupted version. I come up time wilt the same problems.

Sorry to be the messenger with the bad news. When I first read the HOWTO I was ready to write a very favorable review.
rats
 
Posts: 10
Joined: 2. Jun 2007, 16:28

Postby bodhi.zazen » 2. Jun 2007, 20:02

LOL

Sorry about that rats :(

Sounds like you are almost there ...

What version of Windows are you using ?

It may be as easy as ...

Under "My Network Places" right click the bridge and select "enable"

See if this helps : http://www.microsoft.com/resources/docu ... ridge.mspx

Note: If you do get it working, let me know how to update my wiki please :)
If is a virtual machine, is it still broken ?
bodhi.zazen
Volunteer
 
Posts: 180
Joined: 17. May 2007, 16:02

Postby rats » 3. Jun 2007, 04:37

Hi Bodhi.

I decided that I had made so many uninstalls, reinstalls, changes, etc. I would completely clean out anything to do with VB and start fresh. After cleaning everything out I reinstall yet another copy of VB.

During the setup process, before I started the Debian install, I had a full LAN/Internet connection on the Host. All the computers on the LAN could see and access the Host. This is good.

During the Debian install the network configuration failed. This is also good because I was able to get away from the DHCP setup and use my static IP addresses. I manually configured the Guest ethernet card during installation.

The Debian installation process is still running.

I will let you know how it comes out. I will also tell you what I did that was different from you HOWTO.

If all goes well, your HOWTO was a big help. While I could not follow it exactly, it pointed me in the right direction. Until I read it I was at a loss for what to do next.

I have to go to a 50th Wedding celebration this afternoon, so it may be a while before you next hear from me.

Thanks,
rats
 
Posts: 10
Joined: 2. Jun 2007, 16:28

Postby linuxfingers » 4. Jun 2007, 12:53

bodhi.zazen
all though your how to is a wicked guide
i have come to the conclusion that it maybe
my belkin router or something other thats frigging
up my progress

im still getting the ip confilct issue regardless what i do
man this is killing me to the bone. i have done so many
configuration combinations, formating, fiddling and bloody
tweedling and i still get the same ip conflict.

i got three bloody icons in the win xp network connections
(bridge) and i just cant no matter what the hell i do to get
the guest and the host to
see each other, see the internet or have the guest accept
request from out side it self

im officaly tired of all this malarky and fart assing around.
what i have notice is that if users run linux as a (host) and
windows as a (guest) it appears to fully network easier
than the other way around.

i could be worng but by looking on most of the posts that i have
come across in many forums people who gets their networking
issue resolved are windows (guest) to Linux (host)

unfortuntely all our machines uses dependent windows software
so its required the windows is the host on our machines

thanks for your help again
it was reall help, it did get me near the solution,
99.9% and as life would have it its the .1% that
phucked it all up

Thanks
LF
linuxfingers
 
Posts: 8
Joined: 30. May 2007, 20:25

Postby bodhi.zazen » 4. Jun 2007, 15:13

LOL

I am sorry you are having so many problems.

I wish I was more fluent with Wondoz.

~ Bodhi hands linuxfingers CENTOS and VMWare ACE
If is a virtual machine, is it still broken ?
bodhi.zazen
Volunteer
 
Posts: 180
Joined: 17. May 2007, 16:02

Postby eXisor » 5. Jun 2007, 13:21

linuxfingers wrote:but now i got what exisor had "ip conflict on the host and guest. i done a ipconfig and ifconfig and they both are 192.168.2.5."


I got around this by forcing the bridge to have a static ip outside the range assigned by the router's dhcp server.

So, assuming your router ip is 192.168.2.1, and it serves dhcp IP's from 192.168.2.2 thru 50, try assigning a static IP, say 192.168.2.200, to the bridge (via tcpip properties) in windows. If that works you can try letting the router assign the static IP. YMMV.

bodhi:

It may be a worthwhile creating 'setting host bridge to static' and 'setting client/s to static' sections.

And maybe you should point out...

1) If you have a router the default network install will usually give you a working NAT network. Any 'host interface' stuff should probably be done after the system is going, to minimise stress. :)

2) And in the client to static IP section;

a) be sure to pick an IP outside the router's dhcp serving range
b) the client's gateway should probably be set to the bridge's IP

Sorry for all the fence-sitting above, but ... Would a networking guru please contain your laughter long enough to set me straight?

:)

Edit: to fix an error rats pointed out.
Last edited by eXisor on 5. Jun 2007, 14:16, edited 2 times in total.
eXisor
 
Posts: 7
Joined: 30. May 2007, 13:00

Postby rats » 5. Jun 2007, 14:04

eXisor, you cannot set the tap IP and the Guest NIC to the same IP, if you do you will get a conflict. cannot have two devices using the same IP.

I am not sure you can even set the tap IP because it is part of the Bridge and the properties are different than a normal NIC. There is no where to set the TCP/IP properties.

rats[/quote]
rats
 
Posts: 10
Joined: 2. Jun 2007, 16:28

Postby eXisor » 5. Jun 2007, 14:12

rats:

You're correct. (I wrote the above from another machine, so my bad). You set tap by setting eth0 from the guest.

I'll fix the post so i don't confuse folks too much.
eXisor
 
Posts: 7
Joined: 30. May 2007, 13:00

Next

Return to VirtualBox on Windows Hosts

Who is online

Users browsing this forum: boucherle and 51 guests