<?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>user_mode_linux &#8211; richliu&#039;s blog</title>
	<atom:link href="https://richliu.com/tag/user_mode_linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://richliu.com</link>
	<description>Linux, 工作, 生活, 家人</description>
	<lastBuildDate>Thu, 12 Apr 2007 03:19:12 +0000</lastBuildDate>
	<language>zh-TW</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>User mode linux 懶人包.</title>
		<link>https://richliu.com/2007/04/09/459/user-mode-linux-%e6%87%b6%e4%ba%ba%e5%8c%85/</link>
					<comments>https://richliu.com/2007/04/09/459/user-mode-linux-%e6%87%b6%e4%ba%ba%e5%8c%85/#comments</comments>
		
		<dc:creator><![CDATA[richliu]]></dc:creator>
		<pubDate>Mon, 09 Apr 2007 09:02:05 +0000</pubDate>
				<category><![CDATA[Gentoo]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[user_mode_linux]]></category>
		<guid isPermaLink="false">https://richliu.com/2007/04/09/459/</guid>

					<description><![CDATA[<p>前一陣子想要 Try User Mode Linux, 不過萬事起頭難, 怎麼樣弄 console 就是不會出 [&#8230;]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2007/04/09/459/user-mode-linux-%e6%87%b6%e4%ba%ba%e5%8c%85/">User mode linux 懶人包.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>前一陣子想要 Try  <a href="http://user-mode-linux.sourceforge.net/" target="_blank" rel="noopener">User Mode Linux</a>,<br />
不過萬事起頭難, 怎麼樣弄 console 就是不會出來, 最後努力查了一下資料<br />
試了一下, 終於可以從 console 看到 Linux 啟動的畫面.<br />
其實 User mode linux 不難, 只是&#8230; 要多設一點東西<br />
<span id="more-459"></span>這邊將個人的經驗, 統統包成一包了, 這樣可以方便大家進入 User Mode Linux</p>
<p>在玩 User mode linux 的前提是, 多多少少要會重編自己的 kernel.<br />
首先先 check 有沒有載入 tun device.</p>
<blockquote><p>#dmesg | grep tun</p></blockquote>
<p>如果沒有, 試試看載入 modules</p>
<blockquote><p>#modprobe tun<br />
#dmesg | grep tun</p></blockquote>
<p>再來是 check iptables 的 NAT modules , eth0 是對外連線的 Device</p>
<blockquote><p># iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</p></blockquote>
<p>Check 一下有沒有錯誤訊息,<br />
如果你 tun device 和 iptables MASQUERADE modules 都在,<br />
那就可以直接下載懶人包了 <a href="http://richliu.com/uml-lazy.tar.bz2">uml-lazy.tar.bz2</a></p>
<p>下載完以後, 請切到 root 身份, 到 /home 下面解壓縮<br />
# cd /home<br />
# tar xf uml-lazy.tar.bz2</p>
<p>接下來, 進到 /home/uml 目錄, 依序執行以下的 shell script<br />
# cd /home/uml<br />
# sh host.sh<br />
# sh run.sh<br />
就可以看到 console , 然後 root 帳號沒有密碼.</p>
<p>/home/uml 目錄下檔案說明</p>
<ul>
<li>host.sh : 在 Host 端要跑的 Shell Script</li>
<li>kmtest : 測試用的 kernel modules source code (直接用 kdevelop 做出來的)</li>
<li>linux-2.6.20.4 : Linux kernel 2.6.20.4 + uml patch</li>
<li>localfs : Root File System, 我是放在一包, 你也可以解出來用. 這是 Gentoo 的 Root File System, 可能和其他(Ubuntu), 並不會差很多.</li>
<li>rootfs : mount Root File System 的目錄</li>
<li>run.sh : 執行 User Mode Linux</li>
<li>uml2.patch : Linux kernel Patch File.</li>
</ul>
<p>到 /home/uml/kmtest 內<br />
就是一個可以 Compile 的 Kernel Module, 只要打 # make ; make install<br />
就會將 module install 到 User Mode Linux 的目錄/lib/modules/2.6.20.4/kernel/drivers/misc 下.<br />
在 User Mode Linux 內可以使用 insmod kmtest-driver 測試.</p>
<p>如果你並不需要 Root File System 及 Linux Kernel , 我也有準備一包只有 configure file 的壓縮檔, 內有需要的 Configure File 及 Shell Script<br />
<a href="https://richliu.com/wp-content/uml-config.tar.bz2">uml-config.tar.bz2</a><br />
裡面有</p>
<ul>
<li>demo-dot-config : Linux kernel Configure File.</li>
<li>host.sh</li>
<li>run.sh</li>
<li>uml2.patch</li>
</ul>
<p>這樣應該就夠用了.</p>
<p>祝 UML 順利&#8230;. <img src="https://s.w.org/images/core/emoji/17.0.2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Ref.</p>
<ul>
<li><a href="http://blog.linux.org.tw/%7Ejserv/archives/001871.html" target="_blank" rel="noopener">Jserv:透過 User-Mode-Linux 來學習核心設計 (1)</a></li>
<li><a href="http://blog.linux.org.tw/%7Ejserv/archives/001872.html" target="_blank" rel="noopener">Jserv:透過 User-Mode-Linux 來學習核心設計 (2)</a></li>
<li><span id="listlink"><a href="http://www.mail-archive.com/user-mode-linux-devel@lists.sourceforge.net/msg04614.html" target="_blank" rel="noopener">user-mode-linux-devel</a></span><a href="http://www.mail-archive.com/user-mode-linux-devel@lists.sourceforge.net/msg04614.html" target="_blank" rel="noopener">  Mailing List <span class="subject">Re: [uml-devel] missing asm/user.h<br />
</span></a></li>
<li>Gentoo <a href="http://www.gentoo.org/doc/en/uml.xml" target="_blank" rel="noopener">Linux Developer&#8217;s guide to system testing with User-Mode Linux</a></li>
</ul>
<p>[Tags] User Mode Linux [/Tags]</p>
<p>The post <a rel="nofollow" href="https://richliu.com/2007/04/09/459/user-mode-linux-%e6%87%b6%e4%ba%ba%e5%8c%85/">User mode linux 懶人包.</a> appeared first on <a rel="nofollow" href="https://richliu.com">richliu&#039;s blog</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://richliu.com/2007/04/09/459/user-mode-linux-%e6%87%b6%e4%ba%ba%e5%8c%85/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
