Installing KVM (Debian) on VMware

Source: Internet
Author: User

KVM Full Name (kernel-based virtual machine) is an open source system virtualization module that is integrated into the major distributions of Linux since Linux 2.6.20. It is managed using Linux's own scheduler, so its core source code is few compared to Xen. KVM has become one of the mainstream VMM in academia today. KVM Virtualization requires hardware support (such as Intel VT Technology or AMD V technology). is hardware-based full virtualization. The early days of Xen were software-based simulations of para-virtualization, and the new version was full virtualization based on hardware support. But Xen itself has its own process scheduler, storage Management module, etc., so the code is rather large. The widely circulated business system virtualization software VMware ESX series is a software-based simulation of the full-virtualization. I. Basic Environment 1, version cat/etc/debian_version 7.82, kernel uname-r3.2.0-4-amd643, involving ip10.1.10.117 (debian7.8) 10.1.10.131 (Windows) 4, Virtual machine VMware 11 Memory 1G, KVM Install 1, open support virtualization in VMware Settings select Intel Vt-x/ept or Amd-v/rvi on this side of the virtualization engine and tick in the second box

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/E3/wKioL1WLSrWiYoHqAAIOve2eoWk069.jpg "title=" Bbb.png "alt=" Wkiol1wlsrwiyohqaaiove2eowk069.jpg "/>

2, after entering the system to see if support egrep ' (VMX|SVM) '--color/proc/cpuinfo

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6E/E3/wKioL1WLS0WT3s3qAAG1ykwDoo0726.jpg "title=" Aaa.jpg "alt=" Wkiol1wls0wt3s3qaag1ykwdoo0726.jpg "/>

See a VMX description of the hardware support KVM installation
3. Install the required package for KVM and see if the KVM module is loaded successfully 1) install package apt-get -y install libvirt-binapt-get -y install  bridge-utils apt-get -y install qemu-kvmapt-get -y install  VIRTINSTPS: Related Package Description libvirt-bin - programs for the libvirt librarybridge-utils  - utilities for configuring the linux ethernet bridge (Brctl Bridge command) QEMU-KVM  - full virtualization on x86 hardwarevirtinst - programs to  create and clone virtual machines (Virt-install virt-clone and other commands) 2) See if the KVM module is loaded successfully lsmod |grep kvmkvm_intel              122053  3 kvm           &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;291965&NBSP;&NBSP;1&NBSP;KVM_INTEL4, configure network 1) View current bridging conditions Brctl  showbridge name    bridge&nBSP;ID&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;STP&NBSP;ENABLED&NBSP;&NBSP;&NBSP;&NBSP;INTERFACES2) Modify Configuration Cat /etc/network/interfaces# this file describes the network interfaces  available on your system# and how to activate them. for  more information, see interfaces (5) .# the loopback network  interfaceauto loiface lo inet loopback# the primary network interface# allow-hotplug eth0#auto eth0  #iface  eth0 inet static  #address   10.1.10.117  #netmask  255.255.255.0  #gateway  10.1.10.254auto br0iface br0  inet staticaddress 10.1.10.117netmask 255.255.255.0gateway 10.1.10.254bridge_ports  ETH0BRIDGE_STP&NBSP;OFFBRIDGE_WAITPORT&NBSP;0BRIDGE_FD&NBSP;03) Use the Ifup command to start the BR0 network Port ifup br0waiting for  a max of 0 seconDs for eth0 to become available. waiting for br0 to get ready  (Maxwait is 2 seconds). 4) View the bridging situation again brctl showbridge name    bridge id         STP enabled    interfacesbr0       &NBSP;&NBSP;8000.000C29C887A1&NBSP;&NBSP;&NBSP;&NBSP;NO&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;ETH05) Modify kernel parameters and make permanent effective at/etc/sysctl.conf add to last net.bridge.bridge-nf-call-ip6tables =  0net.bridge.bridge-nf-call-iptables = 0net.bridge.bridge-nf-call-arptables = 0sysctl  -pnet.bridge.bridge-nf-call-ip6tables = 0net.bridge.bridge-nf-call-iptables =  0NET.BRIDGE.BRIDGE-NF-CALL-ARPTABLES&NBSP;=&NBSP;05, create disk image file 1) Create directory MKDIR&NBSP;/OPT/KVMIMAGE&NBSP;-P2) Use the QEMU-IMG command to create a qemu-img create -f raw /opt/kvmimage/debian7.raw 10gformatting  '/ Opt/kvmimage/debian7.rAw ',  fmt=raw size=10737418240 3) view Qemu-img info /opt/kvmimage/debian7.raw image:  /opt/kvmimage/debian7.rawfile format: rawvirtual size: 10G  (10737418240  bytes) disk size: 06, using Virt-install command to create the System 1) virt-install --virt-type kvm --name  debian7 --ram 256 --vcpus=1 --cdrom=/opt/debian-7.8.0-amd64-cd-1.iso --network  Bridge=br0 --graphics vnc,listen=10.1.10.117,port=5900 --noautoconsole --os-type=linux  --disk path=/opt/kvmimage/debian7.raw --debug[thu, 21 may 2015 00:44:16  virt-install 2599] DEBUG  (cli:226)  launched with command line:/usr/ bin/virt-install --virt-type kvm --name debian7 --ram 256 --vcpus=1 -- cdrom=/opt/debian-7.8.0-amd64-cd-1.iso --network bridge=br0 --graphics vnc,listen= 10.1.10.117,port=5900 --noaUtoconsole --os-type=linux --disk path=/opt/kvmimage/debian7.raw --debug[thu, 21  May 2015 00:44:16 virt-install 2599] DEBUG  (cli:332)  Requesting  libvirt uri default[thu, 21 may 2015 00:44:16 virt-install 2599]  debug  (cli:334)  received libvirt uri qemu:///system[thu, 21 may 2015  00:44:16 virt-install 2599] DEBUG  (virt-install:259)  Requesting virt  method  ' default ', hv type  ' KVM '. [thu, 21 may 2015 00:44:16 virt-install 2599] debug  (virt-install:469)  Received virt method  ' HVM ' [thu, 21 may 2015 00:44:16  virt-install 2599] debug  (virt-install:470)  Hypervisor name is  ' KVM ' [Thu,  21 May 2015 00:44:16 virt-install 2599] DEBUG  (distroinstaller:210)  distroinstaller location is a local file/path: /opt/ debian-7.8.0-amd64-cd-1.iso[thu, 21 may 2015 00:44:16 virt-install 2599]  debug  (virt-install:623)  guest.has_install_phase: truestarting install ... [thu, 21 may 2015 00:44:17 virt-install 2599] debug  (virt-install:707)  Domain state after install: 1Domain installation still in  progress. you can reconnect to the console to complete the  Installation process. Parameter Description:--name           New customer virtual machine instance name--virt-type      type--ram             Specify the memory size assigned to the virtual machine in M--vcpus          Virtual CPU number of virtual machines--CDROM&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; corresponds to a fully virtualized client, the file or device is used as a virtualized CD-ROM device, can be an ISO image path or a CDROM device, or it can be a url--network   that extracts/accesses a minimal boot ISO image       connecting the client to the host network--graphics       Set up a virtual Console in the client computer and export it as a VNC service--noautoconsole  Use this option to specify that you do not automatically attempt to connect to the client console--os-type         Configuring--disk path      Client Storage for a class of operating system optimized virtual machines 2) View KVM process ps aux|grep  kvmroot        580  0.0  0.0       0     0 ?        S<    00:15   0:00 [kvm-irqfd-clean]103         5990 29.0  1.9 527476 20220 ?         sl   08:34   0:01 /usr/bin/kvm -s -m pc-1.1  -enable-kvm -m 256 -smp 1,sockets=1,cores=1,threads=1 -name debian7 -uuid 576f2558-10c5-670a-0013-d0f8297de467 - no-user-config -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/ Debian7.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=control -rtc base= utc -no-reboot -no-shutdown -device piix3-usb-uhci,id=usb,bus=pci.0,addr=0x1.0x2 - drive file=/opt/kvmimage/debian7.raw,if=none,id=drive-ide0-0-0,format=raw -device ide-hd,bus= ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0,bootindex=2 -drive file=/opt/ debian-7.8.0-amd64-cd-1.iso,if=none,id=drive-ide0-1-0,readonly=on,format=raw -device ide-cd,bus= Ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0,bootindex=1 -netdev tap,fd=20,id=hostnet0 -device  rtl8139,netdev=hostnet0,id=net0,mac=52:54:00:23:b3:c2,bus=pci.0,addr=0x3 -chardev pty,id= Charserial0 -device isa-serial,chardev=charserial0,iD=serial0 -vnc 10.1.10.117:0 -vga cirrus -device virtio-balloon-pci,id=balloon0, bus=pci.0,addr=0x4root       5999  0.0  0.0       0     0 ?         S<   08:34   0:00 [kvm-pit-wq]root        6004  0.0  0.0   7836   880 pts/0  &NBSP;&NBSP;&NBSP;S+&NBSP;&NBSP;&NBSP;08:34&NBSP;&NBSP;&NBSP;0:00&NBSP;GREP&NBSP;--COLOR=AUTO&NBSP;KVM3) View KVM Port netstat -tupnl|grep kvmtcp        0       0 10.1.10.117:5900        0.0.0.0:*                LISTEN     &NBSP;&NBSP;2662/KVM&NBSP;4) enablesUse Virsh to view machine list and status        virsh --connect qemu:///system list  --all Id    Name                             State---------------------------------------------------- 1     debian7                     &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;RUNNING5) Running Status Description running   the virtual machine is running on the CPU idel      The virtual machine is idle, not running, while waiting for IO or hibernation when the virtual machine enters this state paused    the VM is in a paused state and is normally run by admin virsh    Suspend is in this state, but still consumes resources, but is not dispatched by the super-hypervisor. shutdown  Virtual machine shut off  virtual machine is not running during shutdown, crashed   virtual machine crashes completely shut down dying     The virtual machine is in a dying state, but not completely shut down or crashed  6) view the new virtual machine basic information VIRSH&NBSP;DOMINFO&NBSP;DEBIAN7ID:&NBSP;&NBSP;&NBSP;&NBSP;&Nbsp;        2name:            debian7UUID:            576f2558-10c5-670a-0013-d0f8297de467os type:        hvmstate: &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;RUNNINGCPU (s):          1CPU time:       1.7sMax memory:      262144 KiBUsed memory:    262144 KiBPersistent:      yesAutostart:      disableManaged save:    no three, Client connection 1, first view vncvirsh vncdisplay debian710.1.10.117:02, Windows (10.1.10.131) 1) installation software TightVNC  version 2.7.7

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6E/E6/wKiom1WLSsHjai7dAAGK8qWXV40136.jpg "title=" Ddd.png "alt=" Wkiom1wlsshjai7daagk8qwxv40136.jpg "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/E3/wKioL1WLTI6igEczAAJxBQfKZqc637.jpg "title=" Ccc.png "alt=" Wkiol1wlti6igeczaajxbqfkzqc637.jpg "/>

Iv. results after installation is complete

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/E6/wKiom1WLSuyw4LXnAAJUXoa2r8w484.jpg "title=" Eee.png "alt=" Wkiom1wlsuyw4lxnaajuxoa2r8w484.jpg "/>

V. Reference article http://xmodulo.com/use-kvm-command-line-debian-ubuntu.htmlhttp://wiki.libvirt.org/page/Networking


This article is from the "7928217" blog, please be sure to keep this source http://7938217.blog.51cto.com/7928217/1665296

Installing KVM (Debian) on VMware

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.