<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>BenV&#039;s notes &#187; xen</title>
	<atom:link href="http://notes.benv.junerules.com/tag/xen/feed/" rel="self" type="application/rss+xml" />
	<link>http://notes.benv.junerules.com</link>
	<description>Rants and notes</description>
	<lastBuildDate>Wed, 28 Jul 2010 13:36:21 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Xen and routed IPv6</title>
		<link>http://notes.benv.junerules.com/all/software/xen-and-routed-ipv6/</link>
		<comments>http://notes.benv.junerules.com/all/software/xen-and-routed-ipv6/#comments</comments>
		<pubDate>Mon, 28 Sep 2009 11:56:16 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[ipv6]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=476</guid>
		<description><![CDATA[Xenbro has found its way into the Coloclue racks where it is now running with real IP addresses. The Coloclue network routes all IP space to the main IP address of the machine so that precious IP addresses are not &#8216;lost&#8217; to reserved network and broadcast addresses. This means that my /29 has 8 usable [...]]]></description>
			<content:encoded><![CDATA[<p>Xenbro has found its way into the Coloclue racks where it is now running with real IP addresses. The Coloclue network routes all IP space to the main IP address of the machine so that precious IP addresses are not &#8216;lost&#8217; to reserved network and broadcast addresses. This means that my /29 has 8 usable addresses in stead of only 6. In order to set this up you simply change the network-script and vif-script to the -route variants in <span style="color:#FF00FF">/etc/xen/xend-config.sxp</span> so it looks like this:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#40;</span>network-script network-route<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>vif-script &nbsp; &nbsp; vif-route<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>Easy. Make sure ip forwarding is enabled though (check <span style="color:#FFFF00">/proc/sys/net/ipv4/ip_forward</span>, it should be 1) , and for IPv6 forwarding you need to enable <span style="color:#FFFF00">/proc/sys/net/ipv6/conf/all/forwarding</span>. Note that you must enable it on the -all- directory, only enabling it on a single interface won&#8217;t do what you&#8217;d expect (this took me a while to figure out <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).<br />
After requesting both a set of IPv4 and IPv6 addresses I stumbled upon Xen&#8217;s <span style="color:#00FFFF">/etc/xen/scripts/vif-route</span> script which doesn&#8217;t do anything with IPv6! Since I do want my IPv6 space routed to my domU (and probably to the others as well) I decided to molest the script a little. My modification assumes you provide both the IPv4 address and IPv6 range you want to use on the domU. Here&#8217;s the diff:<br />
<a href="http://notes.benv.junerules.com/wp-content/plugins/download-monitor/download.php?id=xen-3.4-vif-route-ipv6.diff" title="Downloaded 221 times">xen 3.4 vif-route patch to support IPv6</a> - Version  - SHA: e82dd95b8725c326121603fbd6168b3f88f5b881<br />
Note that my patch adds some extra logging as well, you can hack that out yourself if it annoys you.<br />
If patching is too difficult for you, here&#8217;s the patched vif-route script:<br />
<a href="http://notes.benv.junerules.com/wp-content/plugins/download-monitor/download.php?id=vif-route" title="Downloaded 219 times">Patched Xen 3.4.1 vif-route to support IPv6</a> - Version  - SHA: 29a28f4a8cff787233c1163435c86730fd5346fa</p>
<p>Don&#8217;t forget to put your IP addresses in your domU&#8217;s config file:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># domU.cfg</span><br />
vif = <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">'mac=00:16:11:11:2b:11, ip=2345::1/64 192.168.2.100'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>After patching vif-route and enabling the script in xend-config.sxp you still have to set routes to the dom0 in your domU. Example for dom0 with 192.168.1.1 and 1234::1</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># IPv4</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>domU<span style="color: #666666; font-style: italic;"># ifconfig eth0 192.168.2.10 netmask 255.255.255.255 # Your domU's IPv4 address here</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>domU<span style="color: #666666; font-style: italic;"># ip ro add 192.168.1.1 dev eth0</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>domU<span style="color: #666666; font-style: italic;"># ip ro add default via 192.168.1.1</span><br />
<span style="color: #666666; font-style: italic;"># IPv6</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>domU<span style="color: #666666; font-style: italic;"># ip -6 addr add 2345::1/64 dev eth0 # Your domU's IPv6 range here</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>domU<span style="color: #666666; font-style: italic;"># ip -6 ro add 1234::1 dev eth0</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>domU<span style="color: #666666; font-style: italic;"># ip -6 ro add default via 1234::1</span></div></div>
<p>Now it works (unless you did something stupid of course) <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/xen-and-routed-ipv6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Xen and Power Saving</title>
		<link>http://notes.benv.junerules.com/all/software/xen-and-power-saving/</link>
		<comments>http://notes.benv.junerules.com/all/software/xen-and-power-saving/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 23:23:26 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[powersave]]></category>
		<category><![CDATA[xen]]></category>
		<category><![CDATA[xenpm]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=329</guid>
		<description><![CDATA[Or more specific: CPU frequency scaling. On my laptop this is one of the first things I enabled to make my battery last longer. Now that we&#8217;re going to put a server in a rack where they will bill us depending on the amount of power consumed, this sounds like a welcome thing to have [...]]]></description>
			<content:encoded><![CDATA[<p>Or more specific: CPU frequency scaling.</p>
<p>On my laptop this is one of the first things I enabled to make my battery last longer.<br />
Now that we&#8217;re going to put a server in a rack where they will bill us depending on the amount of power consumed, this sounds like a welcome thing to have enabled.</p>
<p>Our latest Xen install has Xen 3.4, on which they&#8217;ve enabled it by default. Isn&#8217;t that nice?<br />
So basically, if your processor etc is good enough to support it, you can mess around with it using the <span style="color:#FF00FF">xenpm</span> tool.</p>
<p>For instance we can check the parameters for CPU 0 like this:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:~<span style="color: #666666; font-style: italic;"># xenpm get-cpufreq-para 0</span><br />
cpu <span style="color: #c20cb9; font-weight: bold;">id</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; : <span style="color: #000000;">0</span><br />
affected_cpus &nbsp; &nbsp; &nbsp; &nbsp;: <span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000;">0</span> <span style="color: #000000;">1</span> <span style="color: #000000;">2</span> <span style="color: #000000;">3</span><br />
cpuinfo frequency &nbsp; &nbsp;: max <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2600000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> min <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">800000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> cur <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">800000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
scaling_driver &nbsp; &nbsp; &nbsp; : <br />
scaling_avail_gov &nbsp; &nbsp;: userspace performance powersave ondemand<br />
current_governor &nbsp; &nbsp; : ondemand<br />
&nbsp; ondemand specific &nbsp;:<br />
&nbsp; &nbsp; sampling_rate &nbsp; &nbsp;: max <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">10000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> min <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">10000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> cur <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">20000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
&nbsp; &nbsp; up_threshold &nbsp; &nbsp; : <span style="color: #000000;">80</span><br />
scaling_avail_freq &nbsp; : <span style="color: #000000;">2600000</span> <span style="color: #000000;">1900000</span> <span style="color: #000000;">1400000</span> <span style="color: #000000; font-weight: bold;">*</span><span style="color: #000000;">800000</span><br />
scaling frequency &nbsp; &nbsp;: max <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">2600000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> min <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">800000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> cur <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">800000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>As you can see, it&#8217;s very much like the whole <span style="color:#FF0000">cpufreq</span> ordeal. It has an <span style="color:#00FFFF">ondemand</span> governor, a <span style="color:#00FFFF">powersave</span> one, etc. Right now this CPU is using the ondemand governor, which will ramp up the clock when demand increases.<br />
However, since this is a quad core and not a real quad processor machine we can only change the governor for all 4 cores at the same time, not for individual ones. (would be cool to have 1 core burning away power while the rest idles by&#8230;.).</p>
<p>Anyway, the <span style="color:#FF00FF">xenpm</span> tool allows us to monitor and change various aspects of this.<br />
For instance this will do a little benchmark and show the processor states during the benchmark.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:~<span style="color: #666666; font-style: italic;"># xenpm start 10</span><br />
Timeout <span style="color: #000000; font-weight: bold;">set</span> to <span style="color: #000000;">10</span> seconds<br />
Start sampling, waiting <span style="color: #000000; font-weight: bold;">for</span> CTRL-C or SIGINT or SIGALARM signal ...<br />
Elapsed <span style="color: #000000; font-weight: bold;">time</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span>: <span style="color: #000000;">10003</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
CPU0: &nbsp; Residency<span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Avg Res<span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; C0 &nbsp; &nbsp;<span style="color: #000000;">49</span> &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000;">0.50</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0.04</span><br />
&nbsp; C1 &nbsp; &nbsp;<span style="color: #000000;">9953</span> &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">99.50</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">7.19</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; Avg freq &nbsp; &nbsp; &nbsp;<span style="color: #000000;">800000</span> &nbsp;KHz<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
CPU1: &nbsp; Residency<span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Avg Res<span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; C0 &nbsp; &nbsp;<span style="color: #000000;">13</span> &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000;">0.14</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0.07</span><br />
&nbsp; C1 &nbsp; &nbsp;<span style="color: #000000;">9989</span> &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">99.86</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">48.49</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; Avg freq &nbsp; &nbsp; &nbsp;<span style="color: #000000;">800000</span> &nbsp;KHz<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
CPU2: &nbsp; Residency<span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Avg Res<span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; C0 &nbsp; &nbsp;<span style="color: #000000;">83</span> &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000;">0.83</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0.21</span><br />
&nbsp; C1 &nbsp; &nbsp;<span style="color: #000000;">9919</span> &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">99.17</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">25.05</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; Avg freq &nbsp; &nbsp; &nbsp;<span style="color: #000000;">800000</span> &nbsp;KHz<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
CPU3: &nbsp; Residency<span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Avg Res<span style="color: #7a0874; font-weight: bold;">&#40;</span>ms<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; C0 &nbsp; &nbsp;<span style="color: #000000;">28</span> &nbsp; &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #000000;">0.28</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0.10</span><br />
&nbsp; C1 &nbsp; &nbsp;<span style="color: #000000;">9973</span> &nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">99.72</span><span style="color: #000000; font-weight: bold;">%</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">33.92</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; Avg freq &nbsp; &nbsp; &nbsp;<span style="color: #000000;">800000</span> &nbsp;KHz</div></div>
<p>As you can see my processor is mostly idle.<br />
<span style="color:#FFF033">State C0</span> is the most active state, <span style="color:#FFF033">C1</span> is sleeping with use of the HLT instruction.<br />
Your processor can have many more states, like my laptop which has 4.</p>
<p>Anyway, I put the change to ondemand governor in my /etc/rc.d/rc.local, so let&#8217;s hope it helps.</p>
<p>To read some more about the details of this stuff you can check out the <a href="http://wiki.xensource.com/xenwiki/xenpm">Xenpm wiki page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/xen-and-power-saving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New server, day 2. DomU and networking.</title>
		<link>http://notes.benv.junerules.com/all/software/new-server-day-2-domu-and-networking/</link>
		<comments>http://notes.benv.junerules.com/all/software/new-server-day-2-domu-and-networking/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 14:54:01 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[domU]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[networking]]></category>
		<category><![CDATA[slackware]]></category>
		<category><![CDATA[xen]]></category>
		<category><![CDATA[xm]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=293</guid>
		<description><![CDATA[Another day, another time for fun! Since we got Xen up and running yesterday, it&#8217;s now time for actually having some fun with it. The goals are: Getting xend started automagically when booting without destroying my network connection Getting a domU up and running with a network connection Getting an internal network between the domUs [...]]]></description>
			<content:encoded><![CDATA[<p>Another day, another time for fun!</p>
<p>Since we got Xen up and running yesterday, it&#8217;s now time for actually having some fun with it.<br />
The goals are:</p>
<ol>
<li>Getting xend started automagically when booting without destroying my network connection</li>
<li>Getting a domU up and running with a network connection</li>
<li>Getting an internal network between the domUs and dom0, shielded from the big bad internet.</li>
</ol>
<p><span id="more-293"></span></p>
<p>First things first, yesterday we got xen installed and all, but that&#8217;s about as far as we got before the bed was required. Xend almost got it right when it put a startup script in <span style="color:#FF00FF">/etc/rc.d/init.d</span> called &#8216;xend&#8217;, but alas, slackware will ignore that file. Personally I simply add the thing to <span style="color:#00FFFF">/etc/rc.d/rc.local</span>:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Starting xend...&quot;</span><br />
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>xend start</div></div>
<p>This fixes issue #1, but only the first part.</p>
<p>Before you reboot you might want to alter some xend settings. The file to molest for this is <span style="color:#FFFF00">/etc/xend/xend-config.sxp</span>. Mine looks a bit like this:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:~<span style="color: #666666; font-style: italic;"># grep -ve '#' -e '^$' /etc/xen/xend-config.sxp</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>logfile <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xend.log<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>loglevel DEBUG<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>xen-api-server <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#40;</span>unix<span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-unix-xmlrpc-server <span style="color: #c20cb9; font-weight: bold;">yes</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-server <span style="color: #c20cb9; font-weight: bold;">yes</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-unix-path <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>xend<span style="color: #000000; font-weight: bold;">/</span>xend-socket<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-address localhost<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>xend-relocation-hosts-allow <span style="color: #ff0000;">'^localhost$ ^localhost\\.localdomain$'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>network-script <span style="color: #ff0000;">'bridge-wrapper-benv netdev=eth0 bridge=xenbr0'</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>vif-script vif-bridge<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>dom0-min-mem <span style="color: #000000;">196</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>enable-dom0-ballooning <span style="color: #c20cb9; font-weight: bold;">yes</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>dom0-cpus <span style="color: #000000;">0</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>vncpasswd <span style="color: #ff0000;">''</span><span style="color: #7a0874; font-weight: bold;">&#41;</span></div></div>
<p>Almost everything is set to the default value. However, you will want to pay attention to the <span style="color:#FFFF00">network-script</span> part at the very least. As you can see I changed this to a little wrapper script.<br />
I won&#8217;t go into detail about all the possible Xen networking stuff, see the mailing list and the Xen docs for that, but what we want is the external network bridged to all domU&#8217;s, so they can have their own network space there and their external IP address and whatever they want to do without having to mess around in the dom0. To get this working you could stick to the default <code class="codecolorer text vibrant"><span class="text">(network-script network-bridge)</span></code>. Back in the Xen 3.0.3 days this molested my default gateway because their bridge script sucked (it failed to parse some stuff if I remember correctly), but when I tested it today it simply worked.</p>
<p>We want to have an internal network though, so we have to create our own bridge wrapper script.The only thing this script wrapper does is<br />
1. call the network bridge script as the default would do.<br />
2. create a second xen bridge.<br />
Here we go:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/bash</span><br />
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>scripts<span style="color: #000000; font-weight: bold;">/</span>network-bridge <span style="color: #ff0000;">&quot;$@&quot;</span><br />
<br />
<span style="color: #007800;">bridge</span>=xenbr1<br />
<br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>;<br />
<span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp;<span style="color: #7a0874; font-weight: bold;">echo</span> Creating internal bridge <span style="color: #800000;">${bridge}</span>....<br />
&nbsp; &nbsp;brctl addbr <span style="color: #800000;">${bridge}</span><br />
&nbsp; &nbsp;brctl stp <span style="color: #800000;">${bridge}</span> off<br />
&nbsp; &nbsp;brctl setfd <span style="color: #800000;">${bridge}</span> <span style="color: #000000;">0</span><br />
&nbsp; &nbsp;ip <span style="color: #c20cb9; font-weight: bold;">link</span> <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #800000;">${bridge}</span> up &nbsp;<br />
<br />
&nbsp; &nbsp;<span style="color: #c20cb9; font-weight: bold;">ifconfig</span> <span style="color: #800000;">${bridge}</span> up &nbsp;10.0.0.1 netmask 255.255.255.0<br />
<span style="color: #000000; font-weight: bold;">fi</span></div></div>
<p>As you can see I also add an internal IP address to the bridge. You can make this bridge setup script as complex or as neat as you want, but I can&#8217;t be bothered to spend more time on it. It works for me &#8482; <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Now that all that is in place, let&#8217;s try out the creation of a domU. For testing purposes I steal my images from what used to be jailtime.org, these days it&#8217;s called <a href="http://stacklet.com/">Stacklet</a>. Too bad they don&#8217;t have a 64 bit slackware domU yet, but I guess I&#8217;ll create that myself a little later. Also, to keep stuff in a place where I can track it, I usually create a /xen directory where I store my host configurations and images.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:~<span style="color: #666666; font-style: italic;"># mkdir -p &nbsp;/xen/hosts/slackware12.2</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:~<span style="color: #666666; font-style: italic;"># cd /xen/hosts/slackware12.2</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>hosts<span style="color: #000000; font-weight: bold;">/</span>slackware12.2<span style="color: #666666; font-style: italic;"># wget http://stacklet.com/sites/default/files/slackware/slackware.12-2.x86.20090509.img.tar.bz2</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>hosts<span style="color: #000000; font-weight: bold;">/</span>slackware12.2<span style="color: #666666; font-style: italic;"># tar jxvf slackware.12-2.x86.20090509.img.tar.bz2</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">*</span>kaboom<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>Edit the slackware.12-2.x86.xen3.cfg file and fix the location of the image file and the kernel. I simply used the same kernel that I use to boot my dom0 for now. Now let&#8217;s try it! Try</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">xm create <span style="color: #660033;">-c</span> slackware.12-<span style="color: #000000;">2</span>.x86.xen3.cfg</div></div>
<p>and it should enter the console of the now booting domU. To get out of the console hit <span style="color:#FFFF00">CTRL-[</span>.</p>
<p>Over here I got a bunch of kernel warnings like these:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> ------------<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #c20cb9; font-weight: bold;">cut</span> here <span style="color: #7a0874; font-weight: bold;">&#93;</span>------------ <br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> WARNING: at drivers<span style="color: #000000; font-weight: bold;">/</span>firmware<span style="color: #000000; font-weight: bold;">/</span>dmi_scan.c:<span style="color: #000000;">425</span> dmi_matches+0x81<span style="color: #000000; font-weight: bold;">/</span>0x90<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> dmi check: not initialized yet. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Modules linked <span style="color: #000000; font-weight: bold;">in</span>: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Pid: <span style="color: #000000;">0</span>, <span style="color: #c20cb9; font-weight: bold;">comm</span>: swapper Not tainted 2.6.29.6-BenV <span style="color: #666666; font-style: italic;">#3</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> Call Trace: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff802352aa<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> warn_slowpath+0xea<span style="color: #000000; font-weight: bold;">/</span>0x160<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff8078bfd4<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> printk+0x4e<span style="color: #000000; font-weight: bold;">/</span>0x56 &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff80a9b625<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> phys_pud_init+0x150<span style="color: #000000; font-weight: bold;">/</span>0x42b<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff80a77418<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> reserve_early+0x13<span style="color: #000000; font-weight: bold;">/</span>0x28 &nbsp;<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff80771929<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> init_memory_mapping+0x559<span style="color: #000000; font-weight: bold;">/</span>0xd40<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff8063e671<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> dmi_matches+0x81<span style="color: #000000; font-weight: bold;">/</span>0x90 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff8063e6f0<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> dmi_check_system+0x20<span style="color: #000000; font-weight: bold;">/</span>0x60<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff80a7554a<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> setup_arch+0x2aa<span style="color: #000000; font-weight: bold;">/</span>0xf19 &nbsp; &nbsp;<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff80a6e7ac<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> start_kernel+0x81<span style="color: #000000; font-weight: bold;">/</span>0x483<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> &nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>ffffffff80a6e1bd<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> x86_64_start_kernel+0xa9<span style="color: #000000; font-weight: bold;">/</span>0xbf<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> &nbsp; &nbsp;<span style="color: #000000;">0.000000</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> ---<span style="color: #7a0874; font-weight: bold;">&#91;</span> end trace 4eaa2a86a8e2da22 <span style="color: #7a0874; font-weight: bold;">&#93;</span>---</div></div>
<p>While these are a nuisance in dmesg, they seem to be fairly harmless. Somewhere on the Xen mailing list someone claims that you can disable CONFIG_DMI in the kernel to get rid of these, which I tend to believe but can&#8217;t be bothered. If I&#8217;m going to build a new kernel for my domU, I will take the latest vanilla kernel and add Xen domU support in that. It&#8217;s a mainline kernel option these days, you can see my post about it here: <a href="http://notes.benv.junerules.com/software/xen-and-booting-domu-using-a-vanilla-kernel/">Xen and booting domU using a vanilla kernel</a><br />
Login on the domU using root/password, note that your networking actually works, but you still have to enter an IP for eth1 if you want the internal network.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>darkstar:~<span style="color: #666666; font-style: italic;"># ifconfig eth1 10.0.0.2/24</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>darkstar:~<span style="color: #666666; font-style: italic;"># ping 10.0.0.1</span><br />
PING 10.0.0.1 <span style="color: #7a0874; font-weight: bold;">&#40;</span>10.0.0.1<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000;">56</span><span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">84</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> bytes of data.<br />
<span style="color: #000000;">64</span> bytes from 10.0.0.1: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">1</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">64</span> <span style="color: #007800;">time</span>=<span style="color: #000000;">0.770</span> ms<br />
<span style="color: #000000;">64</span> bytes from 10.0.0.1: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">2</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">64</span> <span style="color: #007800;">time</span>=<span style="color: #000000;">0.192</span> ms<br />
<span style="color: #000000;">64</span> bytes from 10.0.0.1: <span style="color: #007800;">icmp_seq</span>=<span style="color: #000000;">3</span> <span style="color: #007800;">ttl</span>=<span style="color: #000000;">64</span> <span style="color: #007800;">time</span>=<span style="color: #000000;">0.187</span> ms</div></div>
<p>Woohoo, it works! <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>For an overview of the currently running domains you can use</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:~<span style="color: #666666; font-style: italic;"># xm list</span><br />
Name &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;ID &nbsp; Mem VCPUs &nbsp; &nbsp; &nbsp;State &nbsp; Time<span style="color: #7a0874; font-weight: bold;">&#40;</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
Domain-<span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">0</span> &nbsp;<span style="color: #000000;">7447</span> &nbsp; &nbsp; <span style="color: #000000;">4</span> &nbsp; &nbsp; r----- &nbsp; &nbsp; <span style="color: #000000;">16.0</span><br />
test1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">1</span> &nbsp; <span style="color: #000000;">512</span> &nbsp; &nbsp; <span style="color: #000000;">1</span> &nbsp; &nbsp; <span style="color: #660033;">-b----</span> &nbsp; &nbsp; &nbsp;<span style="color: #000000;">5.9</span></div></div>
<p>The <span style="color:#00FFFF">xm</span> command has a ton of useful things, so check out the manpage/help for it.</p>
<p>For my real domU I will be using LVM partitions and install slackware 64 on it, but that&#8217;s fairly trivial to figure out once you&#8217;re this far. So have fun with your Xen install ^^</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/new-server-day-2-domu-and-networking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New server, slackware64 and Xen 3.4</title>
		<link>http://notes.benv.junerules.com/all/software/new-server-slackware64-and-xen-3-4/</link>
		<comments>http://notes.benv.junerules.com/all/software/new-server-slackware64-and-xen-3-4/#comments</comments>
		<pubDate>Sat, 29 Aug 2009 00:06:00 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[coloclue]]></category>
		<category><![CDATA[slackware64]]></category>
		<category><![CDATA[x86_64]]></category>
		<category><![CDATA[xen]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=274</guid>
		<description><![CDATA[You read it right, time for fun! First we build ourselves a nice cute little server in a 2U rack case made by Chenbro (sounds like Xenbro to me ). Inside we stash a quad core Phenom X2 810, 2 western digital 1TB disks from the &#8220;green&#8221; series and of course 8GB of DDR1333. Could [...]]]></description>
			<content:encoded><![CDATA[<p>You read it right, time for fun!</p>
<p>First we build ourselves a nice cute little server in a 2U rack case made by Chenbro (sounds like Xenbro to me <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ).<br />
Inside we stash a quad core Phenom X2 810, 2 western digital 1TB disks from the &#8220;green&#8221; series and of course 8GB of DDR1333.<br />
Could be faster, but this should do for not too much coin. (about 600 euros).<br />
<span id="more-274"></span></p>
<p>We (which is me and lotjuh plus some friends) want this machine as a toy machine that we can all play with which we&#8217;re going to put in a rack at <a href="http://coloclue.net/">Coloclue</a>.<br />
Basically everyone pays a tiny amount of money each month and gets himself a domU on the machine that he can do whatever he wants with, like messing around with<br />
vpn tunnels and ipv6 <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Anyway, after putting the stuff inside it looked a bit like this:<br />
<a href="http://notes.benv.junerules.com/wp-content/uploads/2009/08/suc54016.jpg"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/08/suc54016-300x225.jpg" alt="suc54016" title="suc54016" width="300" height="225" class="aligncenter size-medium wp-image-275" /></a></p>
<p>Power on, it works! (duh)<br />
Work through the BIOS, making sure to disable the halt on errors prompt and such nonsense. 512MB for integrated video? No thanks, too bad the minimum is still 128MB.<br />
And how come every time I run through a BIOS I find new (and undocumented) settings like &#8220;Enable C1E support&#8221;? Apparently this is some kind of new AMD power saving stuff,<br />
but from the comments I found it seems like a tickless kernel has issues with it, so I&#8217;ll leave it off.</p>
<p>Boot from PXE, slackware64-current, go go go. Created a little md0 raid1 boot partition, ran setup using NFS and a few minutes later it boots into slackware 64.<br />
That was easy. (And fast!)<br />
<a href="http://notes.benv.junerules.com/wp-content/uploads/2009/08/suc54018.jpg"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/08/suc54018-300x225.jpg" alt="suc54018" title="suc54018" width="300" height="225" class="aligncenter size-medium wp-image-276" /></a></p>
<p>Now for the more interesting stuff. First, let&#8217;s get rid of lilo and put the latest grub on the machine. It&#8217;s just such a nicer bootloader, once you get it properly installed that is.<br />
It does support autoconf these days, so I figured I could use my slackbuild script for it. Slackbuild immediately cursed at me for not having the packages dir, so that was fixed as well <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
I also put the site config in place while I was at it.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #666666; font-style: italic;"># svn co svn://svn.sv.gnu.org/grub/trunk/grub2 grub2-svn</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #666666; font-style: italic;"># cd grub2-svn</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>grub2-svn<span style="color: #666666; font-style: italic;"># slackbuild.pl</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>grub2-svn<span style="color: #666666; font-style: italic;"># installpkg /usr/src/packages/grub2-1.97-svn-x86_64-1.tgz</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro<span style="color: #666666; font-style: italic;"># grub-install /dev/md0</span><br />
Installation finished. No error reported.<br />
This is the contents of the device map <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>grub<span style="color: #000000; font-weight: bold;">/</span>device.map.<br />
Check <span style="color: #000000; font-weight: bold;">if</span> this is correct or not. If any of the lines is incorrect,<br />
fix it and re-run the script <span style="color: #000000; font-weight: bold;">`</span>grub-install<span style="color: #ff0000;">'.<br />
<br />
(hd0) &nbsp; /dev/sda<br />
(hd1) &nbsp; /dev/sdb</span></div></div>
<p>Well, that went smooth. Now for the config file, this is usually more tricky.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro<span style="color: #666666; font-style: italic;"># grub-mkconfig &gt; /boot/grub/grub.cfg</span><br />
Generating grub.cfg ...<br />
Found linux image: <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-huge-2.6.29.6<br />
Found linux image: <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-generic-2.6.29.6<br />
<span style="color: #000000; font-weight: bold;">done</span></div></div>
<p>Looking good&#8230;. seems like it even added the mdraid module in the config, grub is improving these days <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Time for a reboot to see if it lied to us. *reboot*<br />
Well, guess what&#8230;. it actually worked. Amazing.</p>
<p>Time for Xen!<br />
We have 2 HDDs in there which I split up in a 20 GB boot partition and the rest. Both partitions are mirrored using raid-1 so a disk could basically disappear and the system should still be fine.<br />
The bigger partition will be fed into LVM so we can make nice little chunks there to hand out to the domUs.<br />
Other than that everyone can decide for themselves whatever the hell they want to run on it, as long as it runs under Xen.<br />
Here we go:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:~<span style="color: #666666; font-style: italic;"># cd /usr/src</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #666666; font-style: italic;"># mkdir xen</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #666666; font-style: italic;"># cd xen/</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #666666; font-style: italic;"># wget http://bits.xensource.com/oss-xen/release/3.4.1/xen-3.4.1.tar.gz</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #666666; font-style: italic;"># tar zxvf xen-3.4.1.tar.gz </span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #666666; font-style: italic;"># cd xen-3.4.1</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1<span style="color: #666666; font-style: italic;"># make xen</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1<span style="color: #666666; font-style: italic;"># make install-xen</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>That went smooth over here, and installed the xen hypervisor. (you should now have a /boot/xen.gz, which is a symlink to xen-3.4.1.gz).<br />
However, we also need a dom0 kernel and the xen tools to run and control the installation.<br />
First the tools:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1<span style="color: #666666; font-style: italic;"># make tools</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span> .. <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1<span style="color: #666666; font-style: italic;"># make install-tools</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>Easy again. You should now have stuff like &#8216;<span style="color:#FF00FF">xm</span>&#8216; installed.<br />
This also created the <span style="color:#FF0055">/etc/xen</span> directory where we can muck around with the configuration later.</p>
<p>Now for the most challenging part: the kernel.<br />
What usually bites me is getting the kernel config worked out to my wishes, xen seems to wreck havoc with mine most of the times.<br />
Of course you could try to go for the default kernel, but I hate messing around with modules and initrds, so I usually try to make a megahuge kernel.<br />
Let&#8217;s go!</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1<span style="color: #666666; font-style: italic;"># make linux-2.6-xen0-prep</span></div></div>
<p>This fetches the kernel sources from hg and prepares them with initial configs etc. It might ask you some stuff, answer them to the best of your abilities, or simply accept the default.<br />
It doesn&#8217;t matter much if you messed up the questions, you have a chance to fix it. And fix the rest of the kernel as well while you&#8217;re at it:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1<span style="color: #666666; font-style: italic;"># cd build-linux-2.6.18-xen0_x86_64/</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1<span style="color: #000000; font-weight: bold;">/</span>build-linux-2.6.18-xen0_x86_64<span style="color: #666666; font-style: italic;"># make menuconfig</span></div></div>
<p>You are now presented with the usual kernel config dialogs. Have fun running through all of them as I did and halfway noticing the lack of <span style="color:#0055FF">EXT4</span> support.<br />
<span style="color:#FF0000">RAAAH!</span><br />
Kernel 2.6.18.8 for you&#8230; it&#8217;s ancient. But still default for the xen dom0. I wouldn&#8217;t mind that much, if it at least included support for my hardware (another machine we have with Xen required a patch to get AHCI up and running for that controller) and supported my filesystems. Meh.<br />
So after the conclusion that 2.6.18 wouldn&#8217;t work, I went for something better: 2.6.29.6 <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #666666; font-style: italic;"># wget http://gentoo-xen-kernel.googlecode.com/files/xen-patches-2.6.29-6.tar.bz2</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> ... <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #666666; font-style: italic;"># wget ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.29.6.tar.bz2</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #666666; font-style: italic;"># tar jxvf linux-2.6.29.6.tar.bz2 </span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">*</span>KABOOM<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #666666; font-style: italic;"># mkdir xen-patches</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #666666; font-style: italic;"># cd xen-patches</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-patches<span style="color: #666666; font-style: italic;"># tar jxvf ../xen-patches-2.6.29-6.tar.bz2 </span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>xen-patches<span style="color: #666666; font-style: italic;"># cd ../linux-2.6.29.6</span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>linux-2.6.29.6<span style="color: #666666; font-style: italic;"># for k in ../xen-patches/* ; do echo Patch $k: ; &nbsp;patch -p1 &lt; $k ; done</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">*</span>WHOOSH<span style="color: #000000; font-weight: bold;">*</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>If all went well you now have a patched 2.6.29.6 kernel source. Make sure it didn&#8217;t barf though, but if you used the correct kernel version this should apply cleanly.<br />
Retry on the config!</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>linux-2.6.29.6<span style="color: #666666; font-style: italic;"># make menuconfig</span><br />
&nbsp;<span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">*</span>yadieyada, don<span style="color: #ff0000;">'t forget to enable Xen dom0 support* ]<br />
root@xenbro:/usr/src/xen/linux-2.6.29.6# time make bzImage modules modules_install<br />
&nbsp;[ *crunch crunch* ]</span></div></div>
<p>Time for some coffee.<br />
When it&#8217;s done (took about 7 minutes on this machine with my huge list of options) we still need to put it in place and add it to grub&#8217;s menu.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>linux-2.6.29.6<span style="color: #666666; font-style: italic;"># cp vmlinux /boot/vmlinuz-xen-2.6.29.6 </span><br />
root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>linux-2.6.29.6<span style="color: #666666; font-style: italic;"># vim /boot/grub/grub.cfg</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Add this somewhere logical</span><br />
menuentry <span style="color: #ff0000;">&quot;xen-3.4.1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; insmod raid<br />
&nbsp; &nbsp; &nbsp; &nbsp; insmod mdraid<br />
&nbsp; &nbsp; &nbsp; &nbsp; insmod ext2<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">root</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>md0<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; search <span style="color: #660033;">--no-floppy</span> <span style="color: #660033;">--fs-uuid</span> <span style="color: #660033;">--set</span> 2f8afc00-ec48-4d1f-b4fa-5787e18f2387<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; multiboot <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1.gz <span style="color: #007800;">dom0_mem</span>=512M<br />
&nbsp; &nbsp; &nbsp; &nbsp; module <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-xen-2.6.29.6 <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0 ro<br />
<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>If you did everything allright, yay, it boots with Xen! <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Of course over here it died shortly after booting the kernel because it couldn&#8217;t mount its root filesystem, but that&#8217;s nothing new with this stuff <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Time to debug the problem. After rebuilding my kernel about 4 times and fighting with grub, I started to seriously wonder what the hell its problem was.<br />
Raid (md) support, check.<br />
Ext4 support, check.<br />
Both in grub and the kernel they were present. Maybe xen in the way? Seems unlikely.<br />
The fact that the kernel gets booted proves to me that grub at least &#8220;gets&#8221; it.<br />
Finally I created an initrd to see if that would help. It didn&#8217;t, except for the fact that it gave me a nice little shell to dick around with.<br />
This showed me that md0 would indeed not mount, probably because it wasn&#8217;t started. After starting it manually using some busybox command (raidgetthefuckstarted /dev/md0 or something)<br />
I could mount it and exit the emergency shell, the system booted.<br />
After I recreated the initrd to include raid support (doh) it actually managed to boot without outsider help. Goody.<br />
The command for this was: (note that I gave my kernel the -BenV local version string)</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>xenbro:<span style="color: #000000; font-weight: bold;">/</span><span style="color: #666666; font-style: italic;"># mkinitrd -c -k 2.6.29.6-BenV -m ext4 -f ext4 -R -r /dev/md0</span></div></div>
<p>And the grub config entry now looks like:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">menuentry <span style="color: #ff0000;">&quot;GNU/Linux, Xen 3.4.1 / Linux 2.6.29.6&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; insmod raid<br />
&nbsp; &nbsp; &nbsp; &nbsp; insmod mdraid<br />
&nbsp; &nbsp; &nbsp; &nbsp; insmod ext2<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">set</span> <span style="color: #007800;">root</span>=<span style="color: #7a0874; font-weight: bold;">&#40;</span>md0<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; search <span style="color: #660033;">--no-floppy</span> <span style="color: #660033;">--fs-uuid</span> <span style="color: #660033;">--set</span> 2f8afc00-ec48-4d1f-b4fa-5787e18f2387<br />
&nbsp; &nbsp; &nbsp; &nbsp; multiboot <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>xen-3.4.1.gz <span style="color: #007800;">dom0_mem</span>=512M<br />
&nbsp; &nbsp; &nbsp; &nbsp; module <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-xen-2.6.29.6 <span style="color: #007800;">root</span>=<span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>md0 ro<br />
&nbsp; &nbsp; &nbsp; &nbsp; module <span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>initrd-xen-2.6.29.6.gz<br />
<span style="color: #7a0874; font-weight: bold;">&#125;</span></div></div>
<p>Well, good enough for today. Bedtime!</p>
<p><a href="http://notes.benv.junerules.com/wp-content/uploads/2009/08/xenbro.png"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/08/xenbro-1024x624.png" alt="xenbro" title="xenbro" width="1024" height="624" class="alignleft size-large wp-image-288" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/new-server-slackware64-and-xen-3-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Xen and booting domU using a vanilla kernel</title>
		<link>http://notes.benv.junerules.com/all/software/xen-and-booting-domu-using-a-vanilla-kernel/</link>
		<comments>http://notes.benv.junerules.com/all/software/xen-and-booting-domu-using-a-vanilla-kernel/#comments</comments>
		<pubDate>Tue, 18 Aug 2009 21:13:23 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Morons]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[exploit]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[slackware]]></category>
		<category><![CDATA[update]]></category>
		<category><![CDATA[xen]]></category>
		<category><![CDATA[xm]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=209</guid>
		<description><![CDATA[Our server in the datacenter is running slackware (duh) with a nice Xen installation on it. Still running with Xen 3 using PAE since the last time I updated/upgraded it without any major problems for over 2 years now (ignoring the time that the power supply let go of the the magic smoke) So after [...]]]></description>
			<content:encoded><![CDATA[<p>Our server in the datacenter is running slackware (duh) with a nice Xen installation on it.<br />
Still running with <a href="http://www.xen.org/">Xen 3</a> using PAE since the last time I updated/upgraded it without any major problems for over 2 years now <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
(ignoring the time that the power supply let go of the the magic smoke)</p>
<p>So after the latest local root exploit thing, and testing it on some machines during har2009, I figured it might be nice to get the <a href="http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e694958388c50148389b0e9b9e9e8945cf0f1b98">patch</a> into my kernels. Running a webserver usually means you&#8217;re at risk after all, especially when it&#8217;s running wordpress <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>So I grabbed the latest kernel that had that patch and went for the usual <code class="codecolorer text vibrant"><span class="text">make menuconfig</span></code> ordeal. After half an hour of selecting &#8220;yes&#8221;, &#8220;maybe&#8221;, &#8220;I guess so&#8221;, and<br />
some XEN options (<span style="color: #FFFF00">CONFIG_PARAVIRT_GUEST=y, CONFIG_XEN=y, CONFIG_HVC_DRIVER=y, CONFIG_XEN_BLKDEV_FRONTEND=y, CONFIG_XEN_NETDEV_FRONTEND=y, CONFIG_XEN_KBDDEV_FRONTEND=y, CONFIG_HVC_XEN=y, CONFIG_XEN_BALLOON=y, CONFIG_XEN_SCRUB_PAGES=y, CONFIG_XENFS=y, CONFIG_XEN_COMPAT_XENFS=y</span>) I built the thing.<br />
As I usually build bzImages I also did so here. <code class="codecolorer text vibrant"><span class="text">make bzImage modules modules_install</span></code>.<br />
Half an hour later I had a shiny bzImage. Let&#8217;s try it on a test domain!</p>
<p>I copied the bzImage to /boot, changed the <code class="codecolorer text vibrant"><span class="text">kernel = &quot;/boot/vmlinuz-xen-old&quot;</span></code> option to the new place, and GO!<br />
This is what it told me:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>iejoor:<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>hosts<span style="color: #000000; font-weight: bold;">/</span>purple<span style="color: #666666; font-style: italic;"># xm create -c purple.cfg-newkernel</span><br />
Using config <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;./purple.cfg-newkernel&quot;</span>.<br />
Started domain purple<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;root<span style="color: #000000; font-weight: bold;">@</span>iejoor:<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>hosts<span style="color: #000000; font-weight: bold;">/</span>purple<span style="color: #666666; font-style: italic;">#</span></div></div>
<p>Huh, where&#8217;s my console?<br />
Checking <code class="codecolorer text vibrant"><span class="text">xm list</span></code> it seemed to be there&#8230; but paused&#8230; and with constantly increasing ids. Waaait a minute!<br />
Checking the log files (<span style="color: #00FF00">xend.log</span> in this case) revealed a secret:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[2009-08-18 16:40:01 16116] DEBUG (DevController:162) Waiting for devices irq.<br />
[2009-08-18 16:40:01 16116] DEBUG (DevController:162) Waiting for devices vkbd.<br />
[2009-08-18 16:40:01 16116] DEBUG (DevController:162) Waiting for devices vfb.<br />
[2009-08-18 16:40:01 16116] DEBUG (DevController:162) Waiting for devices console.<br />
[2009-08-18 16:40:01 16116] DEBUG (DevController:167) Waiting for 0.<br />
[2009-08-18 16:40:01 16116] DEBUG (DevController:162) Waiting for devices pci.<br />
[2009-08-18 16:40:01 16116] DEBUG (DevController:162) Waiting for devices ioports.<br />
[2009-08-18 16:40:01 16116] DEBUG (DevController:162) Waiting for devices tap.<br />
[2009-08-18 16:40:01 16116] DEBUG (DevController:162) Waiting for devices vtpm.<br />
[2009-08-18 16:40:01 16116] INFO (XendDomain:1165) Domain purple (35) unpaused.<br />
[2009-08-18 16:40:01 16116] WARNING (XendDomainInfo:1240) Domain has crashed: name=purple id=35.<br />
[2009-08-18 16:40:01 16116] DEBUG (XendDomainInfo:1879) XendDomainInfo.destroy: domid=35<br />
[2009-08-18 16:40:01 16116] DEBUG (XendDomainInfo:1896) XendDomainInfo.destroyDomain(35)</div></div>
<p>Note the &#8216;WARNING&#8217; line. Crashed?!<br />
Gee, that&#8217;s &#8230; interesting. Why? Took me 5 minutes to find the other log file, but <span style="color: #FF0000">xend-debug.log</span> had a magic line:<br />
<code class="codecolorer bash vibrant"><span class="bash">ERROR Invalid kernel: xc_dom_find_loader: no loader found</span></code><br />
&#8230; great. Another why.<br />
In case you&#8217;re wondering, the increasing status in &#8216;xm list&#8217; was caused by the <code class="codecolorer bash vibrant"><span class="bash">on_crash = <span style="color: #ff0000;">'reboot'</span></span></code> line in the xen host config.<br />
I quickly destroyed the doman and changed it to a oneshot try: <code class="codecolorer bash vibrant"><span class="bash">on_crash = <span style="color: #ff0000;">'destroy'</span></span></code></p>
<p>After some searching another hint presented itself. Aren&#8217;t they nice?<br />
This hint was: &#8220;Xen is a retarded piece of cancer and can&#8217;t decypher the bzImage format, try vmlinux instead&#8221;. Aha!<br />
Back to the kernel, <code class="codecolorer text vibrant"><span class="text">make vmlinux</span></code>, copy, and another try to boot it. Obviously this was way too simple. It still crashed.<br />
Checking my old kernel that works for both dom0 and domU with file I noticed that gz should at least work.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># file /boot/vmlinuz-2.6*</span><br />
<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-2.6.18.8-xen: <span style="color: #c20cb9; font-weight: bold;">gzip</span> compressed data, from Unix, <span style="color: #c20cb9; font-weight: bold;">last</span> modified: Tue Nov <span style="color: #000000;">25</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">13</span>:<span style="color: #000000;">16</span> <span style="color: #000000;">2008</span>, max compression<br />
<span style="color: #000000; font-weight: bold;">/</span>boot<span style="color: #000000; font-weight: bold;">/</span>vmlinuz-new: ELF <span style="color: #000000;">32</span>-bit LSB executable, Intel <span style="color: #000000;">80386</span>, version <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>SYSV<span style="color: #7a0874; font-weight: bold;">&#41;</span>, statically linked, not stripped</div></div>
<p>Some more details about the crashing domains can be found using <code class="codecolorer text vibrant"><span class="text">xm dmesg</span></code><br />
It gave me something like:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> traps.c:<span style="color: #000000;">413</span>:d38 Unhandled general protection fault fault<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">trap</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #666666; font-style: italic;">#13] on VCPU 0 [ec=0000]</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> domain_crash_sync called from entry.S <span style="color: #7a0874; font-weight: bold;">&#40;</span>ff18928e<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> Domain <span style="color: #000000;">38</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>vcpu<span style="color: #666666; font-style: italic;">#0) crashed on cpu#3:</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> ----<span style="color: #7a0874; font-weight: bold;">&#91;</span> Xen-3.2.3 x86_32p &nbsp;<span style="color: #007800;">debug</span>=n &nbsp;Not tainted <span style="color: #7a0874; font-weight: bold;">&#93;</span>----<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> CPU: &nbsp; &nbsp;<span style="color: #000000;">3</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> EIP: &nbsp; &nbsp;e019:<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000; font-weight: bold;">&lt;</span>c03e9e60<span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> EFLAGS: 00000282 &nbsp; CONTEXT: guest<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> eax: 8000c068 &nbsp; ebx: c064c040 &nbsp; ecx: <span style="color: #000000;">80000000</span> &nbsp; edx: 00000cf8<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> esi: c0651f3c &nbsp; edi: c0651f30 &nbsp; ebp: c06981b8 &nbsp; esp: c0651f14<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> cr0: 8005003b &nbsp; cr4: 000006f0 &nbsp; cr3: 00bd5c80 &nbsp; cr2: 00000000<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> ds: e021 &nbsp; es: e021 &nbsp; fs: e021 &nbsp; <span style="color: #c20cb9; font-weight: bold;">gs</span>: e021 &nbsp; ss: e021 &nbsp; cs: e019<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> Guest stack trace from <span style="color: #007800;">esp</span>=c0651f14:<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;00000000 c03e9e60 0001e019 00010082 c04bd0cd 00000068 00000000 00000000<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;00002003 00000000 00003030 00000002 00000007 c064c07c c065dfd8 00000000<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c06423c0 c064c100 c0651fd8 c065a63f 00000005 00000000 00000000 00000000<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c065d02b 006faee4 00000000 00000000 c056dad4 00100000 00000000 00100000<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;00100000 00000000 006faee4 c065d27c 006faee4 00000000 00000000 c0651fe8<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;00000000 00000000 00000000 c0651fe8 00000000 00000000 c065756f c056dd50<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c04c5020 c0657073 c0651ff4 c065973e 00000000 <span style="color: #000000;">17898175</span> 00800001 03040800<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;00100f22 00000000 c08e0000 c04ba91b c04ba923 c0103371 c0103878 c0659a92<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c01039c7 c0103afc c0103d1a c0104004 c0104163 c01041eb c010451d c010457c<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c0659eb7 c0659ebf c04ba975 c04baa22 c0105536 c01055ae c0105781 c0105c5c<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c0105c9e c0106253 c0106345 c0106831 c010683d c0107b07 c010825e c0108333<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c065a45c c065a46a c0108e56 c065a982 c065a98a c0109bf0 c065af2c c065af93<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c065afe9 c065b042 c065b09b c065b0f4 c065b14d c065b1a6 c065b1ff c065b258<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c065b2b1 c065b32d c065b341 c065b397 c065b3f0 c065b449 c065c14f c065c157<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c010aee5 c010aef3 c010af77 c010af85 c065d7be c065d7d1 c010bdc3 c010be22<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c010c113 c010c14a c010c1c6 c010c2f3 c010c41a c010c443 c010c4dd c010d267<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c010d4cb c010d77b c010d782 c010de76 c010defd c010df0c c010df3f c010df49<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c010df84 c010df8c c010df94 c04bb1d7 c04bb466 c04bb4db c04bb5b9 c04bb60f<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c04bb62f c04bbb8b c04bbd60 c065de79 c065de81 c04bc041 c04bc46b c04bc50d<br />
<span style="color: #7a0874; font-weight: bold;">&#40;</span>XEN<span style="color: #7a0874; font-weight: bold;">&#41;</span> &nbsp; &nbsp;c04bc899 c04bc902 c065e012 c065e01a c065e028 c065e030 c065e038 c065e040</div></div>
<p>As you can see, that&#8217;s really useful&#8230;.. <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>A useful page with some info can be found <a href="http://wiki.xensource.com/xenwiki/XenParavirtOps">here</a>. It confirms that a gz kernel should work (but bz probably doesn&#8217;t) since I&#8217;m still running Xen 3.2. However, I can&#8217;t find a good reason for why it won&#8217;t work.</p>
<p>Google to the rescue! Hard to find a useful keyword, since most xen kernel issues seem to be similar, but eventually I found this tidbit:<br />
<a href="http://patchwork.kernel.org/patch/36570/">tiny kernel patch</a>.<br />
Weird that this should be needed, one would hope that basic shit like this would work after 8 kernel versions, but obviously they&#8217;re all retards when it comes to this.<br />
Thanks Jeremy Fitzhardinge for the patch!<br />
Just for quick reference, this is the actual patch:</p>
<div class="codecolorer-container diff vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="diff codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c<br />
index 28e5f59..e2485b0 <span style="">100644</span><br />
<span style="color: #888822;">--- a/arch/x86/kernel/cpu/amd.c</span><br />
<span style="color: #888822;">+++ b/arch/x86/kernel/cpu/amd.c</span><br />
<span style="color: #440088;">@@ -356,7 +356,7 @@ &nbsp;static void __cpuinit early_init_amd<span style="">&#40;</span>struct cpuinfo_x86 *c<span style="">&#41;</span></span><br />
&nbsp;#endif<br />
&nbsp;#if defined<span style="">&#40;</span>CONFIG_X86_LOCAL_APIC<span style="">&#41;</span> &amp;&amp; defined<span style="">&#40;</span>CONFIG_PCI<span style="">&#41;</span><br />
&nbsp; &nbsp; /* check CPU config space for extended APIC ID */<br />
<span style="color: #991111;">- &nbsp; if <span style="">&#40;</span>c-&gt;x86 &gt;= 0xf<span style="">&#41;</span> <span style="">&#123;</span></span><br />
<span style="color: #00b000;">+ &nbsp; if <span style="">&#40;</span>cpu_has_apic &amp;&amp; c-&gt;x86 &gt;= 0xf<span style="">&#41;</span> <span style="">&#123;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; unsigned int val;<br />
&nbsp; &nbsp; &nbsp; &nbsp; val = read_pci_config<span style="">&#40;</span><span style="">0</span>, <span style="">24</span>, <span style="">0</span>, 0x68<span style="">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; if <span style="">&#40;</span><span style="">&#40;</span>val &amp; <span style="">&#40;</span><span style="">&#40;</span><span style="">1</span> &lt;&lt; <span style="">17</span><span style="">&#41;</span> | <span style="">&#40;</span><span style="">1</span> &lt;&lt; <span style="">18</span><span style="">&#41;</span><span style="">&#41;</span><span style="">&#41;</span> == <span style="">&#40;</span><span style="">&#40;</span><span style="">1</span> &lt;&lt; <span style="">17</span><span style="">&#41;</span> | <span style="">&#40;</span><span style="">1</span> &lt;&lt; <span style="">18</span><span style="">&#41;</span><span style="">&#41;</span><span style="">&#41;</span></div></div>
<p>So much for &#8216;vanilla&#8217;.</p>
<p>However, it boots now:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root<span style="color: #000000; font-weight: bold;">@</span>iejoor:<span style="color: #000000; font-weight: bold;">/</span>xen<span style="color: #000000; font-weight: bold;">/</span>hosts<span style="color: #000000; font-weight: bold;">/</span>purple<span style="color: #666666; font-style: italic;"># xm create -c purple.cfg-newkernel</span><br />
Using config <span style="color: #c20cb9; font-weight: bold;">file</span> <span style="color: #ff0000;">&quot;./purple.cfg-newkernel&quot;</span>.<br />
Started domain purple<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Reserving virtual address space above 0xf5800000<br />
Linux version 2.6.30.5-jemoeder <span style="color: #7a0874; font-weight: bold;">&#40;</span>root<span style="color: #000000; font-weight: bold;">@</span>iejoor<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #c20cb9; font-weight: bold;">gcc</span> version 4.1.2<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #666666; font-style: italic;">#9 SMP Tue Aug 18 22:59:38 CEST 2009</span><br />
KERNEL supported cpus:<br />
&nbsp; Intel GenuineIntel<br />
&nbsp; AMD AuthenticAMD<br />
&nbsp; NSC Geode by NSC<br />
&nbsp; Cyrix CyrixInstead<br />
&nbsp; Centaur CentaurHauls &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; Transmeta GenuineTMx86 &nbsp; &nbsp; &nbsp; <br />
&nbsp; Transmeta TransmetaCPU &nbsp; &nbsp; &nbsp; <br />
&nbsp; UMC UMC UMC UMC &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
ACPI <span style="color: #000000; font-weight: bold;">in</span> unprivileged domain disabled</div></div>
<p>and a lot more yadieyada until it hits a new wall: root device.<br />
Well, that sounds solvable.</p>
<p>In fact, here&#8217;s a solution. What you say?<br />
&#8220;<span style="color: #FF00FF">AAAAH, I GET NOTHING, IT WON&#8217;T EVEN CRASH ANYMORE, JUST NO OUTPUT???!</span>&#8221;<br />
Ah yeah, I forgot to mention: they changed the console device as well as the block device. So here&#8217;s a solution for both issues:<br />
Edit your xen host config file and make it so:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">root = <span style="color: #ff0000;">&quot;/dev/xvda1 ro&quot;</span><br />
extra = <span style="color: #ff0000;">&quot;xencons=hvc0&quot;</span></div></div>
<p>(xvda1 is what used to be sda1, you can figure out the rest).</p>
<p>And after all this: HAHA! Success is mine!<br />
Except of course for the undeniable fact that my domU has a fucked up fstab and all, but no issues there <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Now go mess up your own system! Oh, I see&#8230; you already did. Good luck fixing it <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<h2>Update</h2>
<p>I just tested a testing kernel &#8212; 2.6.31-rc8, and it seems like they fixed it. Probably has been fixed in the testing branch for quite a while now, but still not in stable 2.6.30 <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Let&#8217;s hope they release 2.6.31 soon.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/xen-and-booting-domu-using-a-vanilla-kernel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
