Home IT Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ KVM QEMU virtual machine installation configuration under CentOS     - Linux performance optimization features Tuned and ktune (Linux)

- Java Access Control (Programming)

- Installation and use GAMIT / GLOBK Software (Linux)

- Django url () function Detailed (Programming)

- FileZilla FTP && TLS connection settings of (Linux)

- Growth since Oracle set the table space (Database)

- IP Security Policy is to learn how to prevent Ping and closed ports (Linux)

- Browser caching mechanism on the analysis (Linux)

- Detailed iptables (Linux)

- Swift notes - let you two hours to learn Swift (Programming)

- Getting the Linux shell flow control statements (Programming)

- Ubuntu font settings: Using Windows Font (Linux)

- Linux Proc File System Experiment (Linux)

- MySQL optimization resulting order by using filesort (Database)

- Red Hat Enterprise Linux configuration VNC multi-user access methods (Linux)

- Ubuntu 14.04 can be used to create a WIFI hotspot for Android (Linux)

- About AWR More Description (Database)

- Java call by value and by reference (Programming)

- CentOS 6 Install Linux kernel source (Linux)

- Upgrading to MySQL 5.7 partitioning problem solving (Database)

 
         
  KVM QEMU virtual machine installation configuration under CentOS
     
  Add Date : 2016-06-12      
         
       
         
  First, what is KVM?

KVM includes many components: First, it is a Linux kernel module (now included in mainline) processor for converting to a new user (guset) mode. User mode has its own set of states of the ring, but will fall into the privileged ring0 instructions to the manager (hypervisor) code. Since this is a new processor execution model, the code does not require any changes.

In addition to the processor state transitions, the same kernel module handle small part of the low-level simulation, such as MMU register (for managing VM) and part of the PCI analog hardware.

In the foreseeable future, Qemu team focused on portability and hardware simulation, while the team focused on KVM kernel module (if indeed there is some part of the performance, then, KVM will be a small part of the simulation code shift comes in) and the rest interactive user space code.

kvm-qemu Qemu executable as ordinary as: distribution RAM, load code, unlike the recompilation or call calling KQemu, it creates a thread (this is very important); the thread calls KVM kernel module to switch to user mode, and VM to execute code. When encountering a privileged instruction, it will re-switching KVM kernel module, the kernel module when needed, like Qemu signal thread to handle most of the hardware emulation.

The architecture of a more subtle one place is the customer code is simulated in a posix thread, which allows you to use management tools usually Linux. If you need a 2 or 4-core virtual machines, kvm-qemu create two or four threads, each calling KVM kernel module and begin execution. Concurrency (If thou have enough real nuclear) or schedule (if you no matter) is a common Linux scheduler, this makes a very small amount of code KVM

When working together, access KVM management of CPU and MEM, QEMU emulation hardware resources (hard drives, sound cards, USB, etc.) when QEMU operated alone, QEMU simultaneous analog and CPU hardware.

Second, the installation configuration KVM

# Yum -y install kvm python-virtinst libvirt bridge-utils \
virt-manager qemu-kvm-tools virt-viewer virt-v2v qemu-kvm tunctl

[Root @ localhost ~] #vim / etc / sysconfig / selinux // Close selinux

SELINUX = disabled

[Root @ localhost ~] #reboot

[Root @ localhost ~] # cat / etc / RedHat-release
CentOS release 6.5 (Final) // centos 6.5

Third, start libvirtd

[Root @ localhost ~] # /etc/init.d/libvirtd start // Start

[Root @ localhost ~] # ps -e | grep libvirtd // Check whether to activate
19458? 00:00:01 libvirtd

Fourth, view the kvm module loaded correctly

[Root @ localhost ~] # lsmod | grep kvm
kvm_intel 54285 0
kvm 333172 1 kvm_intel

5, configuration network bridge

[Root @ localhost network-scripts] # ​​cat ifcfg-eth0 | awk '{if (! $ 0 ~ / ^ $ / & amp; & amp; $ 0 ~ / ^ # /!) {Print $ 0}}'
DEVICE = eth0
TYPE = Ethernet
ONBOOT = yes
BOOTPROTO = none
BRIDGE = br0
IPV6INIT = no
HWADDR = F8: BC: 12: 60: 99: 86

[Root @ localhost network-scripts] # ​​cat ifcfg-br0 | awk '{if ($ 0 ~ / ^ $ / & amp; & amp; $ 0 ~ / ^ # /!!) {Print $ 0}}'
DEVICE = br0
TYPE = Bridge
ONBOOT = yes
BOOTPROTO = static
IPADDR = 192.168.10.103
GATEWAY = 192.168.10.1
NETMASK = 255.255.255.0
DNS1 = 192.168.10.1
IPV6INIT = no
DELAY = 0

Restart the network and found the following error message:

[Root @ localhost network-scripts] # ​​/etc/init.d/network start
Pop the loopback interface: [OK]
Pop-up interface eth0: Error: Activation Connection Failed: Master connection not found or invalid
                                                          [failure]
Pop-up interface br0: Error: Activation Connection Failed: Failed to determine connection's virtual interface name
                                                          [failure]
RTNETLINK answers: File exists
RTNETLINK answers: File exists
RTNETLINK answers: File exists

Solution:

[Root @ localhost rules.d] # service NetworkManager stop // close off the line
Stop NetworkManager daemon: [OK]

[Root @ localhost rules.d] # service network restart
Turning off Interface br0: [OK]
Turning off the interface eth0: [OK]
Close the loopback interface: [OK]
Pop the loopback interface: [OK]
Pop-up interface eth0: [OK]
Pop-up interface br0: Determining if ip address 192.168.10.103 is already in use for device br0 ...
                                                          [determine]

If the following instructions to configure it a success:

[Root @ localhost network-scripts] # ​​ifconfig
br0 Link encap: Ethernet HWaddr F8: BC: 12: 60: 99: 86 // have this on OK
          inet addr: 192.168.10.103 Bcast: 192.168.10.255 Mask: 255.255.255.0
          inet6 addr: fe80 :: fabc: 12ff: fe60: 9986/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1
          RX packets: 36416 errors: 0 dropped: 0 overruns: 0 frame: 0
          TX packets: 28648 errors: 0 dropped: 0 overruns: 0 carrier: 0
          collisions: 0 txqueuelen: 0
          RX bytes: 13151508 (12.5 MiB) TX bytes: 5962449 (5.6 MiB)

eth0 Link encap: Ethernet HWaddr F8: BC: 12: 60: 99: 86
          inet6 addr: fe80 :: fabc: 12ff: fe60: 9986/64 Scope: Link
          UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1
          RX packets: 1360857 errors: 0 dropped: 0 overruns: 0 frame: 0
          TX packets: 902173 errors: 0 dropped: 0 overruns: 0 carrier: 0
          collisions: 0 txqueuelen: 1000
          RX bytes: 1913592871 (1.7 GiB) TX bytes: 72387220 (69.0 MiB)

lo Link encap: Local Loopback
          inet addr: 127.0.0.1 Mask: 255.0.0.0
          inet6 addr: :: 1/128 Scope: Host
          UP LOOPBACK RUNNING MTU: 16436 Metric: 1
          RX packets: 176842 errors: 0 dropped: 0 overruns: 0 frame: 0
          TX packets: 176842 errors: 0 dropped: 0 overruns: 0 carrier: 0
          collisions: 0 txqueuelen: 0
          RX bytes: 880282316 (839.5 MiB) TX bytes: 880282316 (839.5 MiB)

virbr0 Link encap: Ethernet HWaddr 52: 54: 00: 1A: B6: F1
          inet addr: 192.168.122.1 Bcast: 192.168.122.255 Mask: 255.255.255.0
          UP BROADCAST RUNNING MULTICAST MTU: 1500 Metric: 1
          RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0
          TX packets: 37 errors: 0 dropped: 0 overruns: 0 carrier: 0
          collisions: 0 txqueuelen: 0
          RX bytes: 0 (0.0 b) TX bytes: 4651 (4.5 KiB)

[Root @ localhost network-scripts] # ​​brctl show
bridge name bridge id STP enabled interfaces
br0 8000.f8bc12609986 no eth0 // have this on OK
virbr0 8000.5254001ab6f1 yes virbr0-nic

Sixth, use virt-install generating .img file

# Virt-install --name = Ubuntu1 \
--ram 1024 --vcpus = 1 \
--disk path = / root / ubuntu1.img, size = 10 \
 --accelerate --cdrom /root/ubuntu-14.04-desktop-amd64.iso \
--graphics vnc, port = 5920 --network bridge = br0

If the following error message:

could not open disk image: Permission denied

Solution:

[Root @ localhost ~] # cat /etc/libvirt/qemu.conf | awk '{if ($ 0 ~ / ^ $ / & amp; & amp; $ 0 ~ / ^ # /!!) {Print $ 0}}'
vnc_listen = "0.0.0.0"
user = "root" // uncomment
group = "root" // uncomment
dynamic_ownership = 0 // uncommenting 1 to 0

dynamic_ownership = 0 // uncommenting 1 to 0

This step is done, the system files just fine.

Seven, start the virtual machine

If the following error message

[Root @ localhost ~] # virsh start ubuntu1
Error: Field has been active

Solution:

[Root @ localhost ~] # pkill qemu-kvm
  
[Root @ localhost ~] # virsh start ubuntu1
Domain has started ubuntu1
  
[Root @ localhost ~] # virt-viewer ubuntu1 // into the graphical interface
     
         
       
         
  More:      
 
- Python kills corresponding process according to pid (Programming)
- Ubuntu deployment Flask + UWSGI + Nginx Comments (Server)
- Python basis: os module on the file / directory using methods commonly used functions (Programming)
- Ubuntu 15.04 using the Eclipse 4.4, Java 8 and WTP (Linux)
- Ubuntu update bug fixes Daquan (Linux)
- CoreOS use register mirror to build private warehouse (Linux)
- Linux security concerns again (Linux)
- Bash command substitution (Programming)
- dmidecode command Detailed (Hardware information) (Linux)
- ethtool command Detailed (Linux)
- Linux basic introductory tutorial ---- simple text processing (Linux)
- Ubuntu 14.04 after the restart the default maximum screen brightness solutions (Linux)
- When Vim create Python scripts, vim autocomplete interpreter and encoding method (Programming)
- Installing PHP Memcache extension under Linux (Server)
- How to install Virtualbox 4.3.20 in Ubuntu 14.04 (Linux)
- Windows SmartGit installation (Linux)
- Ubuntu Linux Change the PATH (Linux)
- Do not find ifconfig eth0 and IP address under CentOS6.5 (Linux)
- Java Foundation - Variables and data types (Programming)
- Android engineers interview questions (Programming)
     
           
     
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.