1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
\r
2 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
\r
3 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
\r
5 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
\r
6 <meta name="generator" content="AsciiDoc 7.1.2" />
\r
7 <style type="text/css">
\r
9 p, li, dt, dd, div, pre, h1, h2, h3, h4, h5, h6 {
\r
11 border: 1px solid red;
\r
16 margin: 1em 5% 1em 5%;
\r
21 text-decoration: underline;
\r
39 h1, h2, h3, h4, h5, h6 {
\r
41 font-family: sans-serif;
\r
43 margin-bottom: 0.5em;
\r
48 border-bottom: 2px solid silver;
\r
51 border-bottom: 2px solid silver;
\r
61 border: 1px solid silver;
\r
66 margin-bottom: 0.5em;
\r
76 font-family: sans-serif;
\r
83 font-family: sans-serif;
\r
87 font-family: sans-serif;
\r
89 border-top: 2px solid silver;
\r
95 padding-bottom: 0.5em;
\r
99 padding-bottom: 0.5em;
\r
103 div.tableblock, div.imageblock, div.exampleblock, div.verseblock,
\r
104 div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock,
\r
105 div.admonitionblock {
\r
108 margin-bottom: 1.5em;
\r
110 div.admonitionblock {
\r
112 margin-bottom: 2.5em;
\r
115 div.content { /* Block element content. */
\r
119 /* Block element titles. */
\r
120 div.title, caption.title {
\r
121 font-family: sans-serif;
\r
125 margin-bottom: 0.5em;
\r
131 td div.title:first-child {
\r
134 div.content div.title:first-child {
\r
137 div.content + div.title {
\r
141 div.sidebarblock > div.content {
\r
142 background: #ffffee;
\r
143 border: 1px solid silver;
\r
147 div.listingblock > div.content {
\r
148 border: 1px solid silver;
\r
149 background: #f4f4f4;
\r
153 div.quoteblock > div.content {
\r
154 padding-left: 2.0em;
\r
160 div.verseblock + div.attribution {
\r
164 div.admonitionblock .icon {
\r
165 vertical-align: top;
\r
168 text-decoration: underline;
\r
170 padding-right: 0.5em;
\r
172 div.admonitionblock td.content {
\r
173 padding-left: 0.5em;
\r
174 border-left: 2px solid silver;
\r
177 div.exampleblock > div.content {
\r
178 border-left: 2px solid silver;
\r
182 div.verseblock div.content {
\r
186 div.imageblock div.content { padding-left: 0; }
\r
187 div.imageblock img { border: 1px solid silver; }
\r
188 span.image img { border-style: none; }
\r
192 margin-bottom: 0.8em;
\r
197 font-style: italic;
\r
199 dd > *:first-child {
\r
204 list-style-position: outside;
\r
207 list-style-type: lower-alpha;
\r
210 div.tableblock > table {
\r
211 border: 3px solid #527bbd;
\r
214 font-family: sans-serif;
\r
223 margin-bottom: 0.8em;
\r
226 vertical-align: top;
\r
227 font-style: italic;
\r
228 padding-right: 0.8em;
\r
231 vertical-align: top;
\r
235 div#footer-badges { display: none; }
\r
237 /* Workarounds for IE6's broken and incomplete CSS2. */
\r
239 div.sidebar-content {
\r
240 background: #ffffee;
\r
241 border: 1px solid silver;
\r
244 div.sidebar-title, div.image-title {
\r
245 font-family: sans-serif;
\r
248 margin-bottom: 0.5em;
\r
251 div.listingblock div.content {
\r
252 border: 1px solid silver;
\r
253 background: #f4f4f4;
\r
257 div.quoteblock-content {
\r
258 padding-left: 2.0em;
\r
261 div.exampleblock-content {
\r
262 border-left: 2px solid silver;
\r
263 padding-left: 0.5em;
\r
266 <title>Setup Xen within 20 minutes on Debian/grml</title>
\r
270 <h1>Setup Xen within 20 minutes on Debian/grml</h1>
\r
272 <div id="preamble">
\r
273 <div class="sectionbody">
\r
274 <div class="admonitionblock">
\r
277 <div class="title">Tip</div>
\r
279 <td class="content">if you don't have <a href="http://debian.org/">Debian</a> yet and want to
\r
280 explore Xen running a Debian system anyway either install
\r
281 <a href="http://grml.org/">grml</a> via <a href="http://grml.org/grml2hd/">grml2hd</a>
\r
282 (takes only a few minutes) or get a plain Debian system very fast and easy
\r
284 <a href="http://grml.supersized.org/archives/202-grml-debootstrap-wrapper-around-debootstrap-for-installing-plain-Debian-via-grml.html">grml-debootstrap</a>.</td>
\r
287 <p>Install relevant software und update grub's menu.lst (Xen does not work
\r
288 with lilo so install grub instead if not done already):</p>
\r
289 <div class="literalblock">
\r
290 <div class="content">
\r
291 <pre><tt>apt-get install linux-image-2.6.18-1-xen-686 xen-hypervisor-3.0.3-1-i386 xen-utils-3.0.3-1 xen-tools bridge-utils
\r
292 update-grub</tt></pre>
\r
294 <p>Example for installation of Debian etch as DomU:</p>
\r
295 <div class="literalblock">
\r
296 <div class="content">
\r
297 <pre><tt>mkdir /mnt/md1/xen
\r
298 xen-create-image --debootstrap --dir=/mnt/md1/xen --size=2Gb --memory=512Mb --fs=ext3 \
\r
299 --cache=yes --dist=etch --hostname=xengrml1 --ip 192.168.1.2 --netmask 255.255.255.0 \
\r
300 --gateway 192.168.1.1 --initrd=/boot/initrd.img-2.6.18-1-xen-686 \
\r
301 --kernel=/boot/vmlinuz-2.6.18-1-xen-686 --mirror=http://ftp.at.debian.org/debian/</tt></pre>
\r
303 <p>Start services:</p>
\r
304 <div class="literalblock">
\r
305 <div class="content">
\r
306 <pre><tt>/etc/init.d/xend start
\r
307 /etc/init.d/xendomains start</tt></pre>
\r
309 <p>Setup a bridge for network, <strong>either</strong> manually:</p>
\r
310 <div class="literalblock">
\r
311 <div class="content">
\r
312 <pre><tt>brctl addbr xenintbr
\r
313 brctl stp xenintbr off
\r
314 brctl sethello xenintbr 0
\r
315 brctl setfd xenintbr 0
\r
316 ifconfig xenintbr 192.168.1.1 netmask 255.255.255.0 up</tt></pre>
\r
318 <p><strong>or</strong> via /etc/network/interfaces (run <em>ifup xenintbr</em> to bring up the
\r
319 device then without rebooting):</p>
\r
320 <div class="literalblock">
\r
321 <div class="content">
\r
322 <pre><tt>auto xenintbr
\r
323 iface xenintbr inet static
\r
324 pre-up brctl addbr xenintbr
\r
325 post-down brctl delbr xenintbr
\r
326 address 192.168.1.1
\r
327 netmask 255.255.255.0
\r
330 bridge_stp off</tt></pre>
\r
332 <p>Setup forwarding (adjust $PUBLIC_IP; for permanet setup use
\r
333 /etc/sysctl.conf and add the iptables commands to a startup script like
\r
334 /etc/init.d/rc.local):</p>
\r
335 <div class="literalblock">
\r
336 <div class="content">
\r
337 <pre><tt>echo "1" > /proc/sys/net/ipv4/ip_forward
\r
338 iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT --to $PUBLIC_IP
\r
339 iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to $PUBLIC_IP</tt></pre>
\r
341 <p>Adjust network configuration of Xend:</p>
\r
342 <div class="literalblock">
\r
343 <div class="content">
\r
344 <pre><tt>cat >> /etc/xen/xend-config.sxp << EOF
\r
345 (network-script network-route)
\r
346 (vif-bridge xenintbr)
\r
347 (vif-script vif-bridge)
\r
350 <p>List domains, start up a DomU, shutdown later again:</p>
\r
351 <div class="literalblock">
\r
352 <div class="content">
\r
353 <pre><tt>xm create -c /etc/xen/xengrml1.cfg
\r
355 xm shutdown 1</tt></pre>
\r
359 <h2>Useful Ressources</h2>
\r
360 <div class="sectionbody">
\r
364 <a href="http://www.cl.cam.ac.uk/research/srg/netos/xen/readmes/user/user.html">Users' Manual Xen v3.0</a>
\r
369 <a href="http://www.debian-administration.org/articles/304">Installing Xen 3.0 upon Debian Sarge</a>
\r
374 <a href="http://www.pug.org/index.php/Xen-Installation">german article regarding Xen Installation</a>
\r
379 <h2>About this document</h2>
\r
380 <div class="sectionbody">
\r
381 <p>(c) Michael Prokop <mika@grml.org>; HTML version powered by <a href="http://www.methods.co.nz/asciidoc/">asciidoc</a>.</p>
\r
384 <div id="footer-text">
\r
385 Last updated 16-Nov-2006 00:58:59 CEST
\r