Ubuntu 8.04下XEN3.4.2安装过程常见问题总结


测试环境说明:
本人在XP主机上使用VMware虚拟安装Ubuntu 8.04,以xen3.4.2作为DOM0,可能遇到的问题如下:
1 常见问题及解决方案
1.1 Python版本
修改配置后提示python出错,可能的原因:安装xen-3.4.2时,要求使用python2.6,但在编译时总出错,后来改为python2.5;系统正常运行后,需要将python改为python2.6以支持其他应用工具如高版本的virt-manager等。系统安装后应自动支持2.5和2.6版本,在使用xend时,建立一个链接默认启动2.5即可,用该命令可进行版本切换:
#rm /usr/bin/python
#ln -s /usr/bin/python2.6 /usr/bin/python
#python
回车后即可发现版本已为2.6

1.2 Xend启动出错
1.2.1 提示brctl
bash: brctl: command not found
在线安装所需要的包即可:执行 apt-get install bridge-utils 安装 bridge-utils 套件;
1.2.2 Ifdown提示
Client 启动 xend 时,无法 bridge eth0 (Xend 的服务正常,只是没有 bridge),提示如下:
$ xend restart
ifdown: interface eth0 not configured
SIOCSIFNAME: Device or resource busy
可能的原因: DRBL 的逻辑是 须先启动网络装置 (在 initrd 阶段启动) 来 mount NFS 作为 rootfs,但 Xend 启动时,会先 ifdown eth0,在做一些 brctl 的相关动作后载启动 eth0 。解决方案目前见到的有以下几种:
1):/etc/network/interface中除了默认的信息外,增加 eth0
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
       address 192.168.20.129
       netmask 255.255.255.0
       network 192.168.20.0
       gateway 192.168.20.2
之后需要重新启动网络服务才能启动xend:
root@ubuntu8:~# xend start
ifdown: interface eth0 not configured
SIOCSIFNAME: Device or resource busy
root@ubuntu8:~# service networking stop
* Deconfiguring network interfaces...       [ OK ]
root@ubuntu8:~# service networking start
* Configuring network interfaces...         [ OK ]
root@ubuntu8:~# xend start
Waiting for peth0 to negotiate link.

2):自行手动先 ifup eth0 起来,导致系统整个停住 (因网络皆停止、rootfs 无法 mount,终端机也无法控制)
3):改用别名 $ xend restart
Error: either "local" is duplicate, or "eth0" is a garbage.
4):修改 /etc/xen/script/network-bridge
不要使用默认的bridge,而改为NAT方式,即在/etc/xen/xend-conf.cfg中修改网络配置及脚本:network-bridge修改为network-nat;vif-bridge修改为vif-nat。
但会有以下提示,不影响xend使用:
+ iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
FATAL: Module ip_tables not found.
iptables v1.3.8: can't initialize iptables table `nat': iptables who? (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
5):官方建议若是使用 NFS roots 可改用 netwrok-route,只是获取 DHCP IP
根据我们的经验,目前采用的是方法1或4。
着重说明:
系统启动后,网络接口默认号会变化,如从eth0到eth1。在DomainU里也是一样,需要先按变化的如eth1在/etc/network中的interfaces中修改后,启动网络服务:
#service networking start
然后再把interfaces中的配置修改回eth0,重启机器后,网络服务即正常。
原因可能与xend启动时对网络接口的操作有关。
1.3 VNC界面
1.3.1 灰色且不可操作
问题:灰色窗口,使用VNCSERVER/VNCVIEWER连接dom0时出现灰色窗口
解决:在root下,修改./vnc/xstartup文件,最后一行twm &替换为下面两行:
       unset SESSION_MANAGER
       gnome-session &
1.3.2 灰色但可操作
使用VNCSERVER连接时,界面显示灰色或提示什么通道出错时,需要重新打开一次VNCSERVER:
#vncserver -kill :x
使用该命令将相关桌面关闭,之后再打开。
1.3.3 连接提示通道错误
使用VNCSERVER连接时,界面显示灰色或提示什么通道出错时,需要重新打开一次VNCSERVER:
#vncserver -kill :x
使用该命令将相关桌面关闭,之后再打开。
1.4 VNC多人共享
如何使得DomainU中的主机桌面同时供多人共享?现在只能使用/etc/xen下xxx.hvm中的vncdisplay=n设置一个访问终端。
解决方案:
1.              如果是windows的DOMU,则可使用远程桌面或在DOMU系统中安装VNCSERVER,并配置允许某IP段或某些IP地址可访问
2.              如果是LINUX的DOMU,则需要安装VNCSERVER,并配置其启动时开启桌面。
1.5 Virt-manager
1.5.1 安装问题
正常情况下,直接使用apt-get install virt-manager即可安装成功,如果缺相应的库,应继续添加安装-如libvirt等;
1.首先启动xend;
2.然后在virt-manager中连接connect xen;
3.如果出现错误提示,可能的原因如下:
1)xend未启动;或者xend未正确配置
在/etc/xen/xend-config.sxp文件中,将   (xen-api-server ((unix)))启用,(xend-http-server yes)/(xend-unix-server yes)---这两个server启用一个即可;
2)libvirt库未安装成功-virt-manager主要是基于libvirt对xend进行监视管理的。
4.对使用libvirt库的调试:
测试程序中,编译时应使用-lvirt选项,以链接到libvirt-dev库,如果出现undefined reference to xxx的错误提示,可能是因为库libvirt-dev未安装,应使用apt-get install libvirt-dev进行安装
1.5.2 启动问题
Virt-manager启动时出现问题:
Unable to open a connection to the Xen hypervisor/daemon.
Verify that:
- A Xen host kernel was booted
- The Xen service has been started
Details:
Unable to open connection to hypervisor URI 'xen:///':
<class 'libvirt.libvirtError'> virConnectOpenReadOnly() failed could not use Xen hypervisor entry /tmp/livirt_proxy_conn
Traceback (most recent call last):
File "/usr/share/virt-manager/virtManager/connection.py", line 332, in _open_thread
    self.vmm = libvirt.openReadOnly(self.uri)
File "/usr/lib/python2.5/site-packages/libvirt.py", line 144, in openReadOnly
    if ret is None:raise libvirtError('virConnectOpenReadOnly() failed')
libvirtError: virConnectOpenReadOnly() failed could not use Xen hypervisor entry /tmp/livirt_proxy_conn
解决方案:
Same problem here with the same kernel amd64. I tried enabling these two settings in xend-config.sxp, but without auccess :(在xend-config中进行配置:)
(xen-api-server ((unix)))
(xend-unix-server yes)
1.5.3 在线安装工具包问题
提示:
root@ubuntu8:~# apt-get install bridge-utils
E: Could not get lock /var/lib/dpkg/lock - open (11 Resource temporarily unavailable)
E: Unable to lock the administration directory (/var/lib/dpkg/), is another process using it?
解决方案:
因为存在另一个下载安装的进程,不能同时进行,需要关闭或等待另一个下载安装的进程结束,或者重启系统即可。
个人测试,仅供参考!

相关内容