本文共 4158 字,大约阅读时间需要 13 分钟。
I ever introduced as the first try to use the xen package delivered from Fedora and get away from manually compiling Xen and patching the kernel. In this post, I introduce installing Xen Dom0 on Fedora 20.
我曾经介绍过形式这是第一次尝试使用从Fedora提供的xen软件包,而不必手动编译Xen和修补内核。 在本文中,我将介绍在Fedora 20上安装Xen Dom0。
First, install the xen pacakges:
首先,安装xen pacakges:
# yum install xen
The kernel is already ready to run in Domain-0 with enabled.
内核已经准备启用在Domain-0中运行。
Run -mkconfig
运行 -mkconfig
Run this command to make config for grub2 again:
运行以下命令再次为grub2进行配置:
# grub2-mkconfig -o /boot/grub2/grub.cfg
Otherwise, the kernel may fail to boot.
否则,内核可能无法启动。
Then, we can boot the Fedora to run on Xen as Domain-0 by selecting the Fedora, with Xen hypervisor in Grub2 during booting the system. We can also .
然后,我们可以通过选择Fedora来启动Fedora,使其在Xen上以Domain-0的身份在Xen上运行,并在系统启动过程中在Grub2中使用Xen虚拟机管理程序 。 我们还可以 。
After booting Linux on Xen as Domain-0, we can list the information by ‘xl info’ as follow to verify that Xen works.
在Xen上将Linux作为Domain-0引导后,我们可以按“ xl info”列出信息,如下所示,以验证Xen是否有效。
# xl infohost : localhostrelease : 3.15.6-200.fc20.x86_64version : #1 SMP Fri Jul 18 02:36:27 UTC 2014machine : x86_64nr_cpus : 4max_cpu_id : 3nr_nodes : 1cores_per_socket : 2threads_per_core : 2cpu_mhz : 3392hw_caps : bfebfbff:2c100800:00000000:00007f00:77dafbbf:00000000:00000021:000027abvirt_caps :total_memory : 8064free_memory : 128sharing_freed_memory : 0sharing_used_memory : 0outstanding_claims : 0free_cpus : 0xen_major : 4xen_minor : 3xen_extra : .2xen_caps : xen-3.0-x86_64 xen-3.0-x86_32p xen_scheduler : creditxen_pagesize : 4096platform_params : virt_start=0xffff800000000000xen_changeset : xen_commandline : placeholdercc_compiler : gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7)cc_compile_by : mockbuildcc_compile_domain : [unknown]cc_compile_date : Fri Jun 20 21:32:24 UTC 2014xend_config_format : 4
Here, we use bridged .
在这里,我们使用桥接 。
NetworkManager does not work with bridge currently. To use bridge-based network for Xen. We should change the network management service from NetworkManager to network. The networking configuration is stored in ‘/etc/sysconfig/network-scripts/’.
NetworkManager当前不适用于网桥。 为Xen使用基于桥接的网络。 我们应该将网络管理服务从NetworkManager更改为网络。 网络配置存储在“ / etc / sysconfig / network-scripts /”中。
First, disable NetworkManager and start network:
首先,禁用NetworkManager并启动网络:
# systemctl disable NetworkManager.service && systemctl restart network.service
Make sure that the network service is automatically started by:
确保通过以下方式自动启动网络服务:
# chkconfig network on
Then, we can create the configuration file for the bridge. Let’s call the bridge ‘xenbr0’.
然后,我们可以为网桥创建配置文件。 我们将桥称为“ xenbr0”。
Edit ‘/etc/sysconfig/network-scripts/ifcfg-xenbr0’ (we assume dhcp here. You can also give the bridge a static IP as for the other network devices.):
编辑“ / etc / sysconfig / network-scripts / ifcfg-xenbr0”(此处假设为dhcp。您也可以像其他网络设备一样为网桥提供静态IP。):
DEVICE=xenbr0TYPE=BridgeONBOOT=yesDELAY=0NM_CONTROLLED=noBOOTPROTO=dhcp
Then find the configuration file for your existing network adapter (e.g. ifcfg-p2p1) and add this line.
然后找到现有网络适配器的配置文件(例如ifcfg-p2p1)并添加此行。
BRIDGE=xenbr0
Also make sure that
同时确保
NM_CONTROLLED=no
Finally, make the network configuration take effect by:
最后,通过以下方法使网络配置生效:
# systemctl restart network.service
I give one example Domain-U configuration file here as follows.
我在下面给出一个示例Domain-U配置文件。
name="10.8.1.210"vcpus=2memory=2048disk=['phy:/dev/vg_xen/vm-10.8.1.210,xvda,w']vif=['bridge=xenbr0']bootloader="/usr/bin/pygrub"on_reboot="restart"on_crash="restart"# extra="single"
Most of the old ‘xm’ commands for Domain-U management work under ‘xl’ by just simply replacing ‘xm’ with ‘xl’.
只需将“ xm”替换为“ xl”,大多数用于Domain-U管理的“ xm”命令就可以在“ xl”下运行。
翻译自:
转载地址:http://whowd.baihongyu.com/