歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Fedora 16安裝XEN虛擬機

Fedora 16安裝XEN虛擬機

日期:2017/2/28 16:01:57   编辑:Linux教程
XEN 最初是作為劍橋大學的一個項目,目前 XEN.ORG 社區在負責它的開發及維護,它已經在開源社區中得到了極大的發展。

XEN 是一種直接運行在硬件上一層軟件,它可以讓電腦硬件上同時跑多個用戶的操作系統。由於對 x86, x86-64, Itanium, Power PC,

和 ARM 這些處理器的支持,所以 XEN 管理工具可以支持的操作系統有 Linux, NetBSD,FreeBSD,Solaris, Windows 和其他一些

運行在 XEN 上的正常的操作系統。

下面我將分3步講解Fedora16下如何安裝XEN虛擬機,並創建DomU:

(一)安裝前的配置

(二)安裝XEN虛擬機

(三)創建DomU


建議:

在安裝XEN時,為保證用戶權限不受限避免出現權限錯誤,建議用root用戶登錄安裝。

如不知道如何開啟root用戶登錄,請閱讀《設置Fedora能夠使用root用戶登錄》 http://www.linuxidc.com/Linux/2011-12/48728.htm


--------------------------------------------------------------------

(一)安裝前的配置

安裝好Fedora16後,先對其進行適當配置再進行XEN的安裝,可提高XEN安裝的成功率。

1)配置網絡服務,使其自動啟動

[root@localhost ~]$ chkconfig network on

[root@localhost ~]$ /etc/init.d/network start


2)關閉SELinux,編輯/etc/selinux/config文件,將SELINUX改為disabled,如下

[root@localhost ~]$ gedit /etc/selinux/config

  1. # This file controls the state of SELinux on the system.
  2. # SELINUX= can take one of these three values:
  3. # enforcing - SELinux security policy is enforced.
  4. # permissive - SELinux prints warnings instead of enforcing.
  5. # disabled - No SELinux policy is loaded.
  6. SELINUX=disabled
  7. # SELINUXTYPE= can take one of these two values:
  8. # targeted - Targeted processes are protected,
  9. # mls - Multi Level Security protection.
  10. SELINUXTYPE=targeted


3)編輯/etc/hosts文件,為安裝Fedora16時指定的主機名添加一項,如下

[root@localhost ~]$ gedit /etc/hosts

  1. 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
  2. ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
  3. 127.0.0.1 f16 localhost.localdomain

4)更新Fedora16系統

[root@localhost ~]$ yum update


5)禁用防火牆

[root@localhost ~]$ chkconfig iptables off


6)禁用ksmtuned服務,但前和XEN不兼容

[root@localhost ~]$ chkconfig ksmtuned off


7)重啟系統,選擇最新的內核

[root@localhost ~]$ reboot




(二)安裝XEN虛擬機

重啟選擇新內核登錄後,就可以安裝XEN了,在安裝XEN之前,我們先安裝一些XEN運行時可能會用到到包。

1)安裝一些開發庫和開發工具

[root@localhost ~]$ yum groupinstall "Development Libraries"

[root@localhost ~]$ yum groupinstall "Development Tools"

2)安裝XEN運行時可能會用到的包

[root@localhost ~]$ yum install transfig wget texi2html libaio-devel dev86 glibc-devel e2fsprogs-devel gitk mkinitrd iasl xz-devel bzip2-devel

pciutils-libs pciutils-devel SDL-devel libX11-devel gtk2-devel bridge-utils PyXML qemu-common qemu-img mercurial
[root@localhost ~]$ yum install glibc-devel.i686

3)所有必要的包都已安裝,接著可以安裝XEN和其依賴包

[root@localhost ~]$ yum install xen

4)啟動相關服務

[root@localhost ~]# /etc/init.d/xenconsoled start

[root@localhost ~]# /etc/init.d/xend start

[root@localhost ~]# /etc/init.d/xendomains start

[root@localhost ~]# /etc/init.d/xencommons start

[root@localhost ~]# /etc/init.d/xenstored start

[root@localhost ~]# /etc/init.d/libvirtd start

5)重啟進入XEN的Dom0

[root@localhost ~]$ reboot

Copyright © Linux教程網 All Rights Reserved