Posts Tagged ‘KVM’

It’s a mistake to include Xen in a Linux distro

As the title show, it's a mistake to include Xen in a linux distro. Why?

Somebody would argue that Xen is a very useful technology. Xen does the virtualization work very well and many projects are using Xen which prove Xen is so great.

I'm not mean Xen is not good. However, just because Xen is a hypervisor that is based on another microkernel that is not Linux kernel itself. Linux distros that ship Xen today actually are running an entirely different Operating System kernel that most users even don't notice that. Xen should be a separate, purpose-built kernel, so it should never be a part of the Linux kernel. Isn't it strange that you think you are running a linux OS, but this 'linux' has a kernel that is not linux, which is another kernel. You take away the Linux kernel, how could you say the OS is Linux.

Just before the born of the Linux native virtualization KVM, the distros shipped Xen because there exist no other choices. Many Linux developers at that time know little about virtualization. Xen seemed a pretty easy and pretty good choise. So the Linux community made the hasty decision to ship Xen instend of investing in makeing Linux's own hypervisor. But now KVM has come for more than five years(since kernel 2.6.20 in Feb, 2007. KVM actually has a longer history. It was out there before being merged into mainline kernel code.) and KVM has proven itself to be completent to replace Xen. The most important thing is that KVM as a part of the linux kernel leverages the features of kernel like memory management, process scheduling and so on, making the kernel a perfect hypervisor. So, there is no reasons to ship Xen in Linux distros any more.

COPYRIGHT WWW.DOGEYE.NET

Be the first to comment - What do you think?  Posted by zausiu - June 22, 2012 at 21:21

Categories: Tech Articles, Unix / Linux, Virtualization   Tags: , ,

什麼是敏感指令

1974年,Popek和Goldberg在美國电脑協會的通訊期刊上發表了一篇論文"虛擬化第三代架構的一般性要求"(Formal Requirements for Virtualizable Third Generation Architectures)。在這篇文章中,提出了敏感指令的概念。

敏感指令(Sensitive Instructions)的定義: 敏感指令是這樣一組指令,這些指令的行為取決於指令執行時處理器的工作模式,以及指令在記憶體中的位置。

-------

對敏感指令的處理是虛擬化技術的一個關鍵點。在用戶態執行的敏感指令如果總會造成陷入(always generates a trap),這樣的敏感指令也屬於特權 指令。在不使用Wmware提出的動態二進制翻譯機制的情況下,除非所有的敏感指令都是特權指令,虛擬機管理程式才能保證正確運行。換言之,如果某種處理器架構的所有的敏感指令都是特權指令的一個子集,我們就可以說這種處理器架構是可虛擬化的。在這種情況下,我們就可以肜經典的“陷入後模擬“(trap-and-emulate)的方法實現虛擬化。按照這個定義,在嵌入式工業中最常見的ARM架構則不是可虛擬化的,因為ARM的敏感指令有些是特權指令,有些則不是。

原文 from the paper "KVM for ARM" by Christoffer Dall and Jason Nieh, Columbia University:Popek and Goldberg define sensitive instructions as the group of instructions where the effect of their execution depends on the mode of the processor or the location of the instruction in physical memory. A sensitive instruction is also privileged if it always generates a trap, when executed in user mode. The VMM can only guarantee correct execution without the use of dynamic translation if all sensitive instructions are also privileged. In other words, an architecture is virtualizable if and only if the set of sensitive instrucctions is a subset of the seet of privileged instructions. If that is the case, the VMM can be implemented using a classic trap-and-emulate solution. Unfortunately, ARM is not virtualizable as the architecture defines both sensitive privileged instructions and sensitive non-privileged instructions.

blog.ykyi.net 翻译

Be the first to comment - What do you think?  Posted by zausiu - June 21, 2012 at 16:20

Categories: Virtualization   Tags: ,

怎么编译,构建,安装,使用WinKVM

 

WinKVM : Windows kernel-based Virtual Machine

 

WinKVM Windows下台下基于内核的虚拟机(Linux的KVM的windows移植)

 

怎么编译,构建WinKVM

 

这篇方章会告诉你如何编译WinKVM.

你必须先准备好三件东西。

1. 去到http://www.cygwin.com/ 下载安装Cygwin。注意安装时选好gcc-3.x rsync, zlib和awk.

2. 建议用Visual Studio 2008专业版,你也可以使用Visual Studio Express版。

3. Windows DDK, 本文使用The Microsoft® Windows Server™ 2003 Service Pack 1 (SP1) DDK。

必须先下载并安装好这三大件!呃,当然!WinKVM的代码必须下载好了。https://github.com/ddk50/winkvm/

 

在动手编译之前,先设置好好编译环境。添加环境变量BASEDIR2K3,指向你的DDK安装的目录。Visual Studio使用这个环境变量构建驱动程序WinKVM

好吧,动手干活吧!WinKVM的构建过程有一点麻烦。

三样东西必须分开构建。

STEP ONE:

先构建 kvmctldll: cd到vcproj/user/kvmctldll目录,双击kvmctldll.vcproj打开工程,点击build。结束后到vcproj/bin目录下查看有没有kvmctldll.dll文件。如果有,那恭喜你,第一步成功了。

STEP TWO:

使用Cygwin环境编译KVM的原生版本。

cd kvm/kernel  ## 转到kvm/kernel目录。

make           ## 如果你得到:unrecognized emulation mode:elf_i386。不要慌张,这不是一个错误。

make cpobjs   

STEP THREE: 

打开到vcproj/kernel/winkvm.vcproj,编译构建WinKVM驱动。

到vcproj/bin目录下查看有没有成功。如果有生成winkvmstab.sys,则成功了。

STEP FOUR:

最后,要在cygwin环境下构建QEMU。如下:

cd kvm/winkvm-qemu

./configure --prefix=path/to/installation --enable-kvm --target-list=i386-softmmu --disable-kqemu

make

make install

 

 

怎么使用WinKVM

 

必须先申明,在安装好WinKVM以后,你的操作系统可能很不稳定喔!因为WinKVM还只是一个alpha版本。

另外!一定不能在多处理器的系统上运行~如果你的机器是多处理器或者多内核的,必须在启动阶段启用单内核模式。见本文最后怎么进入单内核模式。

先到http://github.com/ddk50/winkvm/downloads下载WinKVM的编译好的二进制驱动并方便方装的相当文件。

然后, 执行下载好的 DIP_gui.exe,这个程序会帮助你安装好WinKVM。点击“...”按钮,再选中winkvmstab.sys驱动文件,最后点击“Install”就开始安装了。安装过程可能会花费一点时间。如果你要卸载驱动的话,同样点击'...'按钮后,再选'Uninstall'。

最后一步,双击"WinKVM.bat"批处理文件执行WinKVM。

 

 

有童鞋问,哥的cpu是多核啊,怎么设置从单核模式启动啊????

 

那本座就告诉你怎么转换到单核模式(single-core mode)启动windows。

1. 按win+r, 输入cmd回车。 (即启动windows的控制台,你可以用其它方式打开windows的控制台)

2. cd c:\

3. attrib -h -r -s boot.ini (这样才能看到c驱动器下的boot.ini文件)

4. 用资源管理器转到c盘根目录,随便用什么文本编辑器参照下面一行编辑boot.ini文件。

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional (onecpumode)" /noexecute=optin /fastdetect /onecpu

5. attrib +h +r +s boot.ini (如果你不怕麻烦再把boot.ini默认的系统属性,隐藏属性,只读属性再加回去吧!)

重启机器,可以进入单核模式啦(single-core mode)!

copyright blog.ykyi.net

Be the first to comment - What do you think?  Posted by zausiu - June 14, 2012 at 00:00

Categories: Tech Articles, Virtualization   Tags: ,

Next Page »