kvm安装及配置

因为实验室项目有关,目前开始接触kvm虚拟化,主要针对下载和配置问题作出一个说明

1 kvm源码下载

这里给出几个源码的下载地址:
git://git.kernel.org/pub/scm/virt/kvm/kvm.git
https://git.kernel.org/pub/scm/virt/kvm/kvm.git
https://kernel.googlesource.com/pub/scm/virt/kvm/kvm.git
这里在Linux中操作,使用git clone git://git.kernel.org/pub/scm/virt/kvm/kvm.git kvm.git将源码克隆到当前目录下的kvm.git下。这里大约有1个G左右,下载的速度取决于你的网速,国内暂时未找到镜像源。

为安装git的使用apt-get install git先安装git

2 make安装

这里要使用make来完成配置和编译,如果安装了make可以忽略此步骤。
执行

// 这里我是Debian的发行版,如果是其他发行版,可以用yum等命令来安装。
apt-get install make

来安装make。

2.1 make配置文件的生成

生成配置文件的方式有很多种,这里我使用make menuconfig来进行可视化的配置工作。如果要使用make menuconfig,并且出现下面错误:

make[1]: Warning: File '/usr/lib/gcc/x86_64-linux-gnu/4.9/include/stddef.h' has modification time 39690849 s in the future
  HOSTCC  scripts/basic/fixdep
make[1]: warning:  Clock skew detected.  Your build may be incomplete.
*
* Unable to find the ncurses package.
* Install ncurses (ncurses-devel or libncurses-dev
* depending on your distribution).
*
scripts/kconfig/Makefile:228: recipe for target 'scripts/kconfig/.mconf-cfg' failed
make[1]: *** [scripts/kconfig/.mconf-cfg] Error 1
Makefile:537: recipe for target 'menuconfig' failed
make: *** [menuconfig] Error 2
root@debian8:~/kvm/kvm.git# apt-get install ncurses-devel
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ncurses-devel

那么这里还需要安装ncursesflexbison。具体的安装包名字视更新源为准,安装命令视发行版为准。

ncurses是一个程序库,它提供了API,可以允许程序员编写独立于终端的基于文本的用户界面。它是一个虚拟终端中的“类GUI”应用软件工具箱。它还优化了屏幕刷新方法,以减少使用
flex/bison是对lex/yacc的开源实现,可以方便地进行编译器构造。简而言之,Flex是一个词法分析器,Bison则是一个文法分析器,可以用来制作简单的分析器,如配置文件等

posted @ 2018-10-27 14:03  dn96  阅读(1015)  评论(0编辑  收藏  举报