Compiling the current release of vde2-2.2.2 gives compilation errors due to a missing macro variable in the code. I’ve done a dirty hack to get it compiled but haven’t tested to know if the hack has any side effects. It seems like a simple enough hack so I decided I’d write a post about it anyway as I’ve been seeing quite a bit of queries about vde networking.
It doesn’t seem like a lot of linux distributions provide vde as a package so the best way to get access to the code is to get it directly from the official soureforge.net link that can be found here at sourceforge. The current version 2.2.2, however, will not compile so I’ve included my hacked version at the bottom of this post which should successfully compile. The compilation error has already been submitted to the project’s bug tracking so hopefully it will be fixed by the maintainers soon. The patch for the hacked version is listed below and also included as a file at the end of this post.
diff --git a/src/kvde_switch/consmgmt.c b/src/kvde_switch/consmgmt.c index bde7fea..491e3c4 100644 --- a/src/kvde_switch/consmgmt.c +++ b/src/kvde_switch/consmgmt.c @@ -32,6 +32,7 @@ #include "../vde_switch/switch.h" #include "sockutils.h" #include "consmgmt.h" +#include "../slirpvde/tcp2unix.h" #define MAXCMD 128 diff --git a/src/kvde_switch/datasock.c b/src/kvde_switch/datasock.c index 53311c8..4758f4c 100644 --- a/src/kvde_switch/datasock.c +++ b/src/kvde_switch/datasock.c @@ -34,6 +34,7 @@ #include "../vde_switch/switch.h" #include "sockutils.h" #include "consmgmt.h" +#include "../slirpvde/tcp2unix.h" /* will be inserted in a af_ipn.h include */ #ifndef AF_IPN diff --git a/src/slirpvde/tcp2unix.h b/src/slirpvde/tcp2unix.h index 62a6042..af1be54 100644 --- a/src/slirpvde/tcp2unix.h +++ b/src/slirpvde/tcp2unix.h @@ -9,6 +9,10 @@ #define UNIX_PATH_MAX 108 #endif +#ifndef PATH_MAX +#define PATH_MAX 108 +#endif + extern int tcp2unix_check; void tcp2unix_add(int port,char *path); diff --git a/src/vde_plug2tap.c b/src/vde_plug2tap.c index 75e6aee..22d2e28 100644 --- a/src/vde_plug2tap.c +++ b/src/vde_plug2tap.c @@ -23,6 +23,7 @@ #include <vde.h> #include <vdecommon.h> #include <libvdeplug.h> +#include "slirpvde/tcp2unix.h" #define BUFSIZE 2048 diff --git a/src/wirefilter.c b/src/wirefilter.c index 7a8159a..c996e0b 100644 --- a/src/wirefilter.c +++ b/src/wirefilter.c @@ -36,6 +36,7 @@ #include <vde.h> #include <vdecommon.h> #include <libvdeplug.h> +#include "slirpvde/tcp2unix.h" #if defined(VDE_DARWIN) || defined(VDE_FREEBSD) # include <limits.h>
If you’re more familiar with the vde project and see any issues with these patches feel free to post a comment about it.
Compiling the libraries is a short simple process. Begin by untarring the archive, in this case the patched version.
Next run the configure script, then make and make install commands as shown below.
./configure make make install
The install will create files and directories under /usr/local. You can verify your vde libraries by listing the contents of the /usr/local/lib and /usr/local/lib/vde2 directories. It should look like the following.
ll /usr/local/lib total 448 -rw-r--r-- 1 root root 78978 2008-08-18 14:24 libvdemgmt.a -rwxr-xr-x 1 root root 841 2008-08-18 14:24 libvdemgmt.la lrwxrwxrwx 1 root root 19 2008-08-18 14:24 libvdemgmt.so -> libvdemgmt.so.0.0.1 lrwxrwxrwx 1 root root 19 2008-08-18 14:24 libvdemgmt.so.0 -> libvdemgmt.so.0.0.1 -rwxr-xr-x 1 root root 57848 2008-08-18 14:24 libvdemgmt.so.0.0.1 -rw-r--r-- 1 root root 66772 2008-08-18 14:24 libvdeplug.a -rwxr-xr-x 1 root root 841 2008-08-18 14:24 libvdeplug.la lrwxrwxrwx 1 root root 19 2008-08-18 14:24 libvdeplug.so -> libvdeplug.so.2.1.0 lrwxrwxrwx 1 root root 19 2008-08-18 14:24 libvdeplug.so.2 -> libvdeplug.so.2.1.0 -rwxr-xr-x 1 root root 50745 2008-08-18 14:24 libvdeplug.so.2.1.0 -rw-r--r-- 1 root root 86722 2008-08-18 14:24 libvdesnmp.a -rwxr-xr-x 1 root root 841 2008-08-18 14:24 libvdesnmp.la lrwxrwxrwx 1 root root 19 2008-08-18 14:24 libvdesnmp.so -> libvdesnmp.so.0.0.1 lrwxrwxrwx 1 root root 19 2008-08-18 14:24 libvdesnmp.so.0 -> libvdesnmp.so.0.0.1 -rwxr-xr-x 1 root root 58874 2008-08-18 14:24 libvdesnmp.so.0.0.1 drwxr-xr-x 3 root root 4096 2008-08-18 14:24 vde2
Below shows contents of /usr/local/lib/vde2
ll /usr/local/lib/vde2/ total 52 -rw-r--r-- 1 root root 22704 2008-08-18 14:24 libvdetap.a -rwxr-xr-x 1 root root 830 2008-08-18 14:24 libvdetap.la -rwxr-xr-x 1 root root 19982 2008-08-18 14:24 libvdetap.so drwxr-xr-x 2 root root 4096 2008-08-18 14:24 vde_l3
Your libraries are now ready to be used natively by KVM.
Now that you have the vde libraries installed you can link the vde code directly into kvm when compiling your kvm module as outlined in this post about enabling vde support in kvm . Note that patches have already been submitted to KVM so that in future versions beginning with KVM-73 there will be no need for using the –enable-vde flag such that vde will be enabled by default once the libraries are detected.
| Attachment | Size |
|---|---|
| vde2-2.2.2-pathpatch.tar.gz | 664.14 KB |
| path-patch.txt | 1.79 KB |
Comments
VDE
Tuesday, August 19, 2008 - 16:24 Rodd Ahrenstorff (not verified)I've been following kvm and using kvm in a test environment (compiling source on Ubuntu 8.04), but maybe you could explain how VDE would benefit the end-user and provide an example of usage for a production deployment.
As a relative newcomer to kvm, I'm still a bit confused by some things: PCI-passthrough, VT-d, Virtio, VDE, paravirtual network drivers, etc...
The rapid pace of development with kvm has left some of us in the dark regarding the above items. For example; a laymens description of what/when/where/how are these features utilized in a kvm environment would be most useful.
I appreciate your efforts to promote kvm and wish you the best.
Rodd Ahrenstorff
VDE usage
Tuesday, August 19, 2008 - 17:37 Haydn SolomonHi Rodd,
Firstly, thank you very much for your well wishes and I hope that this site can benefit you in understanding more about kvm.
I can uderstand how you might be confused with all the options and different types of networking in kvm; manaagement of virtual machines in general is a challenge so you're not alone. I will not go into the different options about virtio, vt-d etc but answer your question specific to vde usage.
The biggest benefit to vde compared to other modes of networking can be summed up in one word: flexibility. It allows you to setup networking across different machines such that you can have vlans spanning across different physical machines. However, it is doesn't provide the best performance compared to virtio, bridged netwoking etc. I've heard of opensource cloud computing solutions using vde but even in those situations, network performance is not a goal. The bottom line is that if performance is critical, then vde does not apply. It will probably be used mostly in lab environments right now and there's not a lot of literature out there on it at the moment.
Hope this helps
Re: VDE usage
Wednesday, August 20, 2008 - 03:45 Jacques Landru (not verified)Hi,
I agree that VDE is neat, and that the biggest benefit is flexibility. Vlans spanning across different machines on remote sites through SSH ou UDP encrypted tunnel is really an interesting feature. For me the main drawback compared to bridged networking with "bridgeutils" utility is with VDE you can't directly connect the VMs on our real LAN, you need to NAT your VMs through the host to reach your real LAN. On the VDE forum, a contributor, told it's in the TODO list, and at the moment we can mix VDE and bridgeutils switchs; but then you have two type of virtual switch to manage.
Regards
Jacques Landru
VDE attached files added
Wednesday, August 20, 2008 - 15:21 Haydn SolomonI just realized that users were not able to view the attached files at the end of this post. Anonymous and authenticated users are now able to view and download the files.
VDE connecting to real LAN
Thursday, August 21, 2008 - 18:05 Haydn SolomonHi Jacques
I checked out the forum at VDE and saw your exchange about connecting VDE to real LAN. Seems there is a solution, just takes a bit of work. The exchange can be found at the link below.
forum exchange on connecting VDE to real LAN
Compile error already fixed
Tuesday, August 26, 2008 - 05:42 Anonymous (not verified)Compile error already fixed, There are 4 files need to be changed!
please refer to http://sourceforge.net/tracker/index.php?func=detail&aid=2023790&group_i...
Thanks for the link.
Tuesday, August 26, 2008 - 07:36 Haydn SolomonThanks for the link.
Post new comment