在Fedora Linux(Fedora 12)上设置Xen DomU

Creating file-backed virtual block device (VBD) for Xen virtual machines and installing Fedora 12 in Xen DomU via internet will be introduced. Note that this tutorial is based on a pretty old OS (Fedora 12). But the method here is still valid while some minor details may need to be changed for latest Xen and Linux such as such as ‘xl’ replacing ‘xm’, LVM backing the disk for higher performance. But the general process is the same.

将介绍为Xen虚拟机创建文件支持的虚拟块设备(VBD)并通过Internet在Xen DomU中安装Fedora 12。 请注意,本教程基于一个相当旧的操作系统(Fedora 12)。 但是这里的方法仍然有效,尽管对于最新的Xen和Linux可能需要更改一些次要细节,例如用“ xl”代替“ xm”, LVM支持磁盘以提高性能。 但是一般过程是相同的。

The Dom0 platform on top of which this DomU is set up is introduced also in this site. Please refer to

在此站点中还介绍了建立DomU的Dom0平台。 请参阅

Xen solution.

氙溶液

for the latest stable Xen Dom0 solution.

用于最新的稳定Xen Dom0解决方案。

创建文件支持的VBD: (Create file-backed VBD:)

The actual space of VBD will be the amount of disk the virtual machine used. And it will be convenient if the virtual machine will be duplicated since the work is just copying the VBD file and changing some configurations. But file-backed VBDs may not be appropriate for I/O-intensive domains because of the I/O handling cost to support file-backed VBDs in dom0.
Create a 20GB sparse file-backed VBD:

VBD的实际空间将是虚拟机使用的磁盘量。 如果要复制虚拟机,将很方便,因为工作只是复制VBD文件并更改某些配置。 但是,由于支持dom0中支持文件支持的VBD的I / O处理成本,文件支持的VBD可能不适用于I / O密集型域。
创建一个20GB的稀疏文件支持的VBD:

# dd if=/dev/zero of=/lhome/xen/f12install/vmdisk0 bs=1k seek=20480k count=1

通过Internet安装Fedora 12 Linux (Install Fedora 12 Linux via Internet)

First download the pxeboot kernel of Fedora 12 for installation via Internet. Download vmlinuz and initrd.img from here:

首先下载Fedora 12的pxeboot内核以通过Internet安装。 从此处下载vmlinuz和initrd.img:

http://download.fedora.redhat.com/pub/fedora/linux/releases/12/Fedora/x86_64/os/images/pxeboot/


Update: As Fedora 12 is not updated by Fedora any more. The repository is moved to archive site:


更新:由于Fedora 12不再由Fedora更新。 该存储库已移至存档站点:

http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/12/Fedora/x86_64/os/images/pxeboot/

The kernel and memory image can be downloaded directly by:

内核和内存映像可以通过以下方式直接下载:


$ wget http://download.fedora.redhat.com/pub/fedora/linux/releases/12/Fedora/x86_64/os/images/pxeboot/vmlinuz
$ wget http://download.fedora.redhat.com/pub/fedora/linux/releases/12/Fedora/x86_64/os/images/pxeboot/initrd.img


Update: new links:


更新:新链接:

$ wget http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/12/Fedora/x86_64/os/images/pxeboot/vmlinuz
$ wget http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/12/Fedora/x86_64/os/images/pxeboot/initrd.img

We assume these two files are stored in /lhome/xen/f12install/.

我们假设这两个文件存储在/ lhome / xen / f12install /中。

Create an installation profile f12.install:

创建一个安装配置文件f12.install:

name="F12INSTALL"
vcpus=2
memory=2048
disk = ['file:/lhome/xen/f12install/vmdisk0,xvda,w' ]
vif = [ 'bridge=eth0' ]
kernel = "/lhome/xen/f12install/vmlinuz"
ramdisk = "/lhome/xen/f12install/initrd.img"
on_reboot = 'restart'
on_crash = 'restart'

The virtual machine’s name is “F12INSTALL”, memory is 2G, CPU number is 2, disk, kernel and ramdisk is prepared in the above steps.

在上述步骤中准备了虚拟机的名称为“ F12INSTALL”,内存为2G,CPU编号为2,磁盘,内核和虚拟磁盘。

Start this virtual machine and connect to this virtual machine’s console and complete the installation:

启动此虚拟机并连接到该虚拟机的控制台并完成安装:

# xm create -c f12.install

The console can be released by "Ctrl+]". And it can be reconnected by:

可以通过“ Ctrl +]”释放控制台。 可以通过以下方式重新连接:

# xm console F12INSTALL

The installation of Fedora 12 will start. The gateway and DNS server should be set according to the network configuration.

Fedora 12的安装将开始。 网关和DNS服务器应根据网络配置进行设置。

The URL of installation source I used during installation is:

我在安装过程中使用的安装源的URL是:

http://download.fedora.redhat.com/pub/fedora/linux/releases/12/Fedora/x86_64/os/


Update: new link:


更新:新链接:

http://archives.fedoraproject.org/pub/archive/fedora/linux/releases/12/Fedora/x86_64/os/

After successfully installation of this virtual machine. It can be shut down by:

成功安装此虚拟机之后。 可以通过以下方法关闭它:

# xm shutdown F12INSTALL

This virtual machine can be duplicated to get more VMs: How to duplicate Xen DomU virtual machines.

可以复制此虚拟机以获得更多VM: 如何复制Xen DomU虚拟机

启动DomU (Start DomU)

Remember to update your system after the first boot. The 2.6.32 kernel is more stable running as DomU than the default one.

切记在第一次启动后更新系统。 2.6.32内核比默认内核更稳定地作为DomU运行。

Create a profile vm-10.0.0.123.run for loading the virtual machine:

创建一个配置文件vm-10.0.0.123.run以加载虚拟机:

name="10.0.0.123"
vcpus=2
memory=2048
disk = ['file:/lhome/xen/vm-10.0.0.123/vmdisk0,xvda,w' ]
vif = [ 'bridge=eth0' ]
bootloader = "/usr/bin/pygrub"
on_reboot = 'restart'
on_crash = 'restart'

Here we use the PyGrub (“/usr/bin/pygrub”) as the bootloader. PyGrub starts Linux DomUs with the kernels that lie in the filesystem of the DomU instead of the kernels that lie in the filesystem of the Dom0. That makes the kernel update and management easier.

在这里,我们使用PyGrub(“ / usr / bin / pygrub”)作为引导程序。 PyGrub使用位于DomU文件系统中的内核而不是位于Dom0文件系统中的内核来启动Linux DomU。 这使内核的更新和管理更加容易。

Then the DomU can be started using this profile:

然后,可以使用以下配置文件启动DomU:

# xm create vm-10.0.0.123.run

The console of this DomU can be connected to:

该DomU的控制台可以连接到:

# xm console vm-10.0.0.123

翻译自: https://www.systutorials.com/setting-up-stable-xen-domu-with-fedora-unmodified-fedora-12-on-top-of-xenified-fedora-12-dom0-with-xen-4-0-0/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值