TUTORIAL 9: INSTALLING and CONFIGURE KVM CentOS (LINUX)

Video is ready, Click Here to View ×


In this tutorial I will guide you through setting up KVM (virtual machines) with CentOS. I do have a couple of warnings the first one is this cannot be done with in a virtual machine so this will have to be installed and configured on an actual server. The second is you need a 64bit processor that supports virtualization. Virtual Machines are very nice and will allow you to take a single server and make multiple machines on it such as other servers that provide services or even a…

27 Comments

  1. 8:29 rmdir:failed to remove '/var/lib/libvirt/images/' : Directory not empty.

    10:29 gives
    Redirecting to /bin/systemctl status NetworkManager.service
    ● NetworkManager.service – Network Manager
    Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
    Active: active (running) since ma 2017-01-30 09:49:47 CET; 3h 41min ago
    Main PID: 848 (NetworkManager)
    CGroup: /system.slice/NetworkManager.service
    └─848 /usr/sbin/NetworkManager –no-daemon

  2. My server goes down after this one/
    virt-install –name=nameofvm –disk path=/var/lib/libvirt/images/vm1.img,siz­e=8 –ram=512 –os-type=linux –os-variant=rhel6 –network bridge:br0 –nographics –cdrom=/tmp/CentOS-6.4-x86_64-minimal.i­so
    it says allocating vm1.img
    any idea?

  3. hi Friends i´m trying to install KVM on centos 6.6. but now virt-manager doesn´t work. I get a message saying that: "unable to initialize gtk could not open display". i have installed everything xorg-x11-xauth. where i{m wrong

  4. Thank you for uploading the video. much appreciated.
    I have an issue with ifcfg-br0 file. once I make this and try to restart network it given an error "Restarting network (via systemctl):  Job for network.service failed. See 'systemctl status network.service' and 'journalctl -xn' for details. [FAILED]". If I delete ifcfg-br0 file, network restarts without problem. Kindly let me know the possible solution for the same.

  5. What if I want to run another VM and my concerns about its network configurations , should I need to create another file named :br1 same like you create br0 .

    Example :

    virt-install –name=nameofvm –disk path=/var/lib/libvirt/images/vm1.img,siz­e=8 –ram=512 –os-type=linux –os-variant=rhel6 –network bridge:br1 –nographics –cdrom=/tmp/CentOS-6.4-x86_64-minimal.i­so

  6. Hi Michael,

    First of all, thank you very much for the video you have uploaded on youtube on how to set up KVM on centos using SSH. Thats awesome!!! I have installed a centos vm under centos 6.5 using qemu. This is on a dedicated server at an ISP and everything went well. The issue is, the guest cannot access internet and users on internet cannot access the guest. However, the host can access the guest and vice versa. Host can access internet as well. I have been struggling with this for the last one week… can you please help me???

  7. Hi Michael,

    First of all, thank you very much for the video you have uploaded on youtube on how to set up KVM on centos using SSH. Thats awesome!!!

    I have installed a centos vm under centos 6.5 using qemu. This is on a dedicated server at an ISP and everything went well. The issue is, the guest cannot access internet and users on internet cannot access the guest. However, the host can access the guest and vice versa. Host can access internet as well.

    I have been struggling with this for the last one week… can you please help me???

    Thanks and regards,

  8. Ok got it running installed win 7 ultimate 64 bit on kvm, but now my static ip adress I setup originally for my centos server is not working I guess the bridge part on your tutorial screwed me up somehow. Help

  9. A few questions 1) How can I change input from the host to the guest once the minimal.iso is installed on the VM?

    The command "virsh list" shows that my dnsV-01 is running. When I use "ifconfig" after the installation my screen shows the host network configurations (br0, eth0, lo, virbr0, vnet0), unlike your screen which just shows the loopback that you then start configuring around 27:00. I am trying to follow your steps exactly, but I cannot get past this point after hours of research, I am sure the answer is simple but I am a noob.

    2) At this point we cannot use virt-manager or virt-viewer because we don't have graphics enabled correct?

    3) Is there a simple explanation for the following?  The "virsh shutdown dnsV-01" gives a message that the VM is shutting down but it never seems to shutdown because the "virsh list" command shows it running still.  Thank you for the great video.

  10. I tried LITERALLY for days to configure the networking to function on the virtual server that I built. Every "textual" tutorial didn't work until I cam upon this .. IT WORKED FLAWLESSLY!!! Being a Solaris admin with very little Linux knowledge,
    I understood the configuration of a "virtual" resource that is back ended by the physical one  ..but in Solaris on a Sparc T4 .. it's (IMHO) much easier to configure but then again that is where my strengths lie. I hope that Michael has more tutorials similar to this because they are easy to understand and follow and you can review and better understand what you're attempting as opposes to just "following steps"
    Thank you!!

  11. hi there,
    i have problem with my KVM virtual machine. i try config my server DL380 buy i take something error. When i try to call virsh console www i got a this:

    [root@ns1~]# virsh console www
    Connected to domain www
    Escape character is ^]
    Rebooting.

    Google, Inc.
    Serial Graphics Adapter 12/07/11
    SGABIOS $Id: sgabios.S 8 2010-04-22 00:03:40Z nlaredo $ (XXXXXXXX@XXXXXXXXXXXXXX.centos.org) Wed Dec 7 17:04:47 UTC 2011
    Term: 80×24
    4 0

    SeaBIOS (version seabios-0.6.1.2-28.el6)
    Machine UUID 1c2d68b5-0745-225c-5cfd-xxxxxxxxxxxxxxxxx

    gPXE (http://etherboot.org) – 00:03.0 C100 PCI2.10 PnP BBS PMM7FE0@10 C100

    Booting from Hard Disk…
    Boot failed: not a bootable disk

    Booting from ROM…
    gPXE (PCI 00:03.0) starting execution
    gPXE initialising devices…

    gPXE 0.9.7 — Open Source Boot Firmware — http://etherboot.org
    Features: HTTP DNS TFTP AoE iSCSI bzImage COMBOOT ELF Multiboot PXE PXEXT

    net0: XX:XX:XX:XX:XX:XX on PCI00:03.0 (open)
    [Link:up, TX:0 TXE:0 RX:0 RXE:0]
    Waiting for link-up on net0… ok
    DHCP (net0 XX:XX:XX:XX:XX:XX)…. ok
    net0: 192.168.XXX.XXX/255.255.255.0 gw 192.168.XXX.XXX
    No filename or root path specified
    No more network devices

    Booting from Floppy…
    Boot failed: could not read the boot disk

    No bootable device. Retrying in 60 seconds.

    [root@ns1~]#
    ————————————————————————————————————————-

    also i check my http://www.xml and i think this is ok

    [root@ns1~]# virsh dumpxml www
    <domain type='qemu' id='1'>
    <name>www</name>
    <uuid>1c2d68b5-0745-225c-5cfd-XXXXXXXXXXXX</uuid>
    <memory unit='KiB'>2097152</memory>
    <currentMemory unit='KiB'>2097152</currentMemory>
    <vcpu placement='static'>2</vcpu>
    <os>
    <type arch='x86_64' machine='rhel6.5.0'>hvm</type>
    <boot dev='hd'/>
    </os>
    <features>
    <acpi/>
    <apic/>
    <pae/>
    </features>
    <clock offset='utc'/>
    <on_poweroff>destroy</on_poweroff>
    <on_reboot>restart</on_reboot>
    <on_crash>restart</on_crash>
    <devices>
    <emulator>/usr/libexec/qemu-kvm</emulator>
    <disk type='file' device='disk'>
    <driver name='qemu' type='raw' cache='none'/>
    <source file='/var/kvm/images/www.img'/>
    <target dev='hda' bus='ide'/>
    <alias name='ide0-0-0'/>
    <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='ide' index='0'>
    <alias name='ide0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x1'/>
    </controller>
    <controller type='usb' index='0'>
    <alias name='usb0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
    </controller>
    <interface type='bridge'>
    <mac address='XX:XX:XX:XX:XX:XX'/>
    <source bridge='br0'/>
    <target dev='vnet0'/>
    <alias name='net0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
    <serial type='pty'>
    <source path='/dev/pts/1'/>
    <target port='0'/>
    <alias name='serial0'/>
    </serial>
    <console type='pty' tty='/dev/pts/1'>
    <source path='/dev/pts/1'/>
    <target type='serial' port='0'/>
    <alias name='serial0'/>
    </console>
    <input type='tablet' bus='usb'>
    <alias name='input0'/>
    </input>
    <memballoon model='virtio'>
    <alias name='balloon0'/>
    <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
    </memballoon>
    </devices>
    <seclabel type='none'/>
    </domain>

    [root@ns1~]#

    ————————————————————————————————————————
    also i check my IMG file

    -rwxr-xr-x. 1 qemu qemu 32212254720 Dec 9 04:19 http://www.img

    i don't know why can't boot my img file. i try config my server from http://www.server-world.info/

    thanks a lot for your time.

Leave a Reply

Your email address will not be published.


*