/[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.19 Revision 1.20
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.19 2004/08/31 07:38:46 swift Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/uml.xml,v 1.20 2004/10/07 17:20:22 swift 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>
8<author title="Editor">
8<author title="Editor"><mail link="g2boojum@gentoo.org">Grant Goodyear</mail></author> 9 <mail link="g2boojum@gentoo.org">Grant Goodyear</mail>
10</author>
9<author title="Editor"><!-- zhen@gentoo.org --> 11<author title="Editor"><!-- zhen@gentoo.org -->
10 John Davis 12 John Davis
11</author> 13</author>
12
13<author title="Editor"> 14<author title="Editor">
14 <mail link="swift@gentoo.org">Sven Vermeulen</mail> 15 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
15</author> 16</author>
16<author title="Editor"> 17<author title="Editor">
17 <mail link="bennyc@gentoo.org">Benny Chuang</mail> 18 <mail link="bennyc@gentoo.org">Benny Chuang</mail>
18</author> 19</author>
19 20
20<abstract> 21<abstract>
21 This guide shows Gentoo Linux developers how to set up and use 22This guide shows Gentoo Linux developers how to set up and use
22 user-mode linux for testing potentially system-breaking changes. 23user-mode linux for testing potentially system-breaking changes.
23</abstract> 24</abstract>
24 25
25<license/> 26<license/>
26 27
27<version>0.8</version> 28<version>0.9</version>
28<date>August 31, 2004</date> 29<date>October 07, 2004</date>
29 30
30<chapter> 31<chapter>
31<title>Obtaining User-Mode Linux</title> 32<title>Obtaining User-Mode Linux</title>
32<section> 33<section>
33<body> 34<body>
74# <i>nano -w /etc/env.d/00basic</i> 75# <i>nano -w /etc/env.d/00basic</i>
75# <i>env-update</i> 76# <i>env-update</i>
76# <i>source /etc/profile</i> 77# <i>source /etc/profile</i>
77</pre> 78</pre>
78 79
79<impo> 80<p>
80For the user-mode linux kernel to properly boot a Gentoo system the 81For the user-mode linux kernel to properly boot a Gentoo system the
81kernel needs to be configured to <e>not</e> automatically mount 82kernel needs to be configured to <e>not</e> automatically mount
82<path>/dev</path> (devfs) by default. Also, you will almost certainly 83<path>/dev</path> (devfs) by default. Also, you will almost certainly
83want to make sure that you have <e>tmpfs</e> (the "Virtual Memory 84want to make sure that you have <e>tmpfs</e> (the "Virtual Memory
84Filesystem") compiled in, since by default the Gentoo linux bootscripts 85Filesystem") compiled in, since by default the Gentoo linux bootscripts
85store their information in a small tmpfs partition. 86store their information in a small tmpfs partition.
86(The binary kernels available from the user-mode website do automatically 87(The binary kernels available from the user-mode website do automatically
87mount <path>/dev</path>, and they don't have tmpfs compiled in; don't bother 88mount <path>/dev</path>, and they don't have tmpfs compiled in; don't bother
88with them). 89with them).
89</impo> 90</p>
90 91
91<p> 92<p>
92I highly recommend reading the user-mode linux documentation, but the 93I highly recommend reading the user-mode linux documentation, but the
93basic idea is that running the <path>/usr/local/bin/linux</path> program 94basic idea is that running the <path>/usr/local/bin/linux</path> program
94boots the user-mode kernel and tries to bring up the system stored in 95boots the user-mode kernel and tries to bring up the system stored in
171At this point, remember to set your root password. 172At this point, remember to set your root password.
172</p> 173</p>
173 174
174<pre caption="Setting root password"> 175<pre caption="Setting root password">
175# <i>passwd</i> 176# <i>passwd</i>
177</pre>
178
179<p>
180Now we need to make some changes to the boot scripts. Remove consolefonts and
181keymaps from the boot runlevel:
182</p>
183
184<pre caption="Removing unneeded initscripts">
185# <i>rc-update del consolefonts boot</i>
186# <i>rc-update del keymaps boot</i>
176</pre> 187</pre>
177 188
178<p> 189<p>
179Exit the chroot, unmount all of the bind mounts, 190Exit the chroot, unmount all of the bind mounts,
180tar up the new Gentoo distro, and clean up. 191tar up the new Gentoo distro, and clean up.
222 233
223<pre caption="Start UML kernel thread"> 234<pre caption="Start UML kernel thread">
224# <i>linux ubd0=root_fs ubd1=swap_fs</i> 235# <i>linux ubd0=root_fs ubd1=swap_fs</i>
225</pre> 236</pre>
226 237
227<note> 238<p>
228User-mode linux uses xterms for the virtual consoles that 239User-mode linux uses xterms for the virtual consoles that
229are run at boot time, so you need to make sure that the 240are run at boot time, so you need to make sure that the
230terminal from which you run user-mode linux has $DISPLAY 241terminal from which you run user-mode linux has $DISPLAY
231properly set (along with proper xhost/xauth permissions). 242properly set (along with proper xhost/xauth permissions).
232</note> 243</p>
233 244
234<p> 245<p>
235With any luck you should be able to log into your user-mode linux 246With any luck you should be able to log into your user-mode linux
236Gentoo system. The only thing keeping this user-mode linux version 247Gentoo system. The only thing keeping this user-mode linux version
237of Gentoo from being fully functional is networking from the virtual 248of Gentoo from being fully functional is networking from the virtual
246<title>Networking</title> 257<title>Networking</title>
247<section> 258<section>
248<body> 259<body>
249 260
250<p> 261<p>
251Thanks to Martin Schlemmer (Azarah), I now know how 262Make sure that the host kernel has the following settings compiled as modules:
252to get networking to function from within a user-mode 263</p>
253system. The idea is that we set up a private network 264
254consisting of the user-mode system and the host system, 265<pre caption="Host kernel configuration">
255and then the user-mode system routes all of its packets 266Networking --&gt;
256to the host, which then forwards packets to the net. 267 IP: Netfilter Configuration --&gt;
257Make sure that the host kernel has 268 IP tables support --&gt;
258Networking --> IP: Netfilter Configuration --> IP tables support 269 Full NAT --&gt;
259--> Full NAT --> MASQUERADE target support and 270 &lt;M&gt; MASQUERADE target support
260Network Device Support --> TUN/TAP Support 271
261compiled as modules; then do the following on the 272 Network Device Support --&gt;
262<e>host</e> machine: 273 &lt;M&gt; TUN/TAP Support
274</pre>
275
276<p>
277Run the following commands on the <e>host</e> machine:
263</p> 278</p>
264 279
265<pre caption="Setup networking"> 280<pre caption="Setup networking">
266# <i>modprobe tun</i> 281# <i>modprobe tun</i>
282<comment>(If you receive a FATAL error here, try deleting /dev/net/tun and retry)</comment>
267# <i>modprobe iptable_nat</i> 283# <i>modprobe iptable_nat</i>
268# <i>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</i> 284# <i>iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE</i>
269# <i>echo 1 > /proc/sys/net/ipv4/ip_forward</i> 285# <i>echo 1 > /proc/sys/net/ipv4/ip_forward</i>
270</pre> 286</pre>
271 287

Legend:
Removed from v.1.19  
changed lines
  Added in v.1.20

  ViewVC Help
Powered by ViewVC 1.1.20