Create an Ubuntu VM using qemu-KVM

Source: Internet
Author: User

Relationship between qemu and KVM
  • KVM is a virtual machine based on the Linux kernel ). In October 2006, a new Virtual Machine implementation solution was developed by qumranet in Israel. The Linux 2.6.20 kernel released in February 2007 contains KVM for the first time. Adding KVM to the Linux kernel is an important milestone in the development of Linux, which is also the first virtualization technology integrated into the Linux main kernel.
  • Virtualization is generally a Virtualization Technology Based on CPU hardware support. KVM also relies on this technology like hyper-V and xen. KVM cannot work without support for CPU Hardware virtualization.

    Indeed, KVM is a LINUX module. You can use modprobe to load the KVM module. After the module is loaded, you can use other tools to create virtual machines. However, only the KVM module is far from enough, because users cannot directly control the kernel module to do things: there must be a user space tool. This user space tool allows developers to choose the open-source virtualization software qemu. Qemu is also a virtualization software. It features different virtual CPUs. For example, you can use an x86 CPU to virtualize a power CPU and compile a program that can run on power. KVM uses a part of qemu and is transformed to a user space tool that can control KVM. So you will see two official KVM downloads
    Most of the three files are KVM module, qemu tool, and a collection of the two. In other words, you can upgrade only the KVM module or the qemu tool. This is the relationship between KVM and qemu.

  • So for me, what I need is to use this tool to install the operating system I need and simulate the hardware I don't have.
Install Ubuntu 10.10
  • First create virtual disk qemu-IMG create-F qcow2 ubuntu-vm.img 15g; my host is Ubuntu
  • Then the system is installed with KVM-M 740-CDROM/Media/linuxswap/ubuntu-10.10-desktop-i386.iso. /ubuntu-vm.img;-m is the size of memory allocated to the virtual machine-CDROM uses the path to the ISO file and finally the path to the virtual disk. The steps for installing the operating system are the same as those for installing the operating system.
  • Start qemu-KVM-M 740-SMP 1-hda./ubuntu-vm.img after installation. -SMP indicates how many CPUs are allocated.
  • I chose to use VNC to log on to the desktop. There is a Remote Desktop Connection in the Ubuntu program. A localhost port number is generated in the previous step. The port I use is 5901. Just connect. At this time, as long as the host can access the Internet, the virtual machine can also
Reference: http://www.ibm.com/?works/cn/linux/l-cn-kvm/welcome to my independent blog Co., http://www.fuxiang90.me /? P = 565

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.