[Libvir] [PATCH] Compile libvirt under Windows (Cygwin)

Richard W.M. Jones rjones at redhat.com
Sat Nov 24 14:23:01 UTC 2007

The following patchset allows an incomplete compilation of libvirt under
Windows using Cygwin.  Current limitations are:

(1) Xen driver does not work.  This is not an important limitation
because Windows cannot act as dom0 in a Xen hypervisor anyway (or if it
can, it's not a very common configuration).

(2) QEMU driver / libvirtd cannot be compiled.  It's probably not too
hard to fix this.  The major area of concern is networking, in
particular the very Linux-specific code in src/bridge.c.

(2b) I have assumed for the purposes of (2) above that ./configure
--without-qemu also disables libvirtd (server) support.  QEMU and
libvirtd are too entangled at the moment.

(3) Cygwin is required.  In other words, there is no true native
compilation using VC++ or anything like that.  However you still get
*.exe files, so maybe this isn't an important limitation.

Attached is a screenshot showing virsh being used to list QEMU instances
over a TLS-encrypted remote connection.

To compile this yourself:

(a) Set up a Windows machine with plenty of free disk space (10GB+).

(b) Install Cygwin (http://www.cygwin.com/).  Cygwin has an obscure,
unusable packaging system.  The trick is to click the "recycling symbol"
next to "All".  This will download and install everything.  You may if
you prefer install just the packages you need, but the list of
dependencies is long and currently undocumented.

(c) Check out libvirt from CVS, apply these patches.

(d) rm qemud/remote_protocol.[ch] qemud/remote_dispatch_*.h

(e) ./configure --without-xen --without-qemu

(f) make -C qemud remote_protocol.c

(g) make

(h) make install


Emerging Technologies, Red Hat - http://et.redhat.com/~rjones/
Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod
Street, Windsor, Berkshire, SL4 1TE, United Kingdom.  Registered in
England and Wales under Company Registration No. 03798903

-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot-QEMU-KVM - Virt Viewer.png
Type: image/png
Size: 59915 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20071124/bcd2f6d8/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20071124/bcd2f6d8/attachment-0001.bin>

More information about the libvir-list mailing list