Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do I get Xen domU guests to have internet access? What tools can I use to diagnose the problem? Are there log files I can examine?

(I'm new linux and networking and VMs. Please execuse me if I get the terminology wrong. Also I'm not sure which / how much information to provide.)

I have installed a Xen hypervisor on an Oracle VirtualBox. The (Debian) dom0 (hostname=debianxend0) has internet access, i.e. I can use apt-get to download packages and ping www.google.com works.

Using xen-create-image I installed a domU (hostname=tutorial-pv-guest).

The domU guests can ping and ssh dom0 but not the outside, i.e. ping www.google.com fails. dom0 can ping and ssh domU

dom0 /etc/network/interfaces

 auto lo
 iface lo inet loopback

 auto xenbr0
 iface xenbr0 inet dhcp
  bridge_ports eth0
  bridge_stp on
  bridge_waitport 0
  bridge_fd 0

dom0 ifconfig -a

eth0      Link encap:Ethernet  HWaddr 08:00:27:76:ba:6f  
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:3445 errors:0 dropped:0 overruns:0 frame:0
      TX packets:675 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:936784 (914.8 KiB)  TX bytes:63581 (62.0 KiB)

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:0 errors:0 dropped:0 overruns:0 frame:0
      TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

vif2.0    Link encap:Ethernet  HWaddr fe:ff:ff:ff:ff:ff  
      inet6 addr: fe80::fcff:ffff:feff:ffff/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:20 errors:0 dropped:0 overruns:0 frame:0
      TX packets:398 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:32 
      RX bytes:1376 (1.3 KiB)  TX bytes:55771 (54.4 KiB)

xenbr0    Link encap:Ethernet  HWaddr 08:00:27:76:ba:6f  
      inet addr:192.168.178.57  Bcast:192.168.178.255  Mask:255.255.255.0
      inet6 addr: fe80::a00:27ff:fe76:ba6f/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:1680 errors:0 dropped:0 overruns:0 frame:0
      TX packets:222 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:230914 (225.5 KiB)  TX bytes:38211 (37.3 KiB)

dom0 brctl show

bridge name         bridge id       STP enabled interfaces
xenbr0      8000.08002776ba6f   yes     eth0
                                vif2.0

domU /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

domU ifconfig -a

eth0      Link encap:Ethernet  HWaddr 00:16:3e:8b:54:20  
      inet addr:192.168.178.232  Bcast:192.168.178.255  Mask:255.255.255.0
      inet6 addr: fe80::216:3eff:fe8b:5420/64 Scope:Link
      UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
      RX packets:995 errors:0 dropped:0 overruns:0 frame:0
      TX packets:207 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:1000 
      RX bytes:104718 (102.2 KiB)  TX bytes:27230 (26.5 KiB)
      Interrupt:30 

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:6 errors:0 dropped:0 overruns:0 frame:0
      TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:554 (554.0 B)  TX bytes:554 (554.0 B)
  • dom0 has a bridge with an IP addressed assigned by DHCP (I live in a residence, they provide a WLAN which provides the IP addresses).
  • dom0 has a vif2.0 for domU
  • domU has an eth0 with an IP address

And below is the xen cfg for domU

bootloader = '/usr/lib/xen-4.1/bin/pygrub'
vcpus       = '2'
memory      = '512'
root        = '/dev/xvda2 ro'
disk        = [
              'phy:/dev/vg0/tutorial-pv-guest-disk,xvda2,w',
              'phy:/dev/vg0/tutorial-pv-guest-swap,xvda1,w',
          ]
name        = 'tutorial-pv-guest'
dhcp        = 'dhcp'
vif         = [ 'mac=00:16:3E:8B:54:20,bridge=xenbr0' ]
on_poweroff = 'destroy'
on_reboot   = 'restart'
on_crash    = 'restart'
share|improve this question
    
You say the residence provides a WLAN, but the computer is plugged on a cable, not on wifi? I think you cannot get a bridge working on wifi, but it might depend on the wireless card. If it's on a cable, it should work, which seems to be the case from the two different IPs in the host and in the guest. Is it possible the residence network will not let you have multiple computers in the same time? –  bonob Apr 12 at 15:44
    
No cable. Only wifi. Yes, it's possible the residence does not allow me to use multiple computers (they asked me from my MAC address). But then why can dom0 (which is given a fake MAC addr by virtualbox) connect to the internet but domU cannot (which also has a fake MAC addr)? –  Loic Apr 15 at 16:33
    
Well, I missed this sentence at first: "I have installed a Xen hypervisor on an Oracle VirtualBox." Complicated setup you have here! Maybe the problem is with VirtualBox driver, you present a bridge to the VirtualBox guest? VirtualBox bridge with a wifi adapter has to find out the VB guest IP, replace the VB guest MAC with the VB host MAC, and translate the answer from the router back to the guest. –  bonob Apr 16 at 8:03
    
On the other hand, Xen bridge, which is on a virtual ethernet adapter, uses different MAC for the host and the guest. That might confuse VirtualBox. If you don't need to have a 'public' IP in the Xen guest, you could set up NAT networking in the Xen host instead. By the way, can the Xen domU ping the VB host and vice versa? –  bonob Apr 16 at 8:03

1 Answer 1

The issue is with MAC address authentication. WiFi only allows packets from authenicated MAC addresses, which is why you can't bridge a wired and wireless connection so easily. If it's not because of a wireless issue, it's because of some other form of MAC barrier set up by whomever is managing the network there (which is why they asked for your MAC address).

One strategy may be to simply change the MAC address of your guests' virtual adapters to that of your physical one. Disclaimer: I haven't tried this before, tell me if it works :)

If that doesn't work, you'll need to make another local network and use NAT to pass traffic out from a single IP/MAC address (like in comment).

There are guides for "bridging" wired connections through wireless, and these solutions should work for you even if you're not actually on wireless. Most probably refer to the NAT method.

share|improve this answer
    
I have exactly the described setup and I have the same situation: dom0 connection works, domU connection is unpractically slow – and I manage my Wi-Fi network myself, I see successful DHCP lease taken by domU, but its connection speed is close to zero. –  EarlGray Oct 4 at 22:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.