<?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; kernel</title>
	<atom:link href="http://notes.benv.junerules.com/tag/kernel/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>Missing /dev/sd* in slackware 13</title>
		<link>http://notes.benv.junerules.com/all/software/missing-devsd-in-slackware-13/</link>
		<comments>http://notes.benv.junerules.com/all/software/missing-devsd-in-slackware-13/#comments</comments>
		<pubDate>Sun, 11 Jul 2010 13:09:49 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[slackware]]></category>
		<category><![CDATA[udev]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=825</guid>
		<description><![CDATA[I&#8217;ve bashed my head into this problem at least three times now, so after finally running to google &#8230;. it made me search more than I liked. The problem descriptions: * Your system boots fine (maybe because it&#8217;s running on software raid), but your /dev/sd* files are gone. * Your system doesn&#8217;t boot anymore, complaining [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve bashed my head into this problem at least three times now, so after finally running to google &#8230;. it made me search more than I liked.</p>
<p>The problem descriptions:<br />
 * Your system boots fine (maybe because it&#8217;s running on software raid), but your <span style="color:#F00">/dev/sd*</span> files are gone.<br />
 * Your system doesn&#8217;t boot anymore, complaining about not finding your boot device when booting your custom kernel, but the stock kernel does work.<br />
 * Mounting partitions doesn&#8217;t work anymore, saying stuff like <code class="codecolorer text vibrant"><span class="text">mount: special device /dev/sda does not exist</span></code></p>
<p>Reason:<br />
 * Your custom kernel has CONFIG_SYSFS_DEPRECATED enabled. To find out:</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">benv@uil$ zcat /proc/config.gz | grep CONFIG_SYSFS_DEPRECATED<br />
CONFIG_SYSFS_DEPRECATED=y</div></div>
<p>Since udev version 151 (or something close to that) this will sparsely populate /dev. Yay.</p>
<p>If you don&#8217;t believe it, check out <span style="color:#FF0">/usr/share/doc/udev-*/README</span>:</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">&nbsp; - Udev will not work with the CONFIG_SYSFS_DEPRECATED* option.</div></div>
<p>Another problem solved.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/missing-devsd-in-slackware-13/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NFS issues</title>
		<link>http://notes.benv.junerules.com/all/software/nfs-issues/</link>
		<comments>http://notes.benv.junerules.com/all/software/nfs-issues/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 18:54:04 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Morons]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[nfs]]></category>
		<category><![CDATA[slackware]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=379</guid>
		<description><![CDATA[Yesterday evening after getting tired of playing the Aion open beta (it was the last night of the open beta, so we felt like at least reaching level 10, which we did&#8230; and then we could ~FLYYYY) we decided to go downstairs to watch some series on our beamer. So we fire up the machine [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday evening after getting tired of playing the Aion open beta (it was the last night of the open beta, so we felt like at least reaching level 10, which we did&#8230; and then we could ~FLYYYY) we decided to go downstairs to watch some series on our beamer. So we fire up the machine connected to it, which runs everything from <a href="http://nl.wikipedia.org/wiki/Network_File_System">NFS</a>. It didn&#8217;t take long for the boot screen to come up and after the default selection was made for us it ran through the boot process spewing out the usual kernel messages&#8230;..<span id="more-379"></span><br />
Until it ran into 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">Looking up port of RPC <span style="color: #000000;">100003</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">2</span> on 192.168.1.1<br />
Looking up port of RPC <span style="color: #000000;">100005</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1</span> on 192.168.1.1<br />
VFS: Mounted root <span style="color: #7a0874; font-weight: bold;">&#40;</span>nfs filesystem<span style="color: #7a0874; font-weight: bold;">&#41;</span> on device <span style="color: #000000;">0</span>:<span style="color: #000000;">14</span><br />
Freeing unused kernel memory: 412k freed<br />
INIT: version <span style="color: #000000;">2.86</span> booting<br />
nfs: server 192.168.1.1 not responding, still trying</div></div>
<p>&#8230; huh? What&#8217;s taking so long? Our server with issues? That&#8217;s unlikely since I still used it 5 minutes earlier. After checking out the NFS server and deciding nothing was wrong with it (or at least, it didn&#8217;t look like it) I got fed up with it and went to bed.<br />
Don&#8217;t you hate it when stuff stops working just when you&#8217;re tired and want to go to sleep? Fortunately for me this is our own internal problem so I could actually do so <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>Today I decided to go find out what the hell was wrong with it. So again I booted the machine to find out the above kernel messages.<br />
Time for some tcpdump on the nfs server to see if that can shine some light on this situation. (needless to say there were no useful log entries anywhere).<br />
Tcpdump:</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: #000000;">18</span>:<span style="color: #000000;">27</span>:<span style="color: #000000;">51.931303</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">132</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 193.168.1.9.1304809574 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.1.2049: <span style="color: #000000;">104</span> getattr fh Unknown<span style="color: #000000; font-weight: bold;">/</span>010004014D00460054C8D81757072101679D7E1B000000000000000000000000<br />
<span style="color: #000000;">18</span>:<span style="color: #000000;">27</span>:<span style="color: #000000;">51.931402</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">124</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 192.168.1.1.2049 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.9.1304809574: reply ok <span style="color: #000000;">96</span> getattr DIR <span style="color: #000000;">40755</span> ids <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0</span> sz <span style="color: #000000;">69632</span><br />
<span style="color: #000000;">18</span>:<span style="color: #000000;">27</span>:<span style="color: #000000;">55.725726</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">140</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 192.168.1.9.3787772006 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.1.2049: <span style="color: #000000;">112</span> lookup fh Unknown<span style="color: #000000; font-weight: bold;">/</span>010004004D00460054C8D8170000000000000000000000000000000000000000 <span style="color: #ff0000;">&quot;proc&quot;</span><br />
<span style="color: #000000;">18</span>:<span style="color: #000000;">27</span>:<span style="color: #000000;">56.825633</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">140</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 192.168.1.9.3787772006 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.1.2049: <span style="color: #000000;">112</span> lookup fh Unknown<span style="color: #000000; font-weight: bold;">/</span>010004004D00460054C8D8170000000000000000000000000000000000000000 <span style="color: #ff0000;">&quot;proc&quot;</span><br />
<span style="color: #000000;">18</span>:<span style="color: #000000;">27</span>:<span style="color: #000000;">59.025453</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">140</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 192.168.1.9.3787772006 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.1.2049: <span style="color: #000000;">112</span> lookup fh Unknown<span style="color: #000000; font-weight: bold;">/</span>010004004D00460054C8D8170000000000000000000000000000000000000000 <span style="color: #ff0000;">&quot;proc&quot;</span><br />
<span style="color: #000000;">18</span>:<span style="color: #000000;">28</span>:<span style="color: #000000;">03.425078</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">140</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 192.168.1.9.3787772006 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.1.2049: <span style="color: #000000;">112</span> lookup fh Unknown<span style="color: #000000; font-weight: bold;">/</span>010004004D00460054C8D8170000000000000000000000000000000000000000 <span style="color: #ff0000;">&quot;proc&quot;</span><br />
<span style="color: #000000;">18</span>:<span style="color: #000000;">28</span>:<span style="color: #000000;">12.224347</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">140</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 192.168.1.9.3787772006 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.1.2049: <span style="color: #000000;">112</span> lookup fh Unknown<span style="color: #000000; font-weight: bold;">/</span>010004004D00460054C8D8170000000000000000000000000000000000000000 <span style="color: #ff0000;">&quot;proc&quot;</span><br />
<span style="color: #000000;">18</span>:<span style="color: #000000;">28</span>:<span style="color: #000000;">13.324257</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">140</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 192.168.1.9.3787772006 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.1.2049: <span style="color: #000000;">112</span> lookup fh Unknown<span style="color: #000000; font-weight: bold;">/</span>010004004D00460054C8D8170000000000000000000000000000000000000000 <span style="color: #ff0000;">&quot;proc&quot;</span><br />
<span style="color: #000000;">18</span>:<span style="color: #000000;">28</span>:<span style="color: #000000;">15.524071</span> IP <span style="color: #7a0874; font-weight: bold;">&#40;</span>tos 0x0, ttl <span style="color: #000000;">64</span>, <span style="color: #c20cb9; font-weight: bold;">id</span> <span style="color: #000000;">0</span>, offset <span style="color: #000000;">0</span>, flags <span style="color: #7a0874; font-weight: bold;">&#91;</span>DF<span style="color: #7a0874; font-weight: bold;">&#93;</span>, proto UDP <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">17</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>, length <span style="color: #000000;">140</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp; &nbsp; 192.168.1.9.3787772006 <span style="color: #000000; font-weight: bold;">&gt;</span> 192.168.1.1.2049: <span style="color: #000000;">112</span> lookup fh Unknown<span style="color: #000000; font-weight: bold;">/</span>010004004D00460054C8D8170000000000000000000000000000000000000000 <span style="color: #ff0000;">&quot;proc&quot;</span></div></div>
<p>Hmm, interesting. The first request seems to &#8220;work&#8221; (read: it receives an answer) while the rest of the messages are somehow ignored. Wonder why&#8230;<br />
Just to make sure I checked the firewall on the server, which should allow pretty much everything:</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>uil<span style="color: #666666; font-style: italic;"># iptables -L -v -n</span><br />
Chain INPUT <span style="color: #7a0874; font-weight: bold;">&#40;</span>policy ACCEPT 198M packets, 89G bytes<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp;pkts bytes target &nbsp; &nbsp; prot opt <span style="color: #000000; font-weight: bold;">in</span> &nbsp; &nbsp; out &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">source</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destination<br />
<br />
Chain FORWARD <span style="color: #7a0874; font-weight: bold;">&#40;</span>policy ACCEPT <span style="color: #000000;">0</span> packets, <span style="color: #000000;">0</span> bytes<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp;pkts bytes target &nbsp; &nbsp; prot opt <span style="color: #000000; font-weight: bold;">in</span> &nbsp; &nbsp; out &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">source</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destination<br />
<br />
Chain OUTPUT <span style="color: #7a0874; font-weight: bold;">&#40;</span>policy ACCEPT 228M packets, 166G bytes<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
&nbsp;pkts bytes target &nbsp; &nbsp; prot opt <span style="color: #000000; font-weight: bold;">in</span> &nbsp; &nbsp; out &nbsp; &nbsp; <span style="color: #7a0874; font-weight: bold;">source</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; destination</div></div>
<p>Well, that seems to be true. Maybe something weird in the mount options? Let&#8217;s see the <span style="color:#FF00FF">/etc/fstab</span> for the NFS client:</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>teigetje<span style="color: #666666; font-style: italic;"># cat /etc/fstab</span><br />
192.168.1.1:<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>general_stores2<span style="color: #000000; font-weight: bold;">/</span>teigetje &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">/</span> &nbsp; &nbsp; &nbsp; nfs &nbsp; &nbsp; <span style="color: #007800;">rsize</span>=<span style="color: #000000;">8192</span>,<span style="color: #007800;">wsize</span>=<span style="color: #000000;">8192</span>,<span style="color: #007800;">nfsvers</span>=<span style="color: #000000;">3</span> <span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp; <span style="color: #000000;">0</span><br />
proc &nbsp; &nbsp;<span style="color: #000000; font-weight: bold;">/</span>proc &nbsp; proc &nbsp; &nbsp;defaults &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp; <span style="color: #000000;">0</span><br />
tmpfs &nbsp; <span style="color: #000000; font-weight: bold;">/</span>dev<span style="color: #000000; font-weight: bold;">/</span>shm &nbsp; &nbsp; &nbsp; &nbsp;tmpfs &nbsp; defaults &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp; <span style="color: #000000;">0</span><br />
tmpfs &nbsp; <span style="color: #000000; font-weight: bold;">/</span>tmp &nbsp; &nbsp;tmpfs &nbsp; defaults &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">0</span> &nbsp; &nbsp; &nbsp; <span style="color: #000000;">0</span></div></div>
<p>Nothing weird&#8230; or is there? After messing around with it for a bit I decided it really wasn&#8217;t anything in there.<br />
Time to do a test on a different machine in the network. On my workstation I tried to mount the root path after giving myself permissions and re-exporting the nfs paths:</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>janeman:<span style="color: #000000; font-weight: bold;">/</span>mnt:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> <span style="color: #007800;">rsize</span>=<span style="color: #000000;">8192</span>,<span style="color: #007800;">wsize</span>=<span style="color: #000000;">8192</span>,<span style="color: #007800;">nfsvers</span>=<span style="color: #000000;">3</span> 192.168.1.1:<span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>general_stores2<span style="color: #000000; font-weight: bold;">/</span>teigetje tmp<br />
root<span style="color: #000000; font-weight: bold;">@</span>janeman:<span style="color: #000000; font-weight: bold;">/</span>mnt:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-al</span> tmp<br />
<span style="color: #000000; font-weight: bold;">*</span>stuck<span style="color: #000000; font-weight: bold;">*</span></div></div>
<p>And there it was, being stuck for what seems to be forever. So in other words: the mount worked, but then it doesn&#8217;t respond for the ls command. What&#8230; the&#8230; fuck.<br />
Mind boggling, while the logs on the nfs server gave no hints at all. (as usual).<br />
To make this even more interesting, there is another export on that same nfs server that most workstation use, called <span style="color:#00FFFF">general_stores</span>. (to access the music collection etc).<br />
Can&#8217;t remember that being broken&#8230;. let&#8217;s test:</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">benv<span style="color: #000000; font-weight: bold;">@</span>janeman:~:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #660033;">-lad</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>general_stores<span style="color: #000000; font-weight: bold;">/</span>.<br />
drwxr-xr-x <span style="color: #000000;">14</span> root root <span style="color: #000000;">4096</span> Aug <span style="color: #000000;">25</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">58</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>general_stores<span style="color: #000000; font-weight: bold;">/</span>.<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>How can this be?! This mount works fine while the other doesn&#8217;t? What the hell is so special about that NFS client&#8217;s export?</p>
<p>And then it hit me.</p>
<p>*<span style="color:#FF0011">WHACK</span>*<br />
(ouch)</p>
<p>The window that I had open with the <span style="color:#FFF011">ls -al tmp</span> suddenly decided to work. It gave this listing:</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: #c20cb9; font-weight: bold;">ls</span>: cannot access tmp<span style="color: #000000; font-weight: bold;">/</span>proc: Input<span style="color: #000000; font-weight: bold;">/</span>output error<br />
total <span style="color: #000000;">164</span><br />
drwxr-xr-x <span style="color: #000000;">21</span> root root &nbsp;<span style="color: #000000;">4096</span> Sep <span style="color: #000000;">14</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">14</span> .<br />
drwxr-xr-x <span style="color: #000000;">12</span> root root &nbsp;<span style="color: #000000;">4096</span> Sep <span style="color: #000000;">26</span> &nbsp;<span style="color: #000000;">2006</span> ..<br />
drwxr-xr-x &nbsp;<span style="color: #000000;">2</span> root root &nbsp;<span style="color: #000000;">4096</span> Sep <span style="color: #000000;">14</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">14</span> bin<br />
drwxr-xr-x <span style="color: #000000;">13</span> root root &nbsp;<span style="color: #000000;">4096</span> Sep <span style="color: #000000;">14</span> <span style="color: #000000;">18</span>:05 boot<br />
drwxr-xr-x <span style="color: #000000;">17</span> root root <span style="color: #000000;">69632</span> Oct &nbsp;<span style="color: #000000;">6</span> &nbsp;<span style="color: #000000;">1997</span> dev<br />
drwxr-xr-x <span style="color: #000000;">71</span> root root <span style="color: #000000;">12288</span> Sep <span style="color: #000000;">14</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">24</span> etc<br />
drwxr-xr-x &nbsp;<span style="color: #000000;">5</span> root root &nbsp;<span style="color: #000000;">4096</span> Oct &nbsp;<span style="color: #000000;">6</span> &nbsp;<span style="color: #000000;">1997</span> home<br />
drwxr-xr-x &nbsp;<span style="color: #000000;">6</span> root root <span style="color: #000000;">12288</span> Sep <span style="color: #000000;">14</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">11</span> lib<br />
drwxr-xr-x <span style="color: #000000;">16</span> root root &nbsp;<span style="color: #000000;">4096</span> Sep <span style="color: #000000;">14</span> <span style="color: #000000;">16</span>:<span style="color: #000000;">47</span> media<br />
drwxr-xr-x <span style="color: #000000;">12</span> root root &nbsp;<span style="color: #000000;">4096</span> Sep <span style="color: #000000;">26</span> &nbsp;<span style="color: #000000;">2006</span> mnt<br />
drwxr-xr-x &nbsp;<span style="color: #000000;">9</span> root root &nbsp;<span style="color: #000000;">4096</span> Jun <span style="color: #000000;">10</span> &nbsp;<span style="color: #000000;">2007</span> opt<br />
?????????? &nbsp;? ? &nbsp; &nbsp;? &nbsp; &nbsp; &nbsp; &nbsp;? &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;? proc<br />
drwx--x--- <span style="color: #000000;">28</span> root root &nbsp;<span style="color: #000000;">4096</span> Sep <span style="color: #000000;">14</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">24</span> root<br />
drwxr-xr-x &nbsp;<span style="color: #000000;">2</span> root root &nbsp;<span style="color: #000000;">4096</span> Jun <span style="color: #000000;">14</span> 05:<span style="color: #000000;">35</span> sbin<br />
drwxr-xr-x &nbsp;<span style="color: #000000;">2</span> root root &nbsp;<span style="color: #000000;">4096</span> Apr &nbsp;<span style="color: #000000;">8</span> &nbsp;<span style="color: #000000;">2007</span> srv<br />
drwxr-xr-x &nbsp;<span style="color: #000000;">2</span> root root &nbsp;<span style="color: #000000;">4096</span> May <span style="color: #000000;">12</span> &nbsp;<span style="color: #000000;">2004</span> sys<br />
drwxrwxrwt &nbsp;<span style="color: #000000;">4</span> root root &nbsp;<span style="color: #000000;">4096</span> Sep <span style="color: #000000;">14</span> <span style="color: #000000;">18</span>:<span style="color: #000000;">17</span> tmp<br />
drwxr-xr-x <span style="color: #000000;">19</span> root root &nbsp;<span style="color: #000000;">4096</span> Jul <span style="color: #000000;">16</span> 02:<span style="color: #000000;">22</span> usr<br />
drwxr-xr-x <span style="color: #000000;">19</span> root root &nbsp;<span style="color: #000000;">4096</span> Aug &nbsp;<span style="color: #000000;">4</span> 01:<span style="color: #000000;">52</span> var</div></div>
<p>Doh! /proc &#8230; of course that&#8217;s the problem! That&#8217;s why tcpdump showed the &#8220;proc&#8221; entries!</p>
<p>But why?</p>
<p>Well, recently I moved some disks around and added a &#8216;<span style="color:#F00FFF">crossmnt</span>&#8216; option in the <span style="color:#FF00FF">/etc/exports</span> file on the NFS server.<br />
This option gives the nfs clients the ability to cross mount borders, so for example if I have this on the nfs server:<br />
 * /mnt/disk with device /dev/sda1 mounted there<br />
 * /mnt/disk/stuff with device /dev/sdb1 mounted there<br />
And then export /mnt/disk and mount it on my nfs client, I can see /mnt/disk/stuff with its contents because of the crossmnt option. Without that option the directory would be empty on nfs clients.</p>
<p>So how does this relate to proc? Well, since proc is &#8220;special&#8221; it has a ton of special files that nfs can&#8217;t deal with and therefore can not export.<br />
Now normally this wouldn&#8217;t be an issue, since it shouldn&#8217;t be mounted in the first place (the nfs server has its own /proc, the nfs cilent mounts its own version so it only needs a  place to mount it on). However, a little earlier my girly friend mounted it &#8220;because she had to build <a href="http://www.enlightenment.org/">E</a>&#8220;. Don&#8217;t ask.<br />
E again&#8230;. always the same&#8230; <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
After unmounting the proc dir and rebooting the NFS client it had no more problems and booted fine.</p>
<p>Conclusion:<br />
NFS can&#8217;t deal with proc. Don&#8217;t hide a mounted procfs in your nfs exports.<br />
NFS sucks because of stuff like this, but I haven&#8217;t found anything better so far. Guess we&#8217;ll stick with it for now.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/nfs-issues/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Pokemon OS, rsync/ssh and MAC</title>
		<link>http://notes.benv.junerules.com/all/software/pokemon-os-rsyncssh-and-mac/</link>
		<comments>http://notes.benv.junerules.com/all/software/pokemon-os-rsyncssh-and-mac/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 10:26:14 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[pokemon os]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=360</guid>
		<description><![CDATA[So yesterday at work I ran into the famous ssh MAC failure like this: wouter@wouter-laptop:~:0&#62; rsync -varP ./vmware/ wouter@192.168.1.2:/archive/archive2/programs/vmware/ Password: sending incremental file list ./ Keys &#160; &#160; &#160; &#160; &#160;116 100% &#160; &#160;0.00kB/s &#160; &#160;0:00:00 &#40;xfer#1, to-check=8/10) linux/ linux/VMware-server-2.0.1-156745.i386.tar.gz &#160; &#160; &#160; &#160;32768 &#160; 0% &#160;800.00kB/s &#160; &#160;0:10:11 &#160;Received disconnect from 192.168.1.2: 2: Corrupted [...]]]></description>
			<content:encoded><![CDATA[<p>So yesterday at work I ran into the famous ssh <span style="color:#FF00FF">MAC</span> failure 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">wouter<span style="color: #000000; font-weight: bold;">@</span>wouter-laptop:~:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span> rsync <span style="color: #660033;">-varP</span> .<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span> wouter<span style="color: #000000; font-weight: bold;">@</span>192.168.1.2:<span style="color: #000000; font-weight: bold;">/</span>archive<span style="color: #000000; font-weight: bold;">/</span>archive2<span style="color: #000000; font-weight: bold;">/</span>programs<span style="color: #000000; font-weight: bold;">/</span>vmware<span style="color: #000000; font-weight: bold;">/</span><br />
Password: <br />
sending incremental <span style="color: #c20cb9; font-weight: bold;">file</span> list<br />
.<span style="color: #000000; font-weight: bold;">/</span><br />
Keys<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">116</span> <span style="color: #000000;">100</span><span style="color: #000000; font-weight: bold;">%</span> &nbsp; &nbsp;0.00kB<span style="color: #000000; font-weight: bold;">/</span>s &nbsp; &nbsp;<span style="color: #000000;">0</span>:00:00 <span style="color: #7a0874; font-weight: bold;">&#40;</span>xfer<span style="color: #666666; font-style: italic;">#1, to-check=8/10)</span><br />
linux<span style="color: #000000; font-weight: bold;">/</span><br />
linux<span style="color: #000000; font-weight: bold;">/</span>VMware-server-2.0.1-<span style="color: #000000;">156745</span>.i386.tar.gz<br />
&nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">32768</span> &nbsp; <span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">%</span> &nbsp;800.00kB<span style="color: #000000; font-weight: bold;">/</span>s &nbsp; &nbsp;<span style="color: #000000;">0</span>:<span style="color: #000000;">10</span>:<span style="color: #000000;">11</span> &nbsp;Received disconnect from 192.168.1.2: <span style="color: #000000;">2</span>: Corrupted MAC on input.<br />
<br />
rsync: writefd_unbuffered failed to <span style="color: #c20cb9; font-weight: bold;">write</span> <span style="color: #000000;">4</span> bytes to socket <span style="color: #7a0874; font-weight: bold;">&#91;</span>sender<span style="color: #7a0874; font-weight: bold;">&#93;</span>: Broken pipe <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">32</span><span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
rsync: connection unexpectedly closed <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">53</span> bytes received so far<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>sender<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
rsync error: error <span style="color: #000000; font-weight: bold;">in</span> rsync protocol data stream <span style="color: #7a0874; font-weight: bold;">&#40;</span>code <span style="color: #000000;">12</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> at io.c<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">600</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #007800;">sender</span>=3.0.6<span style="color: #7a0874; font-weight: bold;">&#93;</span></div></div>
<p>No, that has nothing to do with <a href="http://www.apple.com/">Apple/Mac computers</a> or <a href="http://en.wikipedia.org/wiki/MAC_address">Media Access Control</a>, it&#8217;s<br />
part of the SSH protocol (and others) called <a href="http://en.wikipedia.org/wiki/Message_authentication_code">Messenge Authentication Code</a>. This blog has a nice explanation: <a href="http://blogs.sun.com/janp/entry/ssh_messages_code_bad_packet">Jan Pechanec on SSH messages</a>.</p>
<p>Funny thing, my brother also had this exact issue with the same kind of laptop. Well&#8230;. in his case it was putty failing his connection from a windows machine to this laptop.<br />
The reason? Same as ever,  <span style="color:#FFFF00">checksum offloading</span>.<br />
You can check if your card does this with the  <span style="color:#00FFFF">ethtool</span> program:</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">wouter<span style="color: #000000; font-weight: bold;">@</span>wouter-laptop:~:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> ethtool <span style="color: #660033;">-k</span> eth0<br />
Offload parameters <span style="color: #000000; font-weight: bold;">for</span> eth0:<br />
Cannot get device flags: Operation not supported<br />
rx-checksumming: on<br />
tx-checksumming: on<br />
scatter-gather: on<br />
tcp-segmentation-offload: off<br />
udp-fragmentation-offload: off<br />
generic-segmentation-offload: on<br />
generic-receive-offload: off<br />
large-receive-offload: off</div></div>
<p>And the fix for 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">wouter<span style="color: #000000; font-weight: bold;">@</span>wouter-laptop:~:<span style="color: #000000;">85</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #c20cb9; font-weight: bold;">sudo</span> &nbsp;ethtool <span style="color: #660033;">-K</span> eth0 tx off</div></div>
<p>Fixed.</p>
<p>&#8221; <span style="color:#000FFF">Wait, what does Pokemon OS have to do with this?</span>&#8221;<br />
Well, isn&#8217;t that obvious? It&#8217;s supposed to magically work, and it doesn&#8217;t! <img src='http://notes.benv.junerules.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /><br />
Probably more a kernel thing though&#8230; oh well.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/pokemon-os-rsyncssh-and-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>P4-Clockfuck</title>
		<link>http://notes.benv.junerules.com/all/software/p4-clockfuck/</link>
		<comments>http://notes.benv.junerules.com/all/software/p4-clockfuck/#comments</comments>
		<pubDate>Wed, 02 Sep 2009 22:27:22 +0000</pubDate>
		<dc:creator>BenV</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[kernel]]></category>
		<category><![CDATA[p4-clockmod]]></category>
		<category><![CDATA[powersave]]></category>

		<guid isPermaLink="false">http://notes.benv.junerules.com/?p=349</guid>
		<description><![CDATA[You know what&#8217;s really annoying? Try this: root@Uil:/sys/devices/system/cpu/cpu0/cpufreq:0&#62;echo ondemand &#62; scaling_governor root@Uil:/sys/devices/system/cpu/cpu0/cpufreq:0&#62;dmesg &#91;1325843.712549&#93; ondemand governor failed, too long transition latency of HW, fallback to performance governor Apparently this is caused by the p4-clockmod module. You know, this piece of junk: Also known as &#8220;CONFIG_X86_P4_CLOCKMOD&#8220;. The reason? Well, the ondemand and the conservative governors want to [...]]]></description>
			<content:encoded><![CDATA[<p>You know what&#8217;s really annoying?</p>
<p>Try 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>Uil:<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>cpu<span style="color: #000000; font-weight: bold;">/</span>cpu0<span style="color: #000000; font-weight: bold;">/</span>cpufreq:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #7a0874; font-weight: bold;">echo</span> ondemand <span style="color: #000000; font-weight: bold;">&gt;</span> scaling_governor <br />
root<span style="color: #000000; font-weight: bold;">@</span>Uil:<span style="color: #000000; font-weight: bold;">/</span>sys<span style="color: #000000; font-weight: bold;">/</span>devices<span style="color: #000000; font-weight: bold;">/</span>system<span style="color: #000000; font-weight: bold;">/</span>cpu<span style="color: #000000; font-weight: bold;">/</span>cpu0<span style="color: #000000; font-weight: bold;">/</span>cpufreq:<span style="color: #000000;">0</span><span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #c20cb9; font-weight: bold;">dmesg</span><br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">1325843.712549</span><span style="color: #7a0874; font-weight: bold;">&#93;</span> ondemand governor failed, too long transition latency of HW, fallback to performance governor</div></div>
<p>Apparently this is caused by the <span style="color:#FF00FF">p4-clockmod</span> module.<br />
You know, this piece of junk:<br />
<div id="attachment_350" class="wp-caption alignnone" style="width: 390px"><a href="http://notes.benv.junerules.com/wp-content/uploads/2009/09/p4-clockmod.png"><img src="http://notes.benv.junerules.com/wp-content/uploads/2009/09/p4-clockmod.png" alt="p4-clockmod" title="p4-clockmod" width="380" height="30" class="size-full wp-image-350" /></a><p class="wp-caption-text">p4-clockmod</p></div><br />
Also known as &#8220;<span style="color:#00FFFF">CONFIG_X86_P4_CLOCKMOD</span>&#8220;.</p>
<p>The reason?<br />
Well, the ondemand and the conservative governors want to be able to switch to a different speed before their calculations become invalid.<br />
The p4-clockmod thing apparently makes the latency of switching so <b>BIG </b> that it becomes impossible. Or so they think.<br />
Which leaves only the sucky powersave and performance governors. (and of course userspace).</p>
<p>The kernel menuconfig help states:</p>
<blockquote><p>This driver should be only used in exceptional<br />
circumstances when very low power is needed because it causes severe<br />
slowdowns and noticeable latencies.  Normally Speedstep should be used<br />
instead.</p></blockquote>
<p>Lovely. I&#8217;ll keep that in mind, thanks.<br />
*enables <span style="color:#00FFFF">CONFIG_X86_ACPI_CPUFREQ</span> instead*</p>
<p>Note that when they&#8217;re both compiled in (as opposed to modules) the retarded thing seems to go for the clockmod. Just great.</p>
]]></content:encoded>
			<wfw:commentRss>http://notes.benv.junerules.com/all/software/p4-clockfuck/feed/</wfw:commentRss>
		<slash:comments>1</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>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>
