/[gentoo]/xml/htdocs/proj/en/vps/vserver-howto.xml
Gentoo

Diff of /xml/htdocs/proj/en/vps/vserver-howto.xml

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

Revision 1.7 Revision 1.8
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version='1.0' encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/vps/vserver-howto.xml,v 1.7 2007/02/10 14:28:34 hollow Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/proj/en/vps/vserver-howto.xml,v 1.8 2007/03/26 18:50:21 hollow Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link="/proj/en/vps/vserver-howto.xml"> 5<guide link="/proj/en/vps/vserver-howto.xml">
6<title>Gentoo Linux-VServer Howto</title> 6<title>Gentoo Linux-VServer Howto</title>
7 7
19 19
20<!-- The content of this document is licensed under the CC-BY-SA license --> 20<!-- The content of this document is licensed under the CC-BY-SA license -->
21<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 21<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
22<license/> 22<license/>
23 23
24<version>1.9</version> 24<version>1.10</version>
25<date>2007-02-10</date> 25<date>2007-03-26</date>
26 26
27<chapter> 27<chapter>
28<title>Introduction</title> 28<title>Introduction</title>
29<section> 29<section>
30<title>The Linux-VServer Concept</title> 30<title>The Linux-VServer Concept</title>
168# <i>emerge >=sys-cluster/util-vserver-0.30.212</i> 168# <i>emerge >=sys-cluster/util-vserver-0.30.212</i>
169</pre> 169</pre>
170 170
171<p> 171<p>
172You have to run the <c>vprocunhide</c> command after every reboot in order to 172You have to run the <c>vprocunhide</c> command after every reboot in order to
173setup <path>/proc</path> permissions correctly for vserver guests. An init 173setup <path>/proc</path> permissions correctly for vserver guests. Two init
174script has been installed by util-vserver. To use it you should add it to the 174scripts have been installed by util-vserver which run the <c>vprocunhide</c>
175default runlevel: 175command for you and take care of virtual servers during shutdown of the host.
176</p> 176</p>
177 177
178<pre caption="vprocunhide init script"> 178<pre caption="util-vserver init scripts">
179# <i>rc-update add vprocunhide default</i> 179# <i>rc-update add vprocunhide default</i>
180# <i>/etc/init.d/vprocunhide start</i> 180# <i>/etc/init.d/vprocunhide start</i>
181# <i>rc-update add util-vserver default</i>
182# <i>/etc/init.d/util-vserver start</i>
181</pre> 183</pre>
182 184
183</body> 185</body>
184</section> 186</section>
185</chapter> 187</chapter>
186 188
187<chapter> 189<chapter>
188<title>Guest creation</title> 190<title>Guest creation</title>
189<section> 191<section>
190<title>Using vserver stage3/4</title> 192<title>Download a precompiled stage3/4</title>
191<body> 193<body>
192 194
195<p>
196Since many hardware related commands are not available inside a virtual server,
197there has been a patched version of baselayout known as baselayout-vserver.
198However, since baselayout-1.13.0_alpha12, all required changes have been
199integrated into normal baselayout, eliminating the need for seperate vserver
200stages, profiles and baselayout. The only (temporary) drawback is that
201baselayout-1.13 is still considered to be in alpha stage and there are no
202stages with baselayout-1.13 available on the mirrors yet.
193<p> 203</p>
194You have to download a vserver prepared stage3/4 from one of 204
205<p>
206As soon as baselayout-1.13 is stable you can use a precompiled stage3/4 from
195<uri link="/main/en/mirrors.xml">our mirrors</uri>. Those stages are located 207one of <uri link="/main/en/mirrors.xml">our mirrors</uri>. In the meantime
196under the <path>experimental/&lt;arch&gt;/vserver/</path> directory. 208please download a stage3/4 from
209<uri link="http://people.linux-vserver.org/~hollow/stages/">here</uri>.
197Since a stage3/4 contains a complete root filesystem you can use the template 210Since a stage3/4 contains a complete root filesystem you can use the template
198build method of util-vserver. However, this method is only available since 211build method of util-vserver. However, this method is only available since
199util-vserver-0.30.211, so make sure you have the right version installed. 212util-vserver-0.30.211, so make sure you have the right version installed.
200</p> 213</p>
201 214
206equivalent to the last two parts of the virtual servers IP). 219equivalent to the last two parts of the virtual servers IP).
207</p> 220</p>
208 221
209<note> 222<note>
210The context ID should be 1 &lt; ID &lt; 49152. 223The context ID should be 1 &lt; ID &lt; 49152.
224</note>
225
226</body>
227</section>
228<section>
229<title>Using the template build method</title>
230<body>
231
232<p>
233For a long time now, plain init style was the only init style available for
234gentoo, i.e. a normal init process will be started inside the guest, just like
235on any common Unix system. However this approach has some drawbacks:
236</p>
237
238<ul>
239<li>No possibility to see output of init/rc scripts</li>
240<li>Wasted resources for idle init processes in each guest</li>
241<li>Annoying conflicts for <path>/etc/inittab</path></li>
242</ul>
243
244<p>
245Therefore, many users have requested to reimplement the gentoo init style,
246which has been abandonned since it was a very hacky implementation and more
247or less worked by accident due to other modifications done to baselayout back
248then. However, as of util-vserver-0.30.212 the gentoo init style has been
249reimplemented in a concise manner and will get the default in the future.
250</p>
251
252<note>
253If there is not a good reason for using an extra init process for each guest
254or if you don't know what to do here, you should stick with gentoo init style.
211</note> 255</note>
212 256
213<pre caption="Start stage3 installation"> 257<pre caption="Start stage3 installation">
214# <i>vserver myguest build \</i> 258# <i>vserver myguest build \</i>
215 <i>--context 1253 \</i> 259 <i>--context 1253 \</i>
216 <i>--hostname gentoo \</i> 260 <i>--hostname gentoo \</i>
217 <i>--interface eth0:192.168.1.253/24 \</i> 261 <i>--interface eth0:192.168.1.253/24 \</i>
218 <i>--initstyle plain \</i> 262 <i>--initstyle gentoo \</i> <comment>(replace if needed)</comment>
219 <i>-m template -- \</i> 263 <i>-m template -- \</i>
220 <i> -d gentoo \</i> 264 <i> -d gentoo \</i>
221 <i> -t /path/to/stage4-&lt;arch&gt;-&lt;version&gt;.tar.bz2</i> 265 <i> -t /path/to/stage4-&lt;arch&gt;-&lt;version&gt;.tar.bz2</i>
222</pre> 266</pre>
223 267
239this package by default. 283this package by default.
240</p> 284</p>
241 285
242<pre caption="Test the virtual server"> 286<pre caption="Test the virtual server">
243# <i>vserver myguest start</i> 287# <i>vserver myguest start</i>
288
289
290Gentoo/Linux 1.13.0_alpha12; http://www.gentoo.org/
291 Copyright 1999-2007 Gentoo Foundation; Distributed under the GPLv2
292
293Press I to enter interactive boot mode
294
295 * Using existing device nodes in /dev [ ok ]
296 * root filesystem is mounted read-write - skipping
297 * Checking all filesystems [ ok ]
298 * Mounting local filesystems [ ok ]
299 * Activating (possible) swap [ ok ]
300 * Setting hostname to myguest [ ok ]
301 * Updating environment [ ok ]
302 * Cleaning /var/lock, /var/run [ ok ]
303 * Cleaning /tmp directory [ ok ]
304 * Initializing random number generator [ ok ]
305 * Setting system clock using the hardware clock [VPS] [ ok ]
306 * Starting syslog-ng [ ok ]
307 * Starting vixie-cron [ ok ]
308 * Starting local [ ok ]
244# <i>vserver-stat</i> 309# <i>vserver-stat</i>
245CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME 310CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME
2460 90 1.4G 153.4K 14m00s11 6m45s17 2h59m59 root server 3110 90 1.4G 153.4K 14m00s11 6m45s17 2h59m59 root server
2471252 2 3M 286 0m00s45 0m00s42 0m02s91 myguest 3121252 2 3M 286 0m00s45 0m00s42 0m02s91 myguest
248# <i>vserver myguest enter</i> 313# <i>vserver myguest enter</i>

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20