您的位置:首页 > 运维架构

OpenStack学习:qemu(一)

2015-11-06 16:28 489 查看
最近在学习OpenStack方面的知识,学习这方面知识前需要学习一些基本的软件:第一个为qemu

(推荐学习时候使用虚拟机,例如VMWare,因为搭载过程linux系统比较容易被自己搞坏了(大神忽略),所以先用虚拟机,再创建虚拟机后,再备份一下)

我的环境是:Win10 + VMWare + Ubuntu14.04(虚拟机加载的iso)

1. qemu是什么?

<span style="font-size:12px;">QEMU is an emulator and virtualization machine that allows you to run a complete operating system as just another task on your desktop. It can be very useful for trying out different operating systems, testing software, and running applications that won't run on your desktop's native platform.

QEMU runs on x86 systems running Linux, Microsoft Windows, and some UNIX platforms, and can host target systems from a range of different microprocessors as detailed on the QEMU website.

QEMU has the advantage of being able to run either as a pure emulator or as a native virtual machine (on x86 / x86-64 hardware)</span>

qemu其实是一个模拟器或虚拟机,能够让你在桌面运行一个完整操作系统,就好像运行一个任务一样。

哪有什么用呢?

其实因为他能够在桌面运行一个完整的操作系统,所以它能够尝试运行不同的操作系统、用于测试软件、能够不在你自己的平台(桌面)上运行软件。它的好处也就是,能够当做一个纯粹的模拟器或者是本地的虚拟机运行。

2.qemu安装?

安装比较简单,使用Ubuntu自带的apt-get安装:

$ sudo apt-get update
$ sudo apt-get install qemu先update一下,然后安装

对于其他linux系统,或者是mac:

DistributionInstall command
Fedora 
yum install qemu
Debian 
apt-get install qemu qemu-kvm libvirt-bin
SUSE
yast -i qemu
Gentoo
emerge -av app-emulation/qemu
Arch
sudo pacman -S qemu
Mac (Homebrew)
brew install qemu
如果安装失败,可以利用源码安装:
$ git clone git://git.qemu-project.org/qemu.git
$ cd qemu/
$ ./configure
$ make
$ sudo make install

3. 安装qemu-kvm

什么是qemu-kvm?
QEMU by itself isn't very fast, as it does a lot of emulation even when running on the hardware compatible with the guest operating system. To make it perform better, QEMU has a kernel module called KVM that allows much of the guest OS's code to run directly on the host processor when running on x86 or x86-64 processors with virtualisation extensions under Linux. For example, if the host is x86 Linux and the guest is Windows XP, then KVM can run most of the Windows XP code directly on the processor without emulation.

其实就是说,qemu本身运行并不是很快,因为它在客户机操作系统中运行兼容性软件的时候,需要处理很多模拟器的事件,所以为了能够让性能提高,qemu有一个内核的模块,也就是kvm,能够让客户机操作系统的很多代码直接在主机的处理器运行。
安装kvm:
sudo apt-get install kvm qemu-kvm libvirt-bin

对于其他的操作系统:

DistributionInstall command
Fedora 
yum install qemu-kvm
Debian
apt-get install kvm qemu-kvm libvirt-bin
SUSE
yast -i kvm
4. 了解更多

今天学习的内容就大概这么多,接下来的时间会继续更新:关于qemu如何使用的问题等
qemu主页:https://en.wikibooks.org/wiki/QEMU
qemu安装:https://en.wikibooks.org/wiki/QEMU/Installing_QEMU
kvm:http://www.linux-kvm.org/page/HOWTO

由于wiki被墙,如果需要查阅以上链接,可以使用XX-net进行翻墙,具体使用方法请戳 http://blog.csdn.net/u012336923/article/details/48264789

谢谢~~
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息