KVM virt-manager: Install CentOS As Guest Operating System

Now, you have installed the KVM software and required drivers on the host operating systems. You also configured bridged based networking which will provide direct access to the Internet. It is time to create your first guest operating systems. For demonstration purpose you will install CentOS Linux v5.5 using the Internet using virt-manager GUI tool.

The virt-manager is the easiest way to install guest operating system using CDROM or Internet. It is a a desktop tool for managing virtual machines. It provides the ability to control the lifecycle of existing machines (bootup/shutdown,pause/resume,suspend/restore), provision new virtual machines, manage virtual networks, access the graphical console of virtual machines, and view performance statistics. You need to use this tool locally or remotely over the ssh session.

Step # 1: Download CentOS Linux Network Installation CD

Visit the official website and grab CentOS network installation disk and store it in /opt or /tmp directory. The wget command can be used to download an ISO file quickly:
# cd /tmp
# wget http://mirrors.hns.net.in/centos/5.5/isos/x86_64/CentOS-5.5-x86_64-netinstall.iso

Step #2: Creating CentOS Linux Guests With virt-manager

Type the following command at local server
# virt-manager
OR run virt-manager remotely over the ssh session, enter:
# ssh -X -C root@kvmserver42.nixcraft.in
# virt-manager

Sample outputs:

Fig.01: Creating A Virtualized Guest With virt-manager GUI Tool

Next, click the New button to create a new guest and just follow on screen instructions. The following is the wizard based installation procedure:

Fig.02: New guest wizard to install CentOS Linux

Fig.03: Name the KVM virtual machine

Fig.04: Define virtualization method (full virtualization due to Intel VT)

Fig.05: Define installation method (CDROM/Network/HTTP/NFS etc)

Fig.06: Local media installation via CDROM or ISO image

Fig.07: KVM Storage setup (network iscsi/nfs must be mounted or local or block disk)

Fig.08: KVM Set Virtual network (NAT) or Shared physical device (bridge br0 or br1)

Fig.09: KVM Guest VM Memory and CPU Allocation Setup

Fig.10: KVM VM setup done and you can start guest installation

Within minutes you will see a vnc window and with guest operating system installation process as follows:

Fig.11: KVM - guest operating system installation procedures started using vnc

Now, just follow on screen installation instructions and install CentOS as per your requirements. The above procedure can be repeated for MS-Windows, OpenBSD, FreeBSD and all other supported guest operating systems.

🐧 Please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on Linux, Open Source & DevOps via:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
16 comments… add one
  • Ashley Oct 8, 2010 @ 16:57

    Hmm, running this on Ubuntu 10.04 as host. Get as far as Installation method during the CentOS install and we stop. Choose Local CDRom and it can’t find it. Choose Hard Drive and only the new virtual drives are seen – cannot see host machine drives to pick up the ISO file from.

    (That’s apart from the fact that on Ubuntu a lot of the virtualisation option screens don’t match up to your images – but that’s only a by the by.)

    • 🐧 nixCraft Oct 8, 2010 @ 17:26

      Ubuntu host has an updated cutting edge version of KVM so images will not match exactly. This tutorial is tested and used on RHEL / CentOS based systems only. Having said that there should not be *any problem* for installing Debian or Ubuntu as host and any guest. Just put your centos guest cd/dvd into actual drive and click on use CDROM/DVD option > Forward and it should work. If you’ve more question I suggest you use our forum @ nixcraft.com.

  • Ashley Oct 8, 2010 @ 19:38

    Erm yes. I was rather trying to avoid having to burn the iso onto disc. Which is why I was interested in your article. Thanks anyway

    • Thomas Schweikle Oct 18, 2010 @ 11:36

      Just copy your bootable iso-images into /var/lib/libvirt/images they’ll show up and are accessible while creating a new VM.

  • Khan Md Ashraf Oct 27, 2010 @ 3:11

    Thanks for the great KVM HOWTO.
    I have a few questions to ask.
    I am running CentOS 5.5 x86_64 on a HP Blade . I have installed all the KVM packages as detailed in your HOWTO. But the host shows me a booted xen kernel. Linux 2.6.18-194.17.1.el5xen #1 SMP Wed Sep 29 13:30:21 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
    Also virt-manger shows me a running instance of a xen guest Domain-0. On trying to create a new virtual instance I am allowed only a paravirtualised instance and not a fully virtualised one since virt-manger claims that the hardware does not support full virtualisation.
    The CPU is a Intel(R) Xeon(R) CPU E5310 @ 1.60GHz Quad Core
    The output of grep vmx /proc/cpuinfo is “fpu tsc msr pae cx8 apic mtrr cmov pat clflush acpi mmx fxsr sse sse2 ss ht syscall lm constant_tsc pni vmx ssse3 cx16 lahf_lm”
    All help appreciated

    • Khan Md Ashraf Oct 27, 2010 @ 14:30

      I figured what was wrong after pursuing the issue on googacle :)
      First time setting up virtualisation. Done it with virtualbox only till date.
      KVM does not need a specialised kernel like Xen does. It runs off the mainline kernel.
      This article clued me in on that http://blog.codemonkey.ws/2008/05/truth-about-kvm-and-xen.html
      My installation was booting the xen kernel and therefore I was having above issues.
      So I edited my /boot/grub/menu.lst to boot the mainline kernel and in virt-manager I deleted the Xen connection.
      Restarted virt-manager and am ready to go.

  • Khan Md Ashraf Oct 31, 2010 @ 11:53

    Still stymied. This processor even though it supports virtualisation at the hardware level seems to have a problem with/within the kernel. I have no idea about this. I am unable to setup full virtualisation of any sort. Even VirtualBox claims it can run only a 32bit OS and not the 64bit that I want to.

    • Andrew Dec 9, 2011 @ 10:55

      I know this is an old thread, but for the benefit of others, I would suggest that you need to enable virtualisation in the BIOS

      • cod3fr3ak Feb 8, 2012 @ 4:15

        Yep. Two things:
        1. Make sure you are using the mainline kernel.
        2. Make sure your bios has the virtualization bits set.

        I ran into the same issue when i started playing a few months back.

  • harry Mar 21, 2011 @ 4:47

    I cant run virt-manager remotely over the ssh session, I tried :
    # ssh -X -C root@kvmserver42.nixcraft.in
    # virt-manager
    but I rece’ error msg stating
    root@ubox:~# virt-manager
    ERROR:root:Unable to initialize GTK: could not open display
    Traceback (most recent call last):
    File “/usr/share/virt-manager/virt-manager.py”, line 413, in
    File “/usr/share/virt-manager/virt-manager.py”, line 289, in main
    raise RuntimeError(_(“Unable to initialize GTK: %s”) % str(e))
    RuntimeError: Unable to initialize GTK: could not open display
    Traceback (most recent call last):
    File “/usr/share/virt-manager/virt-manager.py”, line 420, in
    _show_startup_error(str(run_e), “”.join(traceback.format_exc()))
    File “/usr/share/virt-manager/virt-manager.py”, line 61, in _show_startup_error
    import gtk
    File “/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py”, line 69, in
    File “/usr/lib/pymodules/python2.6/gtk-2.0/gtk/__init__.py”, line 57, in _init
    warnings.warn(str(e), _gtk.Warning)
    gtk.GtkWarning: could not open display
    am just a newbie, please guide !! host: Ubuntu 10.04 Desktop version guest1: ubuntu server guest2:win2k3 server

  • remco Mar 24, 2011 @ 17:20


    I have follow this howto and stuck on starting virt-manager i get a error:

    Traceback (most recent call last):
    File “/usr/share/virt-manager/virt-manager.py”, line 376, in ?
    _show_startup_error(str(run_e), “”.join(traceback.format_exc()))
    File “/usr/share/virt-manager/virt-manager.py”, line 52, in _show_startup_error
    import gtk
    File “/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py”, line 76, in ?
    File “/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py”, line 64, in _init
    RuntimeError: could not open display

    It seems a vnc error but yum install vnc gtk-vnc didn’t help?

    Some one know how to solved this issue?

    System centos 64bits 5.5


  • Anand Gupta Jun 22, 2011 @ 1:29


    Have you ever tried gluster based storage for VM files ? I have been trying to do so, however doesn’t seem to be working. DomU hangs when i try to do an install, and even kvm isn’t working

    gluster 3.2
    centos 5.6


  • scott Sep 1, 2011 @ 22:31


    I’m getting a ‘no hypervisor options available’ message in virt-manager under CentOS 6.

    Has anyone run in to that?

    I have an Intel i5 second gen proc.



  • lawrence Sep 9, 2011 @ 17:26

    Same issue when tried to run virt-manager, as shown below
    Traceback (most recent call last):
    File “/usr/share/virt-manager/virt-manager.py”, line 376, in ?
    _show_startup_error(str(run_e), “”.join(traceback.format_exc()))
    File “/usr/share/virt-manager/virt-manager.py”, line 52, in _show_startup_error
    import gtk
    File “/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py”, line 76, in ?
    File “/usr/lib64/python2.4/site-packages/gtk-2.0/gtk/__init__.py”, line 64, in _init
    RuntimeError: could not open display

    Any help is very much appreciated.


    • cod3fr3ak Feb 8, 2012 @ 4:17

      Are you trying to access a headless box?

      If so, you need to forward your display. If you have windows, there is an app (free) called Xming.

  • Yuleisa Feb 7, 2012 @ 14:34

    I’m hianvg the same CD problem. I tried Anonymous’ add hardward solution. I can’t select ‘Normal Disk Partition’ as it is unavailable. I am running 64 bit if that helps.

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre> for code samples. Problem posting comment? Email me @ webmaster@cyberciti.biz