The KVM under Ubuntu

Source: Internet
Author: User

  1. BIOS Open VT

  2. Install Ubuntu system

    1. Install KVM-related software and set up Bridge adapter

      (1) # Apt-get install QEMU-KVM libvirt-bin virtinst bridge-utils cpu-checker

        # $ sudo apt-get install  virt-manager qemu

      (2) # kvm-ok
      INFO:/DEV/KVM exists
      KVM acceleration can used

      (3) # cp/etc/network/interfaces/etc/network/interfaces.bakup

      (4) # vi/etc/network/interfaces

         auto br0
         iface br0 inet static
              address 10.18.44.26
              netmask 255.255.255.192
              broadcast 10.18.44.63
              Dns-nameservers 10.0.80.11 10.0.80.1
              bridge_ports eth0
          &NBS P   BRIDGE_STP off
              BRIDGE_FD 0
              bridge_maxwait 0

      &nb Sp  auto eth0

         iface eth0 inet static

      (5) If you have a network card, you can do multiple bridge interfaces

Auto BR1
Iface BR1 inet Static
Address 208.43.222.51
Netmask 255.255.255.248
Broadcast 208.43.222.55
Gateway 208.43.222.49
Bridge_ports eth1
BRIDGE_STP off
BRIDGE_FD 0
Bridge_maxwait 0

Auto Eth1

Iface eth1 inet Static


Configure directly using the BRCTL command

$ sudo brctl addbr br0
$ sudo ip addr Show
$ sudo brctl addif br0 eth0



To create a virtual machine:

$ sudo virt-install \
--VIRT-TYPE=KVM \
--name centos7 \
--ram 2048 \
--vcpus=2 \
--OS-VARIANT=RHEL7 \
--VIRT-TYPE=KVM \
--HVM \
--cdrom=/var/lib/libvirt/boot/centos-7-x86_64-dvd-1511.iso \
--network=bridge=br0,model=virtio \
--network=bridge=br1,model=virtio \
--graphics VNC \
--disk Path=/var/lib/libvirt/images/centos7.qcow2,size=40,bus=virtio,format=qcow2



$ sudo virsh dumpxml centos7 | grep VNC
<graphics type= ' vnc ' port= ' 5901 ' autoport= ' yes ' listen= ' 127.0.0.1 ' >



$ sudo virsh vncdisplay centos7



Reference: the link https://www.cyberciti.biz/faq/installing-kvm-on-ubuntu-16-04-lts-server/



The KVM under Ubuntu

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.