Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 29

Thread: HowTo : Virtualbox host networking with WIFI

  1. #11
    Join Date
    Jan 2008
    Beans
    219

    Re: HowTo : Virtualbox host networking with WIFI

    Hi, and thanks again for the reply.
    I am not at home to try this yet, but I shall as soon as I get outta work.

    I would like not to have to rely on the good will of fellow Ubuntu users (although the community here are very nice, and have never begrudged any help giving).

    Could you give me a good suggestion as to WHERE I could find a good book, or internet site which explains the sort of things one needs to understand to be able to;

    1. understand the use of the linux tools for networking, and
    2. understand these networking issues.

    As a bit of a programmer, I know socket work, and have a general understanding of tcp/ip etc, but never got into this kind of scale networking issues. .. so bridges and interfaces, eth0, eth1 are all a bit like black magic to me. Do you have a suggestion? I would like to one day be able to do this for myself, and know why and how. And one day, It could be me helping others, like you have helped me today.

    Thanks again!

  2. #12
    Join Date
    Jan 2008
    Beans
    219

    Re: HowTo : Virtualbox host networking with WIFI

    Hi again,

    Actually... i really need a book now. The fix didn't fix it.
    I modified the interfaces file to match the suggested code, and promptly restarted the machine. On restart and login, I again had no internet, and could not even contact the router, or ping anything (on the real computer, the host). When I do an ifconfig, I can see there are 'errors' in the TX Packets... not that that means much to me yet...

    Here is the output from two commands, ifconfig, and iwconfig,
    in the hope it might tell you something.

    ifconfig
    Code:
    br0       Link encap:Ethernet  HWaddr 00:08:0d:9e:52:12  
              inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::208:dff:fe9e:5212/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:187 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:0 (0.0 B)  TX bytes:14550 (14.2 KB)
    
    eth0      Link encap:Ethernet  HWaddr 00:08:0d:9e:52:12  
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    eth1      Link encap:Ethernet  HWaddr 00:02:2d:81:93:eb  
              inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::202:2dff:fe81:93eb/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:2 errors:0 dropped:0 overruns:0 frame:0
              TX packets:43 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:352 (352.0 B)  TX bytes:8216 (8.0 KB)
              Interrupt:11 Base address:0xd100 
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:573 errors:0 dropped:0 overruns:0 frame:0
              TX packets:573 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:33872 (33.0 KB)  TX bytes:33872 (33.0 KB)
    
    vmnet1    Link encap:Ethernet  HWaddr 00:50:56:c0:00:01  
              inet addr:192.168.241.1  Bcast:192.168.241.255  Mask:255.255.255.0
              inet6 addr: fe80::250:56ff:fec0:1/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:55 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    vmnet8    Link encap:Ethernet  HWaddr 00:50:56:c0:00:08  
              inet addr:192.168.152.1  Bcast:192.168.152.255  Mask:255.255.255.0
              inet6 addr: fe80::250:56ff:fec0:8/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:54 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    iwconfig
    Code:
    eth1      IEEE 802.11b  ESSID:"HoneyPie"  Nickname:"HERMES I"
              Mode:Managed  Frequency:2.462 GHz  Access Point: 00:16:E3:6C:1C:7C   
              Bit Rate:11 Mb/s   Sensitivity:1/3  
              Retry limit:4   RTS thr:off   Fragment thr:off
              Power Management:off
              Link Quality=41/92  Signal level=-53 dBm  Noise level=-94 dBm
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:1
              Tx excessive retries:0  Invalid misc:0   Missed beacon:0
    thanks again for your help!
    Last edited by svaens; July 15th, 2008 at 11:12 PM. Reason: more info

  3. #13
    Join Date
    May 2005
    Location
    Lyon, France
    Beans
    917
    Distro
    Ubuntu Development Release

    Re: HowTo : Virtualbox host networking with WIFI

    read the HowTo again. Your wifi card and the bridge MUST NOT be on the same subnet otherwise it will not work (as it is not working right now for you).

    As apparently your wifi card is in the 192.168.1.x range then your bridge needs to be in the 192.168.0.x range.

    Change your bridge IP in /etc/network/interfaces from 192.168.1.20 to 192.168.0.20

  4. #14
    Join Date
    Jan 2008
    Beans
    219

    Re: HowTo : Virtualbox host networking with WIFI

    hi.

    done that now.

    Progress is made. My host (ubuntu) has a working network and internet.
    However, the guest not.

    Looking at a ifconfig, I can see that the script made the tap0 ok,
    but there are still these errors at the RX and TX packets (see below).

    I will start reading about all this now, and see if it all makes sense to me. However, If you can see what potential problems may be, please let me know.

    p.s. I didn't really understand what you meant by this paragraph:

    Code:
    2) DHCP server
    You have a dhcp server serving on the 192.168.1.0 range
    either locally (laptop):
    make sure the gateway given by dhcp is the ip of your bridge br0
    
    or on your ethernet LAN connection:
    nothing to do (in that case, your access to the internet will occur thru ethernet most certainly and not thru WIFI)
    I have DHCP enabled in my router. What do you mean by "make sure the gateway given by dhcp is the ip of your bridge br0"

    not only that, but the script doesn't work in the VirtualBox settings.
    It always comes back with error (see below). To test anyway, I enter the name of the created tap 'tap0' in the host interface name of the settings for my vm, and start.
    Then the vm starts, but it does not get a network.


    error
    Code:
    Failed to initialize Host Interface Networking.
    VBox status code: -3100 (VERR_HOSTIF_INIT_FAILED).
    Result Code: 
    0x80004005
    Component: 
    Console
    Interface: 
    IConsole {1dea5c4b-0753-4193-b909-22330f64ec45}
    although it still makes the tap0 interface, and when I run it from the command line, i can see that it prints to standard out the name of the tap interface it just created.

    This is my exact create script, just as yours i think.
    Code:
    #!/bin/bash
    echo "Setting up a new TAP interface for the user 'sean'"
    interface=`VBoxTunctl -b -u sean`
    if [ -z "$interface" ]; then
    exit 1
    fi
    echo $interface
    ifconfig $interface up
    # And add it to the bridge.
    brctl addif br0 $interface
    thanks again for your patience.


    ifconfig
    Code:
    br0       Link encap:Ethernet  HWaddr 00:08:0d:9e:52:12  
              inet addr:192.168.0.20  Bcast:192.168.0.255  Mask:255.255.255.0
              inet6 addr: fe80::208:dff:fe9e:5212/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:120 errors:0 dropped:0 overruns:0 frame:0
              TX packets:94 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:28556 (27.8 KB)  TX bytes:15332 (14.9 KB)
    
    eth0      Link encap:Ethernet  HWaddr 00:08:0d:9e:52:12  
              UP BROADCAST MULTICAST  MTU:1500  Metric:1
              RX packets:0 errors:0 dropped:0 overruns:0 frame:0
              TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
    
    eth1      Link encap:Ethernet  HWaddr 00:02:2d:81:93:eb  
              inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr: fe80::202:2dff:fe81:93eb/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:6451 errors:0 dropped:0 overruns:0 frame:0
              TX packets:7014 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:1000 
              RX bytes:3049792 (2.9 MB)  TX bytes:1462947 (1.3 MB)
              Interrupt:11 Base address:0xd100 
    
    lo        Link encap:Local Loopback  
              inet addr:127.0.0.1  Mask:255.0.0.0
              inet6 addr: ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU:16436  Metric:1
              RX packets:817 errors:0 dropped:0 overruns:0 frame:0
              TX packets:817 errors:0 dropped:0 overruns:0 carrier:0
              collisions:0 txqueuelen:0 
              RX bytes:42882 (41.8 KB)  TX bytes:42882 (41.8 KB)
    
    tap0      Link encap:Ethernet  HWaddr 00:ff:c5:40:47:10  
              inet6 addr: fe80::2ff:c5ff:fe40:4710/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
              RX packets:120 errors:0 dropped:0 overruns:0 frame:0
              TX packets:44 errors:0 dropped:6 overruns:0 carrier:0
              collisions:0 txqueuelen:500 
              RX bytes:30248 (29.5 KB)  TX bytes:8402 (8.2 KB)
    Last edited by svaens; July 16th, 2008 at 08:48 PM. Reason: more info

  5. #15
    Join Date
    Jan 2008
    Beans
    219

    Re: HowTo : Virtualbox host networking with WIFI

    hmmm...

    i just did some more reading, and did a brctl showstp
    I noticed it lists my eth0 as disabled (state = disabled).
    This can't be good... and while still being ignorant of how all this works,... i wouldn't be surprised if you were to say 'that is the reason! Enable it!'.

    What do you think? How do I enable this thing?

    Code:
    eth0 (1)
     port id		8001			
    state		       disabled
     designated root	8000.00080d9e5212	
    path cost		 100
     designated bridge	8000.00080d9e5212	
    message age timer	   0.00
     designated port	8001			
    forward delay timer	   0.00
    designated cost 0
    hold timer 0.00
    flags

  6. #16
    Join Date
    Jan 2008
    Beans
    219

    Re: HowTo : Virtualbox host networking with WIFI

    Hi. More progress..

    In light of what I thought I had discovered (from the last post),
    I decided I needed to try and make this eth0 interface seem NOT disabled.

    I didn't know any way to do this besides actually connecting it to the ethernet port of my router, via cable.

    so, connected it, got the green light happening at the base of the connector.. great!

    create the tap0 (i still haven't resolved the problem of it not working from VirtualBox), start virtual box with tap0 specified in the 'host interface' settings,

    and it works!!!! My guest now has network. It can even get out to the internet from it. My guest cannot ping by host name (but maybe this is an issue of the dns? ) but it can ping it via the ip address which the dhcp has given it.

    HOWEVER, THIS IS NO SOLUTION!!!
    I do not want to be connected to the router via the cable, just so I can get the host interface working for my virtual machine! I just did this to test the idea.

    Again. How can I get my eth0 working without sticking the cable in?

    p.s. while I have the cable in, I am not using it to connect to the network. The wireless is being used for that. In fact, with the current settings of course i cannot actually connect to the network with the cable (eth0).

    Thanks and kind regards,

    sean
    Last edited by svaens; July 17th, 2008 at 07:12 AM.

  7. #17
    Join Date
    May 2005
    Location
    Lyon, France
    Beans
    917
    Distro
    Ubuntu Development Release

    Re: HowTo : Virtualbox host networking with WIFI

    host interface creation problem.
    Looks like a permission problem to me even though you apparently did not paste the whole error message which is in the pop up windows.

    Check the /dev/net/tun part of the HowTo.

    eth0 being disabled with the brctl command is not surprising if the cable is not plugged in.

    For the rest read carefully, you have all the answers in the sentences, I cannot explain more than what I did.

    example:
    "make sure the gateway given by dhcp is the ip of your bridge br0"
    dhcp server... either locally or on your ethernet LAN connection

    meaning install a dhcp server on your host or assign an IP address in the guest.

  8. #18
    Join Date
    Jan 2008
    Beans
    219

    Re: HowTo : Virtualbox host networking with WIFI

    Hi,

    firstly, you do say explicitly "Your ethernet card does not have to be plugged for this to work.".

    Was I wrong to take this to mean I don't have the cable plugged into the ethernet card for this to work? For if the whole point is to get this working using wireless, it kind of defeats the purpose if i have to have the cable plugged in anyway!

    secondly,

    Of course I followed your HowTo regarding the permissions.
    At this stage /dev/net/tun owners should be root.uml-net, change accordingly if this is not the case.
    Yes, this was checked, found to be incorrect, and already since days, modified to be as you specified.

    I did think I pasted the whole message in from the pop up box. If I didn't, it was in error.

    Third,

    you said:
    meaning install a dhcp server on your host or assign an IP address in the guest.
    ok, "assign an IP address in the guest" I understand.
    What do you mean by "install a dhcp server on your host" ?

    My DHCP is provided by my wireless router. I do not want to have to install a second somewhere to get this working.

    As I have said, I have the DHCP enabled, and it works. This shown by the fact that my laptop, my partners laptop, and my guest vm (when I have the cable plugged in) all get an ip address assigned by the DHCP.

    so, the question still stands.
    How do I get it working so that my "ethernet card does not have to be plugged" ?
    Last edited by svaens; July 17th, 2008 at 09:07 AM. Reason: correction

  9. #19
    Join Date
    May 2005
    Location
    Lyon, France
    Beans
    917
    Distro
    Ubuntu Development Release

    Re: HowTo : Virtualbox host networking with WIFI

    you will not be able to use your router's dhcp if you don't plug in the cable, so assign an IP to your guest or install a dhcp3 server on your host if you don't want to assign an IP.

    The quickiest and easiest is to assign an IP.

  10. #20
    Join Date
    Jan 2008
    Beans
    219

    Re: HowTo : Virtualbox host networking with WIFI

    ahh... ok.

    so. If I understand correctly,

    Because for some reason, we cannot bridge the wireless interface, and
    the wireless was where I was connecting to dhcp,
    my guest cannot contact dhcp, and therefore cannot be given an IP Address.
    Is this correct?

    If this is so, How is it that my guest will get a network at all?

    If this networking in the end looks like this:

    Code:
        |---- eth0 (disconnected ethernet)
    br0-|
        |---- tap0 
    
    eth1 (WLAN)
    It kind of looks like that part of my hosts networking that is connected to the network (eth1) is totally isolated from the part that the guest needs to use to connect (tap0).

    Or do I not understand enough..

    Thanks anyway.

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •