/[gentoo]/xml/htdocs/doc/en/uml.xml
Gentoo

Diff of /xml/htdocs/doc/en/uml.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.25 Revision 1.26
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/uml.xml,v 1.25 2005/12/16 15:54:54 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/uml.xml,v 1.26 2006/06/26 16:16:58 nightmorph Exp $ -->
3 3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 5
6<guide link="/doc/en/uml.xml"> 6<guide link="/doc/en/uml.xml">
7<title>Gentoo Linux Developer's guide to system testing with User-Mode Linux</title> 7<title>Gentoo Linux Developer's guide to system testing with User-Mode Linux</title>
26 26
27<!-- The content of this document is licensed under the CC-BY-SA license --> 27<!-- The content of this document is licensed under the CC-BY-SA license -->
28<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 28<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
29<license/> 29<license/>
30 30
31<version>0.13</version> 31<version>0.14</version>
32<date>2005-12-16</date> 32<date>2006-06-26</date>
33 33
34<chapter> 34<chapter>
35<title>Obtaining User-Mode Linux</title> 35<title>Obtaining User-Mode Linux</title>
36<section> 36<section>
37<body> 37<body>
38 38
39<impo>
40Before you can use user-mode Linux, you <e>must</e> be using a non-NPTL
41profile, and you must be using &lt;<c>glibc</c>-2.4. Follow the instructions
42for <uri link="/doc/en/gentoo-upgrading.xml#instructions">changing
43profiles</uri>. You will need to run <c>emerge -e world</c> after switching to
44a non-NPTL profile.
45</impo>
46
39<p> 47<p>
40As the user-mode linux website 48As the user-mode Linux website
41(<uri>http://user-mode-linux.sourceforge.net</uri>) states, user-mode linux 49(<uri>http://user-mode-linux.sourceforge.net</uri>) states, user-modeL linux
42allows a user to "run Linux inside itself". Specifically, 50allows a user to "run Linux inside itself". Specifically,
43user-mode linux provides a virtual machine on which a user can "[r]un buggy 51user-mode linux provides a virtual machine on which a user can "[r]un buggy
44software, experiment with new Linux kernels or distributions, and poke around 52software, experiment with new Linux kernels or distributions, and poke around
45in the internals of Linux, all without risking your main Linux setup." 53in the internals of Linux, all without risking your main Linux setup."
46Experimental changes to Gentoo core packages such as <e>sys-apps/baselayout</e> 54Experimental changes to Gentoo core packages such as <e>sys-apps/baselayout</e>
47or <e>sys-libs/glibc</e> have the potential to break the system and render it 55or <e>sys-libs/glibc</e> have the potential to break the system and render it
48unbootable; with user-mode linux we can test these changes without having to 56unbootable; with user-mode Linux we can test these changes without having to
49worry about breaking the live system. 57worry about breaking the live system.
50</p> 58</p>
51 59
52<p> 60<p>
53Most 2.6 kernels have UML support. Although you can use your current kernel 61Most 2.6 kernels have UML support. Although you can use your current kernel
91# <i>env-update</i> 99# <i>env-update</i>
92# <i>source /etc/profile</i> 100# <i>source /etc/profile</i>
93</pre> 101</pre>
94 102
95<p> 103<p>
96For the user-mode linux kernel to properly boot a Gentoo system the 104For the user-mode Linux kernel to properly boot a Gentoo system the
97kernel needs to be configured to <e>not</e> automatically mount 105kernel needs to be configured to <e>not</e> automatically mount
98<path>/dev</path> (devfs) by default. Also, you will almost certainly 106<path>/dev</path> (devfs) by default. Also, you will almost certainly
99want to make sure that you have <e>tmpfs</e> (the "Virtual Memory 107want to make sure that you have <e>tmpfs</e> (the "Virtual Memory
100Filesystem") compiled in, since by default the Gentoo linux bootscripts 108Filesystem") compiled in, since by default the Gentoo Linux bootscripts
101store their information in a small tmpfs partition. 109store their information in a small tmpfs partition.
102(The binary kernels available from the user-mode website do automatically 110(The binary kernels available from the user-mode website do automatically
103mount <path>/dev</path>, and they don't have tmpfs compiled in; don't bother 111mount <path>/dev</path>, and they don't have tmpfs compiled in; don't bother
104with them). 112with them).
105</p> 113</p>
111the file <path>root_fs</path> that should be located in the current working 119the file <path>root_fs</path> that should be located in the current working
112directory. 120directory.
113</p> 121</p>
114 122
115<p> 123<p>
116It won't hurt to also install the user-mode linux tools. 124It won't hurt to also install the user-mode Linux tools.
117</p> 125</p>
118 126
119<pre caption="Installing UML tools"> 127<pre caption="Installing UML tools">
120# <i>emerge sys-apps/usermode-utilities</i> 128# <i>emerge sys-apps/usermode-utilities</i>
121</pre> 129</pre>
122 130
123<p> 131<p>
124These tools facilitate networking (among other things) between the user-mode 132These tools facilitate networking (among other things) between the user-mode
125linux virtual system and the host Linux system. 133Linux virtual system and the host Linux system.
126</p> 134</p>
127 135
128</body> 136</body>
129</section> 137</section>
130</chapter> 138</chapter>
249<pre caption="Start UML kernel thread"> 257<pre caption="Start UML kernel thread">
250# <i>linux ubd0=root_fs ubd1=swap_fs</i> 258# <i>linux ubd0=root_fs ubd1=swap_fs</i>
251</pre> 259</pre>
252 260
253<p> 261<p>
254User-mode linux uses xterms for the virtual consoles that 262User-mode Linux uses xterms for the virtual consoles that
255are run at boot time, so you need to make sure that the 263are run at boot time, so you need to make sure that the
256terminal from which you run user-mode linux has $DISPLAY 264terminal from which you run user-mode Linux has $DISPLAY
257properly set (along with proper xhost/xauth permissions). 265properly set (along with proper xhost/xauth permissions).
258</p> 266</p>
259 267
260<p> 268<p>
261With any luck you should be able to log into your user-mode linux 269With any luck you should be able to log into your user-mode Linux
262Gentoo system. The only thing keeping this user-mode linux version 270Gentoo system. The only thing keeping this user-mode Linux version
263of Gentoo from being fully functional is networking from the virtual 271of Gentoo from being fully functional is networking from the virtual
264machine to the host. 272machine to the host.
265</p> 273</p>
266 274
267</body> 275</body>
296<pre caption="Setup networking"> 304<pre caption="Setup networking">
297# <i>modprobe tun</i> 305# <i>modprobe tun</i>
298<comment>(If you receive a FATAL error here, try deleting /dev/net/tun and retry)</comment> 306<comment>(If you receive a FATAL error here, try deleting /dev/net/tun and retry)</comment>
299# <i>modprobe iptable_nat</i> 307# <i>modprobe iptable_nat</i>
300# <i>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</i> 308# <i>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</i>
301# <i>echo 1 > /proc/sys/net/ipv4/ip_forward</i> 309# <i>echo 1 &gt; /proc/sys/net/ipv4/ip_forward</i>
302</pre> 310</pre>
303 311
304<p> 312<p>
305The iptables line sets up IP Masquerading between the private 313The iptables line sets up IP Masquerading between the private
306network that our user-mode system will be on and the internet 314network that our user-mode system will be on and the internet
408<section> 416<section>
409<body> 417<body>
410 418
411<p> 419<p>
412Perhaps the true ideal of Gentoo Linux testing would be 420Perhaps the true ideal of Gentoo Linux testing would be
413to boot the .iso with user-mode linux and do the complete 421to boot the .iso with user-mode Linux and do the complete
414Gentoo install from within the user-mode linux virtual system. 422Gentoo install from within the user-mode Linux virtual system.
415</p> 423</p>
416 424
417<p> 425<p>
418Booting the .iso, or actually the initrd from the .iso, is pretty 426Booting the .iso, or actually the initrd from the .iso, is pretty
419straightforward. 427straightforward.

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20