在Fedora 20上将Xen作为Domain-0安装

I ever introduced Installing Xen on Fedora as Domain-0 (Fedora 17) 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上以Domain-0(Fedora 17)形式安装Xen,这是第一次尝试使用从Fedora提供的xen软件包,而不必手动编译Xen和修补内核。 在本文中,我将介绍在Fedora 20上安装Xen Dom0。

安装Xen (Installing Xen)

First, install the xen pacakges:

首先,安装xen pacakges:

# yum install xen

The Linux kernel is already ready to run in Domain-0 with the pv_ops technology enabled.

Linux内核已经准备好在启用pv_ops技术的情况下在Domain-0中运行。

Run grub2-mkconfig

运行grub2 -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 Setting Default Entry in Grub2 and Grub.

然后,我们可以通过选择Fedora来启动Fedora,使其在Xen上以Domain-0的身份在Xen上运行,并在系统启动过程中在Grub2中使用Xen虚拟机管理程序 。 我们还可以在Grub2和Grub中设置默认条目

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 info
host                   : localhost
release                : 3.15.6-200.fc20.x86_64
version                : #1 SMP Fri Jul 18 02:36:27 UTC 2014
machine                : x86_64
nr_cpus                : 4
max_cpu_id             : 3
nr_nodes               : 1
cores_per_socket       : 2
threads_per_core       : 2
cpu_mhz                : 3392
hw_caps                : bfebfbff:2c100800:00000000:00007f00:77dafbbf:00000000:00000021:000027ab
virt_caps              :
total_memory           : 8064
free_memory            : 128
sharing_freed_memory   : 0
sharing_used_memory    : 0
outstanding_claims     : 0
free_cpus              : 0
xen_major              : 4
xen_minor              : 3
xen_extra              : .2
xen_caps               : xen-3.0-x86_64 xen-3.0-x86_32p 
xen_scheduler          : credit
xen_pagesize           : 4096
platform_params        : virt_start=0xffff800000000000
xen_changeset          : 
xen_commandline        : placeholder
cc_compiler            : gcc (GCC) 4.8.2 20131212 (Red Hat 4.8.2-7)
cc_compile_by          : mockbuild
cc_compile_domain      : [unknown]
cc_compile_date        : Fri Jun 20 21:32:24 UTC 2014
xend_config_format     : 4

配置网络 (Configuring the network)

Here, we use bridged network.

在这里,我们使用桥接网络

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=xenbr0
TYPE=Bridge
ONBOOT=yes
DELAY=0
NM_CONTROLLED=no
BOOTPROTO=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

一个示例Dom-U配置文件 (One example Dom-U configuration file)

I give one example Domain-U configuration file here as follows.

我在下面给出一个示例Domain-U配置文件。


name="10.8.1.210"
vcpus=2
memory=2048
disk=['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”下运行。

翻译自: https://www.systutorials.com/installing-xen-on-fedora-20-as-domain-0/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值