Page 1 of 1

XP guest can't reach host (bridged networking)

Posted: 20. Jul 2008, 17:08
by Muts
Hi all!

I've been using VMware player for about 2 years now, but installed Virtualbox 1.6.2 today because it has amd-v support and now I don't need to edit config files for changing iso mounts etc. I immediately noticed Virtualbox is immensely faster, thanks to amd-v. (I have an Athlon 64 2X 6000+.)

I have set up my kubuntu 7.10 with a static ip address in our home network (192.168.2.xxx), and always give the guest static addresses as wel. I then share my kubuntu root ( / ) with samba, and do the same with the C drive in the XP image.

The problem here is that (because of the bridging) going from the host to the guest is ok but trying to connect from the guest to the host fails. Please note that NAT is (I think) not a solution for me, because I need to access the guest directly (for the file sharing).
Not even ping works. I did a manual setup of my network interfaces for this virtualbox install.

This is very inconvenient, it seemed to work fine with vmware.

Code: Select all

cat /etc/network/interfaces
auto lo
iface lo inet loopback
address 127.0.0.1
netmask 255.0.0.0


iface eth0 inet static
address 192.168.2.100
netmask 255.255.255.0
gateway 192.168.2.1

auto eth0

#virtualbox bridged network interface
iface tap1 inet manual
  tunctl_user muts

iface br0 inet dhcp
  bridge_ports eth0 tap1
  pre-up ip link set eth0 promisc on

auto tap1 br0

Posted: 20. Jul 2008, 19:01
by moppel
Are shared folders a possible solution for you?

Remark: http://forums.virtualbox.org/viewtopic.php?t=8052

Posted: 20. Jul 2008, 19:37
by Muts
moppel wrote:Are shared folders a possible solution for you?
I knew there was something like that, but I wanted to use the pure samba sharing system at first, since there have been vulnerabilities in the past with such addon mechanisms.

I enabled my linux root as a shared folder, and I'm surprised it works so seamless. :)
Since I only need to be able to acces the host for filesharing, I guess it's allright. If I would need to access other services, this would not have been a good solution.

I would still consider this a bug though, I would guess that the guest needs to be able to connect to the host (in all the ways possible).

Thanks for your suggestion, now I'm all set to abandon vmware. :D

Posted: 20. Jul 2008, 22:08
by Sasquatch
Muts, your problem is that you need to set the IP address on the bridge, not the physical interface. Set eth0 to manual, the bridge with the proper address settings and it should work just fine. I have the same setup and I can access my Host from the Guest with Samba shares just fine.

ps.
Put code blocks around network configs, makes it a bit easier to see and read that it's about configurations.

Posted: 21. Jul 2008, 10:20
by Muts
Thanks a lot, Sasquatch, that fixed my problem! :)

Hopefully this might help other people as well with such a problem in the future. :P

Posted: 21. Jul 2008, 17:35
by sonntagssegler
Hi
I am a kind of a beginner in this field.

Do you mind to quote your optimized "interfaces" file as a kind of template?
So I do not all have to start from scratch.

THX. :-)

Posted: 21. Jul 2008, 17:41
by Muts
Sure! :)

Here's my config file for a bridge setup and a static ip address

Code: Select all

#standard stuff
auto lo
iface lo inet loopback
  address 127.0.0.1
  netmask 255.0.0.0


iface eth0 inet manual

auto eth0

#new things for bridging support
iface tap1 inet manual
  tunctl_user muts #put your username here instead of 'muts'

iface br0 inet static
  bridge_ports eth0 tap1
  pre-up ip link set eth0 promisc on

  address 192.168.2.100  #these three lines are pretty standard, adjust them for your system
  netmask 255.255.255.0
  gateway 192.168.2.1


auto tap1 br0
You should always make sure that your install also uses eth0 as it's primary network interface though!

The only problem I had so far are NAT problems with azureus/vuze, but I'm on the right path to fix this. :)