Ubuntu12.04KVM + Qemu

Source: Internet
Author: User
NOTE: My host is ubuntu12.040000topi386. I want to install KVMQemu and create a new virtual host Ubuntu12.04Serverx86 _ 641) to check whether the cpu is supported. Www.linuxidc.com @ linuxidc:/opt $ grepvmx/proc/cpuinfoflags indicates vmx. 2) install kvm + qemuwww. linuxidc.

NOTE: My host is Ubuntu 12.04 Desktop i386. I want to install KVM Qemu and create a new virtual host Ubuntu 12.04 Server x86_64.

1) check whether the cpu is supported.

Www.linuxidc.com @ linuxidc:/opt $ grep vmx/proc/cpuinfo

Vmx exists in the flags.

2) install kvm + qemu

Www.linuxidc.com @ linuxidc:/opt $ sudo apt-get install kvm qemu libvirt-bin guest inst virt-manager virt-viewer

3) check whether the kvm is successfully installed.

Www.linuxidc.com @ linuxidc:/opt $ sudo virsh-c qemu: // system list

4) create a kvm folder.

Www.linuxidc.com @ linuxidc:/opt $ sudo mkdir/opt/kvm

5) use the qemu-img command to create a virtual disk.

Www.linuxidc.com @ linuxidc:/opt $ qemu-img create-f qcow2 kvm/ubuntu1204.img 10G

NOTE: create indicates creating a new disk.-f specifies the disk type. raw or vmware compatible can be created. Here, qcow2 is selected, qemu is used to install ubuntu. The following parameter is the virtual disk file name, which can be placed anywhere you like, and then the initial disk size. Generally, it can be 5 Gb or 10 Gb, the disk size of qemu can automatically increase as needed, so you can select a smaller point at first.

6) download the image package and install the virtual machine operating system.

Www.linuxidc.com @ linuxidc:/opt/kvm $ wget-c http://mirrors.163.com/ubuntu-releases/12.04/ubuntu-12.04-server-amd64.iso

#

Www.linuxidc.com @ linuxidc:/opt/kvm $ sudo qemu-system-x86_64-hda/opt/kvm/ubuntu1204.img-cdrom/opt/kvm/ubuntu-12.04-server-amd64.iso-boot d-m 1024-no-acpi

-Hda specifies the virtual disk. Here we use the ubuntu1204.img we just created.

-Cdrom: Specifies the cdrom. You can use the iso file or the optical drive of the machine. We choose to use the iso file. If you use the optical drive, try-cdrom/dev/cdrom.

-Boot: Specify whether to start from the disk, hard disk, optical drive, or the network during startup. We choose to start from the optical drive during installation, so use d

-M: The memory size used by the VM. The unit is MB. The default value is 128 mb. I use 1024.

-No-acpi: Due to poor qemu support, the system will be slow, so we will temporarily disable it.

You can use man to view the description of the qemu-system-x86_64.

Because-no-acpi is added, You need to disable kvm and run the appeal command each time during reboot installation. After installation, run the command above, in this case, you can remove the-cdrom parameter if you no longer need it.

7) install Ubuntu Server 12.04 tutorial http://www.linuxidc.com/Linux/2012-04/59368.htm and http://www.linuxidc.com/Linux/2012-05/60147.htm

8) Start the VM.

Www.linuxidc.com @ linuxidc:/opt/kvm $ sudo qemu-system-x86_64 kvm/ubuntu1204.img-m 1024

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

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.