Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 61103 Details for
Bug 90122
Gentoo Linux VServer Guide
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
quickstart howto
vserver-quickstart.xml (text/xml), 9.60 KB, created by
Benedikt Böhm (RETIRED)
on 2005-06-12 04:04:30 UTC
(
hide
)
Description:
quickstart howto
Filename:
MIME Type:
Creator:
Benedikt Böhm (RETIRED)
Created:
2005-06-12 04:04:30 UTC
Size:
9.60 KB
patch
obsolete
><?xml version='1.0' encoding="UTF-8"?> ><!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> ><guide link="/doc/en/vserver-quickstart.xml" lang="en"> ><title>Gentoo Linux-VServer Quickstart Howto</title> ><author title="Author"> > <mail link="hollow@gentoo.org">Benedikt Boehm</mail> ></author> > ><abstract> >In this Howto you will learn to setup a basic virtual server using the >Linux-VServer Technology ></abstract> > ><!-- The content of this document is licensed under the CC-BY-SA license --> ><!-- See http://creativecommons.org/licenses/by-sa/2.0 --> ><license/> > ><version>1.0</version> ><date>2005-06-12</date> > ><chapter> ><title>Introduction</title> ><section> ><title>The Linux-VServer Concept</title> ><body> > ><p> >The basic concept of the Linux-VServer solution is to separate the user-space >environment into distinct units (sometimes called Virtual Private Servers) in >such a way that each VPS looks and feels like a real server to the processes >contained within. ></p> > ></body> ></section> > ><section> ><title>Terms used in this Howto</title> ><body> > ><table> ><tr> > <th>Term</th> > <th>Description</th> ></tr> ><tr> > <th>Linux-VServer, VServer</th> > <ti>Linux-VServer is the official name of the project and used in this Howto > the same way</ti> ></tr> ><tr> > <th>virtual server, vserver, guest system</th> > <ti>All these are interchangable and refer to one instance of a server (i.e. > one virtual server)</ti> ></tr> ><tr> > <th>host system, host</th> > <ti>The physical machine running your Gentoo Linux will host all virtual > servers</ti> ></tr> ><tr> > <th>util-vserver, vserver utils</th> > <ti>The util-vserver package contains all programms necessary for maintaining > your virtual servers</ti> ></tr> ></table> > ></body> ></section> ></chapter> > ><chapter> ><title>Creating a vserver template</title> ><section> ><title>Install a VServer kernel</title> ><body> > ><pre caption="Install vserver-sources"> ><i>emerge vserver-sources</i> ></pre> > ><p> >After the vserver-sources are installed it's time to configure them using <c>make >menuconfig</c>. ></p> > ><pre caption="Configure vserver-sources"> ><i>cd /usr/src/linux-<KERNELVERSION>-vserver-<VSERVERVERSION> >make menuconfig</i> > >Linux VServer ---> > [*] Enable Legacy Kernel API <codenote>Required by current utils</codenote> > [ ] Disable Legacy Networking Kernel API <codenote>Do not set!</codenote> > [*] Enable Proc Security <codenote>Highly recommended</codenote> > [ ] Enable Hard CPU Limits > Persistent Inode Context Tagging (UID24/GID24) ---> > [ ] Tag NFSD User Auth and Files > [ ] Compile Debugging Code ></pre> > ><p> >After you've built and installed the kernel, update your boot loader and finally >reboot to see if the kernel boots correctly ></p> > ><pre caption="Install the kernel"> ><i><codenote>Building...</codenote> >make > ><codenote>Installing...</codenote> >make modules_install <codenote>This is optional, of course</codenote> >cp arch/i386/boot/bzImage /boot/kernel-<KERNELVERSION>-vs<VSERVERVERSION> >nano -w /boot/grub/grub.conf <codenote>Create a new entry for your vserver kernel image</codenote> > >reboot</i> ></pre> > ></body> ></section> > ><section> ><title>Setup host environment</title> ><body> > ><p> >To maintain your virtual servers you need the util-vserver package which >contains all necessary programs and many usefull features. ></p> > ><pre caption="Install vserver utils"> ><i>emerge util-vserver</i> ></pre> > ><p> >If you use Proc Security you have to "unhide" certain files in your ><path>/proc</path> directory in order to make them available in virtual servers. >There is a script called <c>vprocunhide</c> in <path>/usr/lib/util-vserver</path> >which unhides files specified in ><path>/usr/lib/util-vserver/defaults/vprocunhide-files</path>. The util-vserver >ebuild installed a init-script which uses the <c>vprocunhide</c> command. Add it >to your runlevel: ></p> > ><pre caption="vprocunhide init script"> ><i>rc-update add vprocunhide default >/etc/init.d/vprocunhide start</i> ></pre> > ><p> >The vshelper script is used to correctly stop and restart virtual servers. >You have to tell the kernel where the vshelper script is located: ></p> > ><pre caption="vshelper setup"> ><i>echo 'kernel.vshelper = /usr/lib/util-vserver/vshelper' >> /etc/sysctl.conf >sysctl -p</i> ></pre> > ></body> ></section> > ><section> ><title>Basic Skeleton configuration</title> ><body> > ><p> >You have to create some configuration files and directories to get your >virtual server up and running. We use the skeleton build mode from the >util-vserver package to setup our basic configuration. ></p> > ><p> >The util-vserver package uses <path>/vservers</path> to store all virtual >servers by default. You can put your servers somewhere else by specifying ><c>--rootdir=/path/to/vserver/root</c> to the build command below. ></p> > ><p> >There is a new baselayout-vserver ebuild in portage which supports the plain >init-style, i.e. you don't have to use the gentoo init style anymore. The plain >init-style uses <c>init</c> and <path>/etc/inittab</path> to manage runlevels >and init scripts (considered more stable and is the default now) ></p> > ><p> >You have to choose a context ID for your vserver (dynamic context IDs are >discouraged) as well as the necessary network device information (In this >example eth0 is configured with 192.168.1.254/24 and the context ID is >equivalent to the last two parts of the virtual servers IP) ></p> > ><pre caption="Basic configuration"> ><i>vserver gentoo build -m skeleton \ > --hostname gentoo \ > --initstyle plain \ > --context 1253 > --interface gentoo=eth0:192.168.1.253/24</i> ></pre> > ><impo> >Per default the virtual server is allowed to set the hostname itself. Be >sure to change /etc/conf.d/hostname in your virtual server later to match the >hostname above. ></impo> > ></body> ></section> > ><section> ><title>Installing Gentoo installation files</title> ><body> > ><p> >We are creating a Gentoo template which we can copy later to get >multiple virtual servers easily. The <c>vserver build</c>-script created >some basic directories in <path>/vservers/gentoo</path> which >are installed by a stage anyway, so we remove them first. ></p> > ><pre caption="Remove skeleton files"> ><i>rm -rf /vservers/gentoo/*</i> ></pre> > ><p> >You have to install a regular Gentoo system now. You can follow most >of the Gentoo Handbook with some limitations and additions: ></p> > ><ul> > <li>Replace <path>/mnt/gentoo</path> with > <path>/vservers/gentoo</path></li> > <li>Choose the <path>vserver/x86</path> profile in <uri > link="http://gentoo.home.xnull.de/doc/en/handbook/handbook-x86.xml?part=1&chap=6#doc_chap1_sect6"> > chapter 6.a</uri></li> > <li>Use the vserver stages available <uri link="http://dev.gentoo.org/~hollow/vserver/stages/">here</uri>.</li> ></ul> > ><p> >Now, follow the Gentoo Handbook from <uri >link="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=5#doc_chap2"> >chapter 5.b</uri> to chapter 7.a and <uri >link="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap3"> >chapter 8.c</uri> to chapter 9.c ></p> > ><note> >To reflect your network settings you should change ><path>/etc/conf.d/hostname</path>, <path>/etc/conf.d/domainname</path> >and <path>/etc/hosts</path> to your needs. See <uri >link="http://gentoo.home.xnull.de/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2_sect1"> >chapter 8.b.1</uri> and <uri >link="http://gentoo.home.xnull.de/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2_sect4"> >chapter 8.b.4</uri>. The rest of your virtual servers network setup will be done >on the host. ></note> ></body> ></section> > ><section> ><title>Necessary configuration-file changes</title> ><body> > ><p> >Change the source entry in <path>/etc/syslog-ng/syslog-ng.conf</path> because we >have no permission to read <path>/proc/kmsg</path> for security reasons and >remove the console destination: ></p> > ><pre caption="Edit /etc/syslog-ng/syslog-ng.conf"> ><i>nano -w /etc/syslog-ng/syslog-ng.conf</i> > ><codenote>Change this:</codenote> >source src { unix-stream("/dev/log"); internal(); pipe("/proc/kmsg"); }; > ><codenote>To this:</codenote> >source src { unix-stream("/dev/log"); internal(); }; > ><codenote>Remove these lines:</codenote> ># By default messages are logged to tty12... >destination console_all { file("/dev/tty12"); }; ># ...if you intend to use /dev/console for programs like xconsole ># you can comment out the destination line above that references /dev/tty12 ># and uncomment the line below. >#destination console_all { file("/dev/console"); }; > >log { source(src); destination(console_all); }; ></pre> > ></body> ></section> > ><section> ><title>Leave the chroot environment</title> ><body> > ><p> >Your system should be ready. Leave the chroot and umount the proc filesystem. ></p> > ><pre caption="Leave the chroot environment"> ><i>exit >umount /vservers/gentoo/proc/</i> ></pre> > ></body> ></section> > ><section> ><title>Test the virtual server</title> ><body> > ><p> >You should be able to start and enter the vserver by using the commands below. >If you miss commands like <c>mount</c> or <c>dmesg</c> you should <c>emerge >util-linux</c> inside your virtual server as the vserver profile doesn't ship >this package by default. ></p> > ><pre caption="Test the virtual server"> >host ~ # <i>vserver gentoo start</i> >host ~ # <i>vserver-stat</i> >CTX PROC VSZ RSS userTIME sysTIME UPTIME NAME >0 90 1.4G 153.4K 14m00s11 6m45s17 2h59m59 root server >1253 2 3M 286 0m00s45 0m00s42 0m02s91 gentoo >host ~ # <i>vserver gentoo enter</i> >gentoo / # <i>ps ax</i> >PID TTY STAT TIME COMMAND > 1 ? S 0:00 init [3] >22887 ? Ss 0:00 /usr/sbin/syslog-ng >20496 pts/0 S 0:00 /bin/bash -login >20508 pts/0 R+ 0:00 ps ax >gentoo / # <i>halt</i> >gentoo / # Killed >host ~ # ></pre> > ></body> ></section> ></chapter> > ></guide>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 90122
:
56999
|
61103
|
61113