3.0.2. Bridged networking. Can't get it to work.

Discussions related to using VirtualBox on Windows hosts.
Post Reply
walt72
Posts: 2
Joined: 27. Jul 2009, 19:36
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Centos 5.3

3.0.2. Bridged networking. Can't get it to work.

Post by walt72 »

Hi,
since a few days I'm trying to get my Centos guest to work but no luck so far. My network skills are pretty low and I guess I'm doing some simple things completely wrong. Therefor I'd be very thankful for any input.

Host: Windows XP 32 bit
Guest: Centos 5.3 32 bit
Virtualbox 3.0.2
I do not have a router.

The guest is a developer box for php/apache/mysql. I want to access it from the Windows host only. No access from the outside world needed.

For testing purpose I installed the guest via NAT and it worked. But NAT comes with some limitations and I found that "bridged networking" is what I need - but can't get "bridged networking" to work.

A quote from UserManual.pdf
---------------------------
"To enable bridged networking, all you need to do is to open the Settings dialog of a virtual machine, go to the 'Network' page and select 'Bridged network' in the drop down list for the 'Attached to' field. Finally, select desired host interface from the list at the bottom of the page, which contains the physical network interfaces of your systems."

Big question: Do I have to go to Windows->ControlPanel->NetworkConnections first and manualy bridge the interfaces or is this bridging automatically done by VirtualBox?

According to the docs I simply selected my physical interface "Realtec RTL8029(AS)" and clicked [OK] and then started the guest. I did no manual bridging in Windows->ControlPanel, just to make this clear.

The Centos guest starts without any error. But now I'm lost.

Am I right that DHCP will not work for me? The VirtualBox docs says that DHCP will work for NAT only, if I'm not mistaken. I do not have a router or DHCP server either. So I guess I have to use a static IP in the guest, right?

I know where to set a static IP in Centos guest but I don't know what IPADDR, BROADCAST, NETWORK, NETMASK values to enter. When I do a 'ipconfig' in my Windows host I get:
-----------------------------------------------------
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
Autoconfiguration IP Address. . . : 169.254.106.137
Subnet Mask . . . . . . . . . . . : 255.255.0.0
Default Gateway . . . . . . . . . :

Ethernet adapter VirtualBox Host-Only Network:
Connection-specific DNS Suffix . :
IP Address. . . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
-----------------------------------------------------

Being in the host I'd like to ping the guest.
Being in the guest I'd like to ping the host.

Please, could anyone tell me what IP my Host has or how to find it? And what IP I have to use in the Guest? I tried many different IPs I could think of but no luck.

My Windows XP host has the default Windows firewall enabled. Do I need to disable this firewall in order to ping the guest?

Again, I just want a Host<->Guest connection. No connection to the internet nedded. Thanks again for any help or information you can offer.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: 3.0.2. Bridged networking. Can't get it to work.

Post by Perryg »

I just want a Host<->Guest connection.
Then my friend select host-only in the network settings for the guest.

If you want to use Bridged anyway (which will give you the Internet and connection to the host) You need to do as you say and then in the guest you configure the network connection there.
You need to know what the address scheme is for you router but they are almost always the same Example below for static on the guest. (replace the actual numbers with yours)

Router (IP address) 192.168.1.1 (this will be the default Gateway)
Router (subnet) 255.255.255.0
Router broadcast 195.168.1.255

Guest IP address 192.168.1.10
Guest Subnet 255.255.255.0
Guest gateway 192.168.1.1
Guest broadcast 192.168.1.255
walt72
Posts: 2
Joined: 27. Jul 2009, 19:36
Primary OS: MS Windows XP
VBox Version: OSE other
Guest OSses: Centos 5.3

Re: 3.0.2. Bridged networking. Can't get it to work.

Post by walt72 »

Perryg, thank you very much for your help. Your advice to use the "Host-only Adapter" worked very well for my. From the Host I can now ssh to the Client. I can also enter the Guest's ip into my Host's browser and see the webpage that is served by the Guest. As I said, "Host-only Adapter" works very well.*

Just out of couriosity I would like to make the "Bridged Adapter" work, too. In your reply you mentioned a Router. I do not have a Router. I have just a Windows XP pc with a broadband connection to access the internet.

Please, can anyone tell me: Do I need a Router in order to use "Bridged Adapter"???

Thanks again to anyone who can help me to make "Bridged Adapter" work.


* Here are some information how I made "Host-only Adapter" working. Maybe its helpful for other reader with a similar problem: My Guest is Centos 5.3. I had to enable DHCP in the Guest to receive an IP (which is served by VirtualBox) by DHCP. I also had to enable port 22 (ssh) and 80 (http) in the Guest's firewall. Use the program system-config-securitylevel-tui to easily edit the firewall. system-config-securitylevel (without the trailing "-tui") is for graphical environments, if I'm not mistaken(?).

Read also chapter "6.7 Host-only networking" in the VirtualBox help file UserManual.pdf. It tells you where to find in VirtualBox the DHCP settings (File -> Preferences / Settings -> Network) and that you need to click "Edit" to see the settings.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: 3.0.2. Bridged networking. Can't get it to work.

Post by Perryg »

walt72,
You do indeed need a router to be able to use Bridged mode. They are so cheap these days it is almost out of the norm for someone to not have one.
The down side of using bridged and a router is if this is being used on a laptop you can not access the guest, (as you found out) when you are away from the router and you must use the host-only adapter to get it done.
Post Reply