Tuesday, March 15, 2011

About qemu and VDE

 This post contains general notes on how to get VDE and qemu running on Ubuntu 10.4. In the future it will be broken up into separate posts when this one gets too long and technical.

VDE bits and pieces
VDE network consists of multiple tools:
  • vde_switch - creates a virtual switch
  • vde_plug, vde_plug2tap - for creating virtual cables
  • dpipe - two-directional pipe, connects I/O streams of multiple programs
  • vdeq, vdekvm (deprecated) 
Creating a VDE network
  1. Launching VDE switches
    •  vde_switch  -F -s path/to/vde/socket
  2. Connect VDE switches
    •  use vde_plug, vde_plug2tap, dpipe to connect different vde_switches on the same and/or different machine 
    • Adding qemu machines to the VDE network
      • add to qemu command:  -net nic,macaddr='unique macaddr' -net vde,sock=path/to/vde/socket   
      • configure network on the guest 

      Recompiling qemu package for Ubuntu
      Ubuntu repository (lucid) does not contain qemu with built in VDE support (discussion). That means that one has to compile qemu himself containing VDE support. Here's how I roughly did it based on this:

      #get dependencies and tools for building (clean system probably needs more tools and libs) 
      apt-get source qemu-kvm
      cd qemu-kvm*
      sudo sudo apt-get build-dep qemu-kvm
      sudo sudo apt-get install devscripts
      sudo dch -l local 'qemu-kvm package with vde support'
      #configure and build the sources into the package
      ./configure --enable-vde  
      debuild -us -uc
      # install new packages
      cd .. 
      sudo dpkg -i qemu_0.12.3+noroms-0ubuntu9.4local2_i386.deb
      sudo dpkg -i qemu-kvm_0.12.3+noroms-0ubuntu9.4*.deb
      sudo apt-get install qemu-common_0.12.3+noroms-0ubuntu9.4local2_all.deb
      sudo aptitude install vgabios seabios
      sudo dpkg -i qemu-common_0.12.3+noroms-0ubuntu9.4local2_all.deb





      Links


          1 comments:

          1. Thank you very mach for this useful article :) In ubuntu 11.10 to build qemu-kvm with VDE support you also need this:

            apt-get install libvdeplug2 libvdeplug2-dev

            ReplyDelete