2016-02-12 99 views
0

我編譯並構建了一個MirageOS unikernel for XEN,遵循本指南https://github.com/mirage/mirage-www/blob/master/tmpl/wiki/hello-world.md(主要是最後一部分,第4步,stackv4),但是啓動之後,我不是能夠通過DHCP發現階段,如圖以下日誌:MirageOS和Xen - 虛擬接口無法獲取IP地址

Parsing config from stackv4.xl 
Xen Minimal OS! 
Initialising console ... done. 
getenv(OCAMLRUNPARAM) -> null 
getenv(CAMLRUNPARAM) -> null 
getenv(PATH) -> null 
Unsupported function lseek called in Mini-OS kernel 
Unsupported function lseek called in Mini-OS kernel 
Unsupported function lseek called in Mini-OS kernel 
getenv(OCAMLRUNPARAM) -> null 
getenv(CAMLRUNPARAM) -> null 
getenv(TMPDIR) -> null 
getenv(TEMP) -> null 
Netif: add resume hook 
Netif.connect 0 
Netfront.create: id=0 domid=0 
sg:true gso_tcpv4:true rx_copy:true rx_flip:false smart_poll:false 
MAC: 00:16:3e:7e:c0:0d 
Attempt to open(/dev/urandom)! 
Unsupported function getpid called in Mini-OS kernel 
Unsupported function getppid called in Mini-OS kernel 
Manager: connect 
Manager: configuring 
DHCP: start discovery 

Sending DHCP broadcast (length 552) 
DHCP: start discovery 

Sending DHCP broadcast (length 552) 
DHCP: start discovery 

Sending DHCP broadcast (length 552) 
DHCP: start discovery 

.... 

我MirageOS unikernel配置:

name = 'stackv4' 
kernel = '/home/mirage/mirage-skeleton/stackv4/mir-stackv4.xen' 
builder = 'linux' 
memory = 256 
on_crash = 'preserve' 

disk = [ ] 

# if your system uses openvswitch then either edit /etc/xen/xl.conf and set 
#  vif.default.script="vif-openvswitch" 
# or add "script=vif-openvswitch," before the "bridge=" below: 
vif = [ 'bridge=xenbr0' ] 

我的網絡配置:

eth0  Link encap:Ethernet HWaddr 02:01:06:02:83:c0 
      inet6 addr: fe80::1:6ff:fe02:83c0/64 Scope:Link 
      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 
      RX packets:110876 errors:0 dropped:0 overruns:0 frame:0 
      TX packets:14602 errors:0 dropped:0 overruns:0 carrier:0 
      collisions:0 txqueuelen:1000 
      RX bytes:9736700 (9.7 MB) TX bytes:1999992 (1.9 MB) 
      Interrupt:117 

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:65536 Metric:1 
      RX packets:384394 errors:0 dropped:0 overruns:0 frame:0 
      TX packets:384394 errors:0 dropped:0 overruns:0 carrier:0 
      collisions:0 txqueuelen:0 
      RX bytes:26761500 (26.7 MB) TX bytes:26761500 (26.7 MB) 

vif16.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:58 errors:0 dropped:0 overruns:0 frame:0 
      TX packets:11289 errors:0 dropped:0 overruns:0 carrier:0 
      collisions:0 txqueuelen:32 
      RX bytes:33640 (33.6 KB) TX bytes:778590 (778.5 KB) 

xenbr0 Link encap:Ethernet HWaddr 02:01:06:02:83:c0 
      inet addr:131.159.24.167 Bcast:131.159.25.255 Mask:255.255.254.0 
      inet6 addr: fe80::1:6ff:fe02:83c0/64 Scope:Link 
      UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 
      RX packets:110689 errors:0 dropped:0 overruns:0 frame:0 
      TX packets:11987 errors:0 dropped:0 overruns:0 carrier:0 
      collisions:0 txqueuelen:0 
      RX bytes:8328727 (8.3 MB) TX bytes:1703101 (1.7 MB) 

我的橋配置:

bridge name  bridge id    STP enabled  interfaces 
xenbr0   8000.0201060283c0  no    eth0 
                 vif16.0 

我的/ etc /網絡/接口:

auto lo 
iface lo inet loopback 

auto eth0 
#iface eth0 inet dhcp 
# up ip link set eth0 up 

iface eth0 inet manual 

auto xenbr0 
    iface xenbr0 inet dhcp 
      bridge_ports eth0 

我想明白了什麼是問題,但一切似乎都是正確的(根據其他指南http://wiki.xen.org/wiki/Network_Configuration_Examples_(Xen_4.1%2B)#Example_Debian-style_bridge_configuration_.28e.g._Debian.2C_Ubuntu.29)。

+0

這不是編程相關的,應該發佈在ServerFault上 – jpou

+0

嗯,我不確定發佈在ServerFault上。主要是因爲它可能是一個內核編程錯誤或配置錯誤。它可能不僅僅與網絡方面有關。 –

+0

是的,它可能,但它絕對不是編程相關的問題;) – jpou

回答

2

幾點建議:

  1. 檢查你的確在DHCP服務器。
  2. 運行tcpdumpwireshark橋機(可能是dom0),看看有什麼流量。你看到DHCP請求嗎?
  3. 嘗試配置一個靜態IP地址,看看是否有效。
  4. 嘗試運行Linux guest並查看DHCP是否在那裏工作(並比較數據包捕獲)。
+0

非常感謝,DHCP服務器出現配置錯誤。 –