Editing
Installation on Gentoo
(section)
From Linix VServer
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Host configuration == === Manually installing a Linux-Vserver kernel === IF your portage tree contains a pre-patched linux-vserver kernel, then that one could be fine to use: Skip to the next chapter. As of april 2016 there is no current maintainer for linux-vserver kernels on Gentoo. The Gentoo maintainers seem to have adapted a more "aggressive" approach related to removing "unmaintained" Gentoo packages, so they have deleted all "old" vserver pre-patched kernels from portage. This means that one has to install the vserver patch manually. However, this is a fairly simple process, slightly depending on whether you find a kernel source in portage that also has an available linux-vserver kernel patch. This is what you need to do: Have a look at Bertl's kernel patches. These are found on http://vserver.13thfloor.at/Experimental/ and named "patch-" + the kernel version the patch applies for. ("Experimental" is slightly misleading...) You'll then have to find kernel sources for which there is a patch available. Take a look into /var/db/repos/gentoo/sys-kernel/vanilla-sources . (On older Gentoo installations, this is rather /usr/portage/sys-kernel/vanilla-sources/ ). This is what you might see: <pre> amd64 ~ # ls -l /var/db/repos/gentoo/sys-kernel/vanilla-sources totalt 228 -rw-r--r-- 1 portage portage 23681 april 6 17:34 ChangeLog -rw-r--r-- 1 portage portage 104895 nov. 9 04:28 ChangeLog-2013 -rw-r--r-- 1 portage portage 43787 nov. 9 05:11 ChangeLog-2015 -rw-r--r-- 1 portage portage 11396 april 6 17:34 Manifest -rw-r--r-- 1 portage portage 642 jan. 25 00:06 metadata.xml -rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-3.10.101.ebuild -rw-r--r-- 1 portage portage 456 mars 18 23:03 vanilla-sources-3.12.57.ebuild -rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-3.14.65.ebuild -rw-r--r-- 1 portage portage 456 april 6 12:49 vanilla-sources-3.18.30.ebuild -rw-r--r-- 1 portage portage 456 april 1 12:31 vanilla-sources-3.2.79.ebuild -rw-r--r-- 1 portage portage 456 mars 22 14:42 vanilla-sources-3.4.111.ebuild -rw-r--r-- 1 portage portage 456 april 6 12:49 vanilla-sources-4.1.21.ebuild -rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-4.4.6.ebuild -rw-r--r-- 1 portage portage 456 mars 17 10:58 vanilla-sources-4.5.0.ebuild </pre> Unfortunately, at this time of writing no patch exists for any of the most recent kernels from that list. If it did, then install that version and skip the next step and use the chosen kernel as the kernel to install and patch later in this short writeup. There is also a "gentoo-sources" kernel source alternative. These kernel are slightly patched with Gentoo updates. However, assumingly that these kernels are not so heavily patched by Gentoo that they couldn't accept the linux-vserver patch also. Here is a sample Gentoo-sources list: <pre> amd64 ~ # ls -l /var/db/repos/gentoo/sys-kernel/gentoo-sources totalt 500 -rw-r--r-- 1 portage portage 36798 april 6 17:34 ChangeLog -rw-r--r-- 1 portage portage 91971 nov. 9 04:28 ChangeLog-2007 -rw-r--r-- 1 portage portage 101665 nov. 9 04:28 ChangeLog-2012 -rw-r--r-- 1 portage portage 119486 nov. 9 05:11 ChangeLog-2015 -rw-r--r-- 1 portage portage 766 mars 17 00:18 gentoo-sources-3.10.101.ebuild -rw-r--r-- 1 portage portage 757 jan. 24 12:50 gentoo-sources-3.10.95.ebuild [...several kernels deleted to save space...] -rw-r--r-- 1 portage portage 770 okt. 26 13:05 gentoo-sources-4.0.9.ebuild -rw-r--r-- 1 portage portage 787 jan. 10 11:32 gentoo-sources-4.1.12.ebuild -rw-r--r-- 1 portage portage 786 mars 21 12:45 gentoo-sources-4.1.15-r1.ebuild -rw-r--r-- 1 portage portage 794 mars 18 19:57 gentoo-sources-4.1.20.ebuild -rw-r--r-- 1 portage portage 794 april 6 15:49 gentoo-sources-4.1.21.ebuild -rw-r--r-- 1 portage portage 793 mars 17 00:56 gentoo-sources-4.4.6.ebuild -rw-r--r-- 1 portage portage 793 mars 29 14:53 gentoo-sources-4.5.0-r1.ebuild -rw-r--r-- 1 portage portage 40428 april 6 17:34 Manifest -rw-r--r-- 1 portage portage 705 jan. 25 00:06 metadata.xml </pre> There is a match. http://vserver.13thfloor.at/Experimental/ has a patch for 4.1.12, so let's install the 4.1.12 gentoo-sources and try the linux-vserver patch on it. <pre> amd64 ~ # emerge -v =sys-kernel/gentoo-sources-4.1.12 </pre> Then download the corresponding patch from 13thfloor and save it into the same directory as the emerged kernel source, which is /usr/src/gentoo-sources-4.1.12 . cd into that source directory and install the linux-vserver kernel patch: <pre> amd64 ~ # cd /usr/src/linux-4.1.12-gentoo/ amd64 linux-4.1.12-gentoo # patch -p1 < patch-4.1.12-vs2.3.8.3.diff patching file Documentation/vserver/debug.txt patching file Makefile Hunk #1 FAILED at 1. 1 out of 1 hunk FAILED -- saving rejects to file Makefile.rej patching file arch/alpha/Kconfig patching file arch/alpha/kernel/systbls.S patching file arch/alpha/kernel/traps.c patching file arch/arm/Kconfig [...further output deleted...] </pre> Hopefully there shouldn't be any serious rejects. The only reject I got was the makefile itself. By looking at the .rej file just the EXTRAVERSIONat failed since EXTRAVERSION is already set to "-gentoo" by gentoo-sources. So you can rather just edit EXTRAVERSION line the makefile manually to whatever you like or keep it as it is. Makefile.rej: <pre> --- Makefile 2015-10-29 09:20:01.000000000 +0000 +++ Makefile 2015-10-30 14:51:48.000000000 +0000 @@ -1,7 +1,7 @@ VERSION = 4 PATCHLEVEL = 1 SUBLEVEL = 12 -EXTRAVERSION = +EXTRAVERSION = -vs2.3.8.3 NAME = Series 4800 # *DOCUMENTATION* </pre> Then configure the kernel as you like, and as descripted in later chapters. === Install a Linux-VServer kernel === Installing a prepatched kernel is as easy as: <pre> # emerge vserver-sources </pre> After the vserver-sources are installed it's time to configure them using make menuconfig. Below is a common configuration for 2.1.1 and above. If you are using 2.0.x some configuration options may not be present. <pre> # cd /usr/src/linux-<KERNELVERSION>-vserver-<VSERVERVERSION> # make menuconfig Linux VServer ---> [ ] Enable Legacy Kernel API [ ] Enable Legacy Networking Kernel API [ ] Remap Source IP Address [*] Enable COW Immutable Link Breaking [*] Enable Virtualized Guest Time [*] Enable Proc Security [*] Enable Hard CPU Limits [*] Avoid idle CPUs by skipping Time [*] Limit the IDLE task Persistent Inode Tagging (UID24/GID24) ---> [ ] Tag NFSD User Auth and Files [ ] Enable Inode Tag Propagation [*] Honor Privacy Aspects of Guests [ ] VServer Debugging Code </pre> '''Note''': If you are using reiserfs as file system on the partition where guest images are stored, you will need to enable extended attributes for reiserfs in your kernel configuration and additionally add the attrs option in /etc/fstab. <pre> File systems ---> <*> Reiserfs support [*] ReiserFS extended attributes </pre> <pre> /dev/hdb1 /vservers reiserfs noatime,attrs 0 0 </pre> After you've built and installed the kernel, update your boot loader and finally reboot to see if the kernel boots correctly. <pre> (Building the kernel) # make (Installing) # make modules_install # cp arch/<arch>/boot/bzImage /boot/kernel-<KERNELVERSION>-vserver-<VSERVERVERSION> (Edit bootloader config file as required and) # reboot </pre> === Setup host environment === To maintain your virtual servers you need the util-vserver package which contains all necessary programs and many useful features. <pre> # emerge >=sys-cluster/util-vserver-0.30.212 </pre> You have to run the vprocunhide command after every reboot in order to setup /proc permissions correctly for vserver use. An init script has been installed by util-vserver. To use it you should add it to a runlevel: <pre> # rc-update add vprocunhide default # /etc/init.d/vprocunhide start # rc-update add util-vserver default # /etc/init.d/util-vserver start </pre>
Summary:
Please note that all contributions to Linix VServer may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Linix VServer:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Page actions
Page
Discussion
Read
Edit
History
Page actions
Page
Discussion
More
Tools
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
About
Overview
Paper
News
Developers
Donations
Search
Getting Started
Downloads
FAQs
Documentation
Support
Participate
How to participate
Report a Bug
Communicate
Teams/Projects
Hall of Fame
Resources
Archives
Recent Wiki Changes
Pastebin
Related Projects
VServer Hosting
Happy VServer Users
Tools
What links here
Related changes
Special pages
Page information