4
<h1 >Windows support</h1>
6
Instructions for compiling and installing libvirt on Windows.
10
<a href="#Windows_binaries">Binaries</a>
13
<a href="#Windows_compiling">Compiling from source</a>
17
<a name="Windows_binaries" id="Windows_binaries">Binaries</a>
20
Binaries will be available from
21
<a href="ftp://libvirt.org/libvirt/win32">the download area</a>
22
(but we don't have binaries at the moment).
25
<a name="Windows_compiling" id="Windows_compiling">Compiling from source</a>
28
These are the steps to compile libvirt and the other
29
tools from source on Windows.
35
<li> MS Windows. Microsoft makes free (as beer) versions
36
of some of its operating systems available to
37
<a href="http://msdn.microsoft.com/">MSDN subscribers</a>.
38
We used Windows 2008 Server for testing, virtualized under
39
Linux using KVM-53 (earlier versions of KVM and QEMU won't
40
run recent versions of Windows because of lack of full ACPI
41
support, so make sure you have the latest KVM).
43
<li><a href="http://www.cygwin.com/">Cygwin</a>'s
44
<a href="http://www.cygwin.com/setup.exe">setup.exe</a>.
46
<li> A large amount of free disk space to install Cygwin.
47
Make sure you have 10 GB free to install most Cygwin packages,
48
although if you pare down the list of dependencies you may
49
get away with much less. </li>
50
<li> A network connection for Windows, since Cygwin downloads packages
51
from the net as it installs. </li>
53
<a href="http://www.libvirt.org/downloads.html">Libvirt
54
latest version from CVS</a>
56
<li> The latest source patch from
57
<a href="ftp://libvirt.org/libvirt/win32">the download area</a>. </li>
58
<li> A version of Cygwin sunrpc, patched to support building
59
<code>librpc.dll</code>.
60
A patch and a binary package are available from
61
<a href="ftp://libvirt.org/libvirt/win32">the download area</a>. </li>
64
These are the steps to take to compile libvirt from
70
<a href="http://www.cygwin.com/setup.exe">setup.exe</a>.
71
When it starts up it will show a dialog like this:
73
<img src="windows-cygwin-1.png" width="504" height="388" alt="Cygwin Net Release Setup Program"/>
76
<p>Step through the setup program accepting defaults
77
or making choices as appropriate, until you get to the
78
screen for selecting packages:</p>
79
<img src="windows-cygwin-2.png" width="505" height="388" alt="Cygwin Select Packages screen"/>
81
The user interface here is very confusing. You have to
82
click the "recycling icon" as shown by the arrow:
84
<img src="windows-cygwin-3.png" width="298" height="200" alt="Cygwin Recycling Icon"/>
86
which takes the package (and all packages in the subtree)
87
through several states such as "Install", "Reinstall", "Keep",
88
"Skip", "Uninstall", etc.
92
<p>You can install "All" (everything) or better select
93
just the groups and packages needed. Select the following
94
groups and packages for installation:
98
<th valign="top" align="right"> Groups </th>
110
<th valign="top" align="right"> Packages </th>
113
sunrpc ≥ 4.0-4 (see below) <br/></td>
118
<p> Once Cygwin has finished installing, start a Cygwin bash shell
119
(either click on the desktop icon or look for Cygwin bash shell
120
in the Start menu). </p>
121
<p> The very first time you start the Cygwin bash shell, you may
122
find you need to run the <code>mkpasswd</code> and <code>mkgroup</code>
123
commands in order to create <code>/etc/passwd</code> and
124
<code>/etc/group</code> files from Windows users. If this
125
is needed then a message is printed in the shell.
126
Note that you need to do this as Windows Administrator. </p>
129
<p> Install Cygwin sunrpc ≥ 4.0-4 package, patched to include
130
<code>librpc.dll</code>.
131
To do this, first check to see whether <code>/usr/lib/librpc.dll</code>
132
exists. If it does, you're good to go and can skip to the next
135
If you don't have this file, either install the binary package
136
<a href="ftp://libvirt.org/libvirt/win32/sunrpc-4.0-4.tar.bz2">sunrpc-4.0-4.tar.bz2</a> (just unpack it, as Administrator, in the Cygwin root directory).
137
Or you can download the
138
<a href="ftp://libvirt.org/libvirt/win32/sunrpc-4.0-dll.patch">source patch</a>
139
and apply it by hand to the Cygwin sunrpc package (eg. using
146
<a href="http://www.libvirt.org/downloads.html">Libvirt from CVS</a> and
147
<a href="ftp://libvirt.org/libvirt/win32">apply the latest Windows patch</a>
152
<p> Configure libvirt by doing: </p>
155
./configure --without-xen --without-qemu
157
<p> (The autoreconf step is probably optional). </p>
158
<p> The configure step will tell you if you have all the
159
required parts installed. If something is missing you
160
will need to go back through Cygwin setup and install it.
164
<p> Rebuild the XDR structures: </p>
166
rm qemud/remote_protocol.[ch] qemud/remote_dispatch_*.h
167
make -C qemud remote_protocol.c
175
<p> If this step is not successful, you should post a full
176
report <i>including complete messages</i> to
177
<a href="http://www.redhat.com/mailman/listinfo/libvir-list">the
178
libvirt mailing list</a>.
182
<p> Test it. If you have access to a remote machine
183
running Xen or QEMU/KVM, and the libvirt daemon (<code>libvirtd</code>)
184
then you should be able to connect to it and display
188
src/virsh.exe <a href="http://libvirt.org/uri.html">-c qemu://remote/system</a> list --all
191
Please read more about <a href="http://libvirt.org/remote.html">remote
192
support</a> before sending bug reports, to make sure that
193
any problems are really Windows and not just with remote
194
configuration / security.
199
You may want to install the library and programs by doing:
207
The above steps should also build and install Python modules.
208
However for reasons which I don't fully understand, Python won't
210
non-standard <code>/usr/local/lib/python*/site-packages/</code>
211
directory by default so you may need to set the environment
215
export PYTHONPATH=/usr/local/lib/python2.5/site-packages
218
(Change the version number to your version of Python). You
219
can test Python support from the command line:
223
>>> import libvirt
224
>>> conn = libvirt.open ("test:///default")
225
>>> conn.listDomainsID ()
227
>>> dom = conn.lookupByID (1)
228
>>> dom.XMLDesc (0)
229
"<domain type='test' id='1'> ..."
232
The most common failure will be with <code>import libvirt</code>
233
which usually indicates that either <code>PYTHONPATH</code> is
234
wrong or a DLL cannot be loaded.