Chinaunix首页 | 论坛 | 博客

  • 博客访问: 897939
  • 博文数量: 226
  • 博客积分: 10077
  • 博客等级: 上将
  • 技术积分: 2708
  • 用 户 组: 普通用户
  • 注册时间: 2008-05-25 14:36
文章分类

全部博文(226)

文章存档

2010年(15)

2009年(82)

2008年(129)

我的朋友

分类: LINUX

2009-06-04 21:11:16

Debian 中关于KVM的说明如下:

Full virtualization on x86 hardware
KVM (for Kernel-based Virtual Machine) is a full virtualization solution for
Linux hosts on x86 hardware with x86 guests. KVM is intended for systems where
the processor has hardware support for virtualization, see below for details.
All combinations of 32-bit and 64-bit host and guest systems are supported,
except 64-bit guests on 32-bit hosts.

Using 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.

For the best performance the processor must support hardware virtualization,
provided by AMD's SVM capability and Intel's VT. To find out if your
processor has the necessary support, do as follows:

* Make sure you run Linux 2.6.16 or newer for AMD processors, or
Linux 2.6.15 for Intel processors.  Older Linux versions do not report
the virtualization capabilities.

* Run this command in a shell: egrep '^flags.*(vmx|svm)' /proc/cpuinfo

If it prints anything, the processor provides hardware virtualization
support and is suitable for use with KVM.

Without hardware support, KVM falls back to the considerably slower QEMU-based
software virtualization. In this case, it makes more sense  to use the qemu
package, possibly with the kqemu package (in non-free) for better performance.

The recommended qemu package contains the the qemu-img program needed to create
virtual disk images as well as the script /usr/sbin/qemu-make-debian-root,
which uses debootstrap to build a debian disk image. See the man page
for qemu-make-debian-root. The suggested hal package is only used for
automatically reporting the system bios version and computer model when
reporting bugs.

KVM consists of two loadable kernel modules (kvm.ko and kvm-amd.ko or
kvm-intel.ko) and a userspace component. This package contains the userspace
component, while kvm-source provides the module source.

Homepage: 

Debian Sid中的KVM安装使用方法:

    * Baruch Even and Leonard Norrg?rd have integrated KVM into the debian archive. 

To install and run KVM on Debian, follow these steps:

1. Run these commands as root:

    *

      # apt-get update
      # apt-get install kvm kvm-source qemu module-assistant
      # m-a a-i kvm

Depending on if you are using an AMD or Intel processor, run one of these commands:

    *

      # modprobe kvm-amd

or

    *

      # modprobe kvm-intel

2. The installation of kvm created a new system group named kvm in /etc/group. You need to add the user accounts that will run kvm to this group (replace username with the user account name to add):

    *

      # adduser username kvm 

3. Log out and then login again to acquire the new group added to the account. The following commands can be run with an ordinary user account that is a member of the kvm group.

4. Create a virtual disk image (10 gigabytes in the example, but it is a sparse file and will only take as much space as is actually used, which is 0 at first, as can be seen with the du command: du vdisk.qcow, while ls -l vdisk.qcow shows the sparse file size):

    *

      $ qemu-img create vdisk.qcow 10G

5. Install an operating system. The -m option sets the RAM size for the guest, in megabytes:

    *

      $ kvm \
       -hda vdisk.qcow \
       -cdrom /path/to/boot-media.iso \
       -boot d \
       -m 384

      If you're installing Windows, add the -no-acpi flag. 

6. After installation is complete, run it with:

    *

      $ kvm \
       -hda vdisk.img \
       -m 384

7. Read the manual page for more information:

    *

      $ man kvm 
--

吾爱自己,吾更爱真理!
自由开源,欢迎访问

我的blog
http://morphu.cosoft.org.cn/blog
阅读(1523) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~