虚拟机知识大盘点
上一篇 / 下一篇 2007-12-08 01:48:53 / 个人分类:Linux系统配置
)u[5Y'Z:M#a PJe0
Qwb \/c'M$M.rM.oZ0Using KVM, one can run multiple virtual machines running unmodified Linux or Windows images. Each virtual machine has private virtualized hardware: a network card, disk, graphics adapter, etc.
pO7S ^0@5mv+T ]051Testing软件测试网 I`Be e['h-A
The kernel component of KVM is included in mainline Linux, as of 2.6.20.
%RjsJ7h(C@,m H0
^/S |V{3s"Q@0KVM is open source software.51Testing软件测试网)A*M:nf8GI8A
If u want to learn more about it, the following is theNavigation:
hI m*z1TV?K051Testing软件测试网U mnt;d9d;Y#b"O9d
Linux Gains Two New Virtualization Solutions51Testing软件测试网?j6hDf
51Testing软件测试网8a0L } c"wT d THWThe upcoming 2.6.23 kernel has gained two new virtualization solutions. According to KernelTrap, bothXenandlguest have been merged into the mainline kernel. These two virtualization solutions jointhe already merged KVM, offering Linux multiple ways to run multiple virtual machines each running their own OS.
%T~!F)]h;B0半虚拟化技术(Paravirtualization):51Testing软件测试网s#i}g9qgL{,R51Testing软件测试网8U"q6@,a1E/a2? N1Z
全虚拟化技术(Full Virtualization):
[#_c(H Grhyn B0
G%@;J-?9CUC\0Intel VT虚拟技术( Virtualization Technology):
6{,T7T7Pw w TF0AMD SVM(安全虚拟机, Secure Virtual Machine):
Sg&Au'i/}1^0Linux Tip: How to Tell if Your Processor Supports VT
51Testing软件测试网x_)R%Ix!A2S_cVirtualization Technology (VT) is a set of enhancements to newer processors that improve performance for running a virtual machine by offloading some of the work to the new cpu extensions. Both AMD and Intel have processors that support this technology, but how do you tell if your system can handle it?
iP\.e$n"~08y1a9BU*y-_iE0It's quite simple: We'll need to take a peek inside the /proc/cpuinfo file and look at the flags section for one of two values, vmx or svm.
2y(_a"K\b8P:H%j0- vmx- (intel)
- svm- (amd)
You can use grep to quickly see if either value exists in the file by running the following command:51Testing软件测试网es@"h#E tKa
51Testing软件测试网/r/rj4yU2G`egrep '(vmx|svm)' /proc/cpuinfo51Testing软件测试网6l+z:p!S'AP ip5B
l
{`vtM0If your system supports VT, then you'll see vmx or svm in the list of flags. My system has two processors, so there are two separate sections:
k6`*\1D ](Sl[K0
O ?2Erx5u4X2lH3[.Z0flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cplvmxest tm2 ssse3 cx16 xtpr lahf_lm51Testing软件测试网N UR^5_c4x ]
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm syscall nx lm constant_tsc pni monitor ds_cplvmxest tm2 ssse3 cx16 xtpr lahf_lm51Testing软件测试网0N%~;{hFM
[7B [u@'I0VT technology can still be disabled in your computer's BIOS, however, so you'll want to check there to make sure that it hasn't been disabled. The flags in cpuinfo simply mean that your processor supports it.51Testing软件测试网Yc:EqVQ+a"U
Wl8we1{7q1G~6k,R0From my research, VT is required in order to run 64-bit guests under the free VMware server for linux… so it would logically follow that if you can do so, VT is enabled.51Testing软件测试网d6o/R\m
51Testing软件测试网Q*PN3m+ZU32-bit VT is not enabled by default under VMware server. If you want to enable it, you need to add the following line to your *.vmx file for your virtual machine:51Testing软件测试网Z1gH$]^
51Testing软件测试网5dOa%P|x-z9tmonitor_control.vt32 = TRUE
E w7F\1@0
0iR$]7\:r-{ a0VMware does not recommend that you use VT for 32-bit guests, because they say it will actually hurt performance.51Testing软件测试网.W6rX*IIK CZ V+{ t
OD7p7oy6Wr"pn IXK E0------------------------------------------------------------------------------------
{~:RyY0TB:S}ZM3q u0WHAT IS BOCHS?
,c6UQ:qwxo"Z1n051Testing软件测试网1e*R,{Gl h~ |3R
Bochs is a highly portable open source IA-32 (x86) PC emulator51Testing软件测试网Mt TCPSs\
written in C++, that runs on most popular platforms. It includes51Testing软件测试网NT
P~$B8ev
emulation of the Intel x86 CPU, common I/O devices, and a custom51Testing软件测试网(E2ScW+`i!l6tcz
BIOS. Currently, bochs can be compiled to emulate a 386, 486 or
3} st"~.k0Pentium CPU. Bochs is capable of running most Operating Systems
gm.qwRk0`(u A0inside the emulation including Linux, Windows 95, DOS, and51Testing软件测试网r0PNL{#}p:m
Windows NT 4. Bochs was written by Kevin Lawton and is currently51Testing软件测试网Hx/e2^Bc
maintained by the Bochs project at "http://bochs.sourceforge.net".
--------------------------------------------------------------------------------------------------------51Testing软件测试网3aP)P_[+]%z
About PearPC
51Testing软件测试网7fn8~8_gHD/kifPearPC is an architecture-independent PowerPC platform emulator capable of running most PowerPC operating system51Testing软件测试网H+weK4^ [C2C"~
51Testing软件测试网s0@4uq/Q LgFeatures
51Testing软件测试网9{ss?6E3EX6[lg
51Testing软件测试网0{:I8Mt.W4`2[7Z
51Testing软件测试网S']Z(|aA;E t)eB suu0\0sK/^s0- License:GPL
- Programming language:C++, C and (on x86 platforms) assembler
- Supportedhostplatforms:POSIX-X11 (Linux, ...), Win32
Linux上的KVM虚拟化常见问题精彩问答
S-Q:XJ.]PiC1O01.系统(处理器)需求?
V{/s fzaq0y051Testing软件测试网0`#M(n Z)y:H[/`:Ap你将需要一台运行最新Linux内核的Intel处理器(含VT虚拟化技术)或AMD处理器(含SVM安全虚拟机技术的AMD处理器, 也叫AMD-V)。
a/O0i/Qve V7h051Testing软件测试网[4GUnnUM2.什么是Intel VT/AMD-V?51Testing软件测试网'aON$K6L.`l
qJ(K#[T`0 Intel VT和AMD’s AMD-V是一套与支持该技术的虚拟机监视器相结合的硬件增强特性(指令集扩展)。kvm可在原始硬件速度下通过运行完全隔离的虚拟机来执行任务。
6C-?1B%I$`1XOk]+WS051Testing软件测试网"Fw^&x1a0KQcz3.如何确认处理器含有Intel VT或AMD-V技术?
xe/Bb(])^W051Testing软件测试网B7F)K$H;@b在最新的Linux内核下运行: egrep ‘^flags.*(vmx|svm)’ /proc/cpuinfo
&LCSWn w051Testing软件测试网D,e([k}0@如有显示,您的处理器具有VT功能。你也可以通过厂商网站查询处理器型号的名称(在/proc/cpuinfo)。51Testing软件测试网%uS$Y9?7L*Q
51Testing软件测试网&h(}f4tj S&OSw(rx 注:一些厂商禁止了机器BIOS中的VT选项, 这种方式下VT不能被重新打开。51Testing软件测试网C+_Cz
g#G`)M
./proc/cpuinfo仅从Linux 2.6.15(Intel)和Linux 2.6.16(AMD)开始显示虚拟化方面的信息. 请使用uname -r命令查询您的内核版本。
如有疑问, 请联系硬件厂商。51Testing软件测试网:TA"UEuZTH
51Testing软件测试网G_j3w(d H6icb+[4.kvm支持哪些用户空间工具?51Testing软件测试网&F6bfr({:EkeB)V
2A-FF#SV0 kvm使用稍改动的qemu程序来创建虚拟机. 一旦运行后, 虚拟机是一个标准的进程. 你可以使用top(1),kill(1),taskset(1)和类似的工具来管理虚拟机。
u`r C6q6cp2aU051Testing软件测试网5JB?Y9L5.kvm支持哪些虚拟磁盘格式?51Testing软件测试网1O1L(WI y[E
51Testing软件测试网U xJ:GGO[sAkvm从qemu继承了丰富的磁盘格式, 包括裸映象(raw images), 原始qemu格式(qcow), VMware格式和更多。
+z B(Rhr#r051Testing软件测试网LYvLcC$|&Q6.kvm和Xen有何区别?
{I)^,~8G051Testing软件测试网-k5a`G7@0}.{0[+Na_{Xen是一个外部的hypervisor程序(虚拟机管理程序);它能够控制虚拟机和给多个客户机分配资源. 另一方面, kvm是linux的一部分, 可使用通常的linux调度器和内存管理. 这意味着kvm更小更易使用。
\|p }[V z1Ae051Testing软件测试网mw8zWbDB另一方面, Xen同时支持全虚拟化和半虚拟化(修改过的客户机能有更好的性能). kvm当前不支持半虚拟化。
O r&J~YTT(vW051Testing软件测试网Z3qs^ f:l SU7.kvm和VMware有何区别?51Testing软件测试网 G0od}Q!U
gl/NQ*qI*@0 VMware是一个专利产品. kvm是一个遵守GPL的自由(开源)软件。51Testing软件测试网zV@xX
:jt y!O lGg { n]t0 8.kvm和QEMU有何区别?51Testing软件测试网bC5x iS1Y)_u@;M
51Testing软件测试网D1C |SzcoQemu使用模拟器; kvm使用处理器扩展实现虚拟化。51Testing软件测试网5[!Y7w]v*u
51Testing软件测试网SWc!uG%v7K_9.kvm有windows上的版本吗?51Testing软件测试网,S~yi Qc(mg:y5R
HwO1_ e n]0 当前没有。
/PV M,lu Fo051Testing软件测试网(mUF pk#\)g(ja10.kvm支持哪些内核版本?
H9Lp-kj:TO_051Testing软件测试网\*T~$K\%kR#L%okvm可以运行在最新的内核版本下(2.6.16或更高, 最好是用最新的内核)51Testing软件测试网4AQSw6St ~m7X
d$D/q/^P0 11.我需要多什么RAM(内存)才能运行kvm?51Testing软件测试网*b5e9F7M P4lw
51Testing软件测试网9G iE5wFp dP OI$v你需要足够的内存在主机上运行单个或多个虚拟机. 建议主机内存至少1GB。
%HthG8Sv2^051Testing软件测试网 Dqq,fz(m12.KVM上的虚拟机支持哪些操作系统?51Testing软件测试网`CMp? pB#vQ
(\\s2@*Ia0 我们已经测试了Linux(32/64位)和Windows(32位), 其它也许能够运行或不能运行。不支持64位的Windows操作系统, 该问题会在qemu-0.83发布和整合后修复。51Testing软件测试网vEkU\@j
Intel处理器上几个Linux发行版在启动时候会挂起。工作区需要取消grub中的splashscreen选项。
13.KVM支持动态迁移功能吗(在不离线的情况下把虚拟机从一个主机移到另一个主机上)?
DA l6C |(FO @051Testing软件测试网L/S)V"[v&J3e)i现在kvm支持非动态迁移,当内存数据需转移的时候,系统需要停止。动态迁移功能正在开发当中。
K@^Vm*} s00vP?W;\0 14.kvm能够在64为主机上运行32位的客户机吗? 什么是PAE?51Testing软件测试网 K/Y&t"VA
51Testing软件测试网$zwRYaj Ekvm支持在64位主机上运行32位客户机, 也可以是任何PAE或非PAE客户机和主机组合。但不支持在32位主机上运行64位客户机。
#[E0E/j2_.q+Q~ Y^051Testing软件测试网]$d+}_6`F15.如果我对一个VM进程使用kill -9将会发生什么?51Testing软件测试网xGCC%t+cGX Pr
51Testing软件测试网 m @r$f.k4l4|c2@从客户机的角度来看,就如你猛地把电源线从主机上拔出一样。从主机的角度来看,进程被杀掉,进程占用的所有资源被施放。
'yp4e8Bt,{?051Testing软件测试网wB'La?$oR7_z16.kvm支持SMP主机吗?51Testing软件测试网-B yzg9Z
51Testing软件测试网-h9pr"iP)Y3m}H支持。
4Q(f^P*T]6t0