VirtualBox network connectivity

Bruce Marshall bmarsh at bmarsh.com
Thu Nov 29 16:31:18 UTC 2007


On Thursday 29 November 2007, Alain Muls wrote:
> Hi
>
> I installed VirtualBox and winxp as a guest. I need this for a program
> that only runs on Windoze.
> I cannot get the internet connectivity in the guest OS though I tried
> using with all available options for netwworking in the virtual machine.
> I also tried out the approach from
> http://www.virtualbox.org/wiki/Automatic_Bridge_Ubuntu
>
>
> but get the error at the launch of the cirtual machine
>
> VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED)
>
> If I disable the network interface, than windozexp starts up.

I just went through this and got it working for the most part.

Here's a script I call   'bridge'  and you can fire it up before or during 
running of VBox.    

By the way, I got this from a site at:

http://samiux.wordpress.com/2007/07/11/bridge-network-interface-on-virtualbox/

I had to modify it slightly as you will see from my comments at that site.

===================  bridge
#!/bin/sh -x
#Step 0 :
#If you have not install VirtualBox on your Ubuntu 7.04, follow this guide -
#How to install VirtualBox on Ubuntu 7.04

#Step 1 :
#Install the required packages -

#    sudo apt-get install uml-utilities bridge-utils
    
# Step 2 :
#Create TAP interface -
    
tunctl -t tap1 -u bmarsh
        
        
#Step 3 :
#Create a br0 bridge -

brctl addbr br0
    
#Step 4 :
#Make your real network interface be promiscuous -
    
ifconfig eth0 0.0.0.0 promisc
        
#Step 5 :
#Link your real network interface to bridge br0 -
        
brctl addif br0 eth0
            
#Step 6 :
#Assign an IP to the br0. If you are using DHCP -
            
#dhclient br0
                
#Or, if you assign an IP yourself -
                
ifconfig br0 192.168.0.3
                    
#* the IP may be different from yours.
                    
#Step 7 :
#Link TAP to bridge br0 -
                    
brctl addif br0 tap1
                        
#Step 8 :
#Activate TAP interface -
                        
ifconfig tap1 up
                            
#Step 9 :
#Change the permission of /dev/net/tun -
                            
chmod 0666 /dev/net/tun
                                
#Step 10 :
#At the VirtualBox startup panel, choose Host Interface and add tap1 to 
#Interface Name.
                                
#Step 11 :
#At the guest (after boot up the guest OS), change the IP of the guest OS 
#to the same subnet of your host.
                                
#IP 192.168.0.40
#netmask 255.255.255.0
#gateway 192.168.0.2
#DNS #1 208.67.222.222
#DNS #2 208.67.220.220
                                                    
#Step 12 :
#Now, you can execute the SlingBox player to watch your TV programmes on your 
#guest OS (Windows XP) under Ubuntu 7.04 by VirtualBox.


#Step 13    (by BSM)
route add default gw 192.168.0.2 br0








More information about the ubuntu-users mailing list