Installing Openvswitch and KVM on CentOS 6.2

Installing Openvswitch and KVM on CentOS 6.2

Open Vswitch Lab

Installing Openvswitch and KVM on CentOS 6.2
Please see the updated how-to on Installing OpenvSwitch on CentOS.

This is all (mostly) covered in the INSTALL.Linux inside the tar. This might help folks with some of the


Download and Install Open vSwitch

add yum -y install openssl-devel this package is necessary if you use SSL with OpenVSWitch. (Thanks for input Marcos)

The Open vSwitch datapath requires bridging support (CONFIG_BRIDGE) to be built as a kernel module.  (This is common in kernels provided by Linux distributions.)  The bridge module must not be loaded or in use. If the bridge module is running (check with “lsmod | grep bridge”), you must remove it (“rmmod bridge”) before starting the datapath.

To build the Linux kernel module, so that you can run the kernel-based switch, pass the location of the kernel build directory on –with-linux.  For example, to build for a running instance of Linux:

Verify the kernel mod loaded

If everything compiles and install create the sockets and db.

Setup the networking component by moving the IP off the physical interface to the new bridge interface

Installing and Integrating KVM into Open vSwitch

*Note* KVM is no longer supported on 32-bit HW.

KVM GUI management tool

Start the libvert daemon or reboot the system.

Start the KVM GUI

KVM Virt-Manager

See the updated Install at the top for accurate information!

  1. Gene PooleGene Poole05-07-2012

    OK, Waiting on Part 2! I’m planning on use this to build a 2 host cluster running CentOS 6.2 with KVM. Doing what you have got here, what else do I need and should I just wait?

    • Brent SalisburyBrent Salisbury05-07-2012

      Oh man, I must have missed that lol. I will work on it later this week. I get so annoyed with the Yum repository its hard force myself to come out of Ubuntu. I used to love RH back in the day to 🙁 That said oVirt looked pretty cool that was released a a couple months ago have you tried it? KVM + oVswitch later this week.

    • Brent SalisburyBrent Salisbury05-07-2012

      Or try backing off the Swig version in the meantime. Curious what distro you have if you get a second.

  2. Marcos AmorimMarcos Amorim07-02-2012

    Please, add yum -y install openssl-devel this package is necessary if you use SSL with OpenVSWitch.

    Great article, congrats

    • Brent SalisburyBrent Salisbury07-03-2012

      Thanks Marcos. Appreciate the feedback. I need to clean this post up. I haven’t done much in RedHat lately. Have you tried oVirt with OpenvSwitch yet? Last time I visited it had just released. I guess I’ve turned into an OpenStack junky. lol.

  3. Carlo SantosCarlo Santos10-02-2012


    I am currently trying out the instructions you have posted here but I am encountering this error on a CentOS 6.2:

    configure: error: source dir /lib/modules/2.6.32-220.el6.x86_64/build doesn’t exist

    The build folder can be found in the same location mentioned above but it is only a symbolic link of the folder /usr/src/kernels/`uname -r`.

    How do I solve this issue?

    • ssedanossedano10-20-2012

      If after the installation of the kernel-devel package the issue persists. That is due a misconfiguration of the kernel-devel package. A simple and fast solution is to re-link to the actual sources. I mean, just re-link to /usr/src/kernels/[your_kernel]. Only the build link, source is a link to build.

    • StudentXStudentX03-19-2014

      Carlo, did you solve that problem? I am having that problem too

  4. JayJay10-10-2012

    Carlo, you can resolve that issue by installing the kernel-devel package

  5. JayJay10-10-2012

    I recieve the following error while building kernel modules:

    make -C /lib/modules/2.6.32-279.9.1.el6.x86_64/build M=/usr/src/openvswitch-1.7.1/datapath/linux modules
    make[4]: Entering directory `/usr/src/kernels/2.6.32-279.9.1.el6.x86_64′
    CC [M] /usr/src/openvswitch-1.7.1/datapath/linux/genetlink-brcompat.o
    In file included from /usr/src/openvswitch-1.7.1/datapath/linux/compat/include/linux/netlink.h:4,
    from /usr/src/openvswitch-1.7.1/datapath/linux/compat/include/net/genetlink.h:5,
    from /usr/src/openvswitch-1.7.1/datapath/linux/compat/,
    from /usr/src/openvswitch-1.7.1/datapath/linux/genetlink-brcompat.c:10:
    /usr/src/openvswitch-1.7.1/datapath/linux/compat/include/linux/skbuff.h:242: error: redefinition of ‘skb_frag_page’
    include/linux/skbuff.h:1612: note: previous definition of ‘skb_frag_page’ was here

  6. Brent SalisburyBrent Salisbury10-10-2012

    Hi guys, I will do an update next week for CentOS. I have been tunnel visioned on Ubuntu lately with other things. Will get it out this weekend.

  7. JayJay10-10-2012

    I was able to resolve the previous issue (specific to CentOS 6.3) by editing datapath/linux/compat/include/linux/skbuff.h and commenting out the following:

    #if LINUX_VERSION_CODE page;

    Thank god for google translate:

  8. JayJay10-10-2012

    I was able to resolve the pre­vi­ous issue (spe­cific to Cen­tOS 6.3) by edit­ing datapath/linux/compat/include/linux/skbuff.h and com­ment­ing out the following:

    //static inline struct page *skb_frag_page(const skb_frag_t *frag)
    // return frag-&gtpage;

    Thank god for google trans­late:

  9. RizwanRizwan11-26-2012

    @Jay, where did you find the file: datapath/linux/compat/include/linux/skbuff.h
    I have looked everywehre but can’t figure out where to find this file, i have similar problem and build directory in my running kernel src directory does not exist, what should i do??