CentOS HowTo: Difference between revisions
(Restored content from Wayback Machine) |
(Restored content from Wayback Machine) Tag: Manual revert |
||
| Line 3: | Line 3: | ||
<div class="logo"> | <div class="logo"> | ||
[[Linux-VServer|[[File:http:// | [[Linux-VServer|[[File:http://linux-vserver.org/logo.png|[Home]]]]] | ||
</div> | </div> | ||
| Line 11: | Line 11: | ||
<div id="toolbar-top"> | <div id="toolbar-top"> | ||
[[Linux-VServer]] | [[RecentChanges]] | [http:// | [[Linux-VServer]] | [[RecentChanges]] | [http://linux-vserver.org/?action=prefs Preferences] | [http://tavi.sourceforge.net/FormattingRules FormattingRules] | ||
</div> | </div> | ||
| Line 21: | Line 21: | ||
<div id="body"> | <div id="body"> | ||
<span id="centos-4-specific-hints"></span> | |||
= CentOS 4 Specific Hints = | |||
<span id="centos | |||
= CentOS | |||
This is meant to help those with this distribution, successfully install Linux-VServer. | This is meant to help those with this distribution, successfully install Linux-VServer. | ||
| Line 49: | Line 38: | ||
make modules_install | make modules_install | ||
make install</pre> | make install</pre> | ||
* CentOS, properly modifies the grub.conf file for the new kernel, but we still need to make some more changes: | |||
* '''Fix /etc/fstab''' | |||
* CentOS uses LABEL, which is not compatible with a vanilla kernel | |||
* Run 'mount' to see what drives are pointing where | |||
* Change the corresponding lines in /etc/fstab to point to the real device name: | |||
Before: | |||
<pre class="code">LABEL=/ / ext3 defaults 1 1 | |||
LABEL=/boot1 /boot ext2 defaults 1 2 | |||
none /dev/pts devpts gid=5,mode=620 0 0 | |||
none /dev/shm tmpfs defaults 0 0 | |||
none /proc proc defaults 0 0 | |||
none /sys sysfs defaults 0 0 | |||
LABEL=SWAP-hda2 swap swap defaults 0 0 | |||
/dev/hdb /media/cdrom auto pamconsole,exec,noauto,managed 0 0 | |||
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0</pre> | |||
Mount: | |||
<pre class="code">/dev/hda3 on / type ext3 (rw) | |||
none on /proc type proc (rw) | |||
none on /sys type sysfs (rw) | |||
none on /dev/pts type devpts (rw,gid=5,mode=620) | |||
usbfs on /proc/bus/usb type usbfs (rw) | |||
/dev/hda1 on /boot type ext2 (rw) | |||
none on /dev/shm type tmpfs (rw) | |||
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) | |||
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)</pre> | |||
After: | |||
<pre class="code">/dev/hda3 / ext3 defaults 1 1 | |||
/dev/hda1 /boot ext2 defaults 1 2 | |||
none /dev/pts devpts gid=5,mode=620 0 0 | |||
none /dev/shm tmpfs defaults 0 0 | |||
none /proc proc defaults 0 0 | |||
none /sys sysfs defaults 0 0 | |||
/dev/hda2 swap swap defaults 0 0 | |||
/dev/hdb /media/cdrom auto pamconsole,exec,noauto,managed 0 0 | |||
/dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0</pre> | |||
* '''Fix /boot/grub/grub.conf''' | |||
* This file also needs to be modified for the same reasons | |||
* Change all lines that use LABEL in /boot/grub/grub/conf to point to the real device name | |||
Change: | |||
<pre class="code"> kernel /vmlinuz-2.6.9-5.0.3.EL ro root=LABEL=/</pre> | |||
To: | |||
<pre class="code"> kernel /vmlinuz-2.6.9-5.0.3.EL ro root=/dev/hda1</pre> | |||
* '''Disable SELinux''' | * '''Disable SELinux''' | ||
| Line 60: | Line 99: | ||
== B. Tool Hints == | == B. Tool Hints == | ||
* Many like to configure the tools with the following options: | * Many like to configure the tools with the following options: | ||
| Line 74: | Line 107: | ||
<span id="c.-adding-centos-4-support-into-the-tools"></span> | <span id="c.-adding-centos-4-support-into-the-tools"></span> | ||
== C. Adding CentOS 4 Support into the tools == | == C. Adding CentOS 4 Support into the tools == | ||
<pre class="code">cd /usr/lib/util-vserver/distributions | <pre class="code">cd /usr/lib/util-vserver/distributions | ||
cp | cp fc3 centos4 | ||
cd centos4 | cd centos4 | ||
mkdir pubkeys | mkdir pubkeys | ||
cp /usr/share/rhn/RPM-GPG-KEY-centos4 ./pubkeys/ (Should be there from CentOS install | cp /usr/share/rhn/RPM-GPG-KEY-centos4 ./pubkeys/ (Should be there from a properly updated !CentOS install) | ||
ln -s ../redhat/initpre . | ln -s ../redhat/initpre . | ||
ln -s ../redhat/initpost . | ln -s ../redhat/initpost . | ||
| Line 87: | Line 118: | ||
rm -f 01 02 03 | rm -f 01 02 03 | ||
vi 01 (put the contents of this into it: http://linux-vserver.org/CentOS_min_install) | vi 01 (put the contents of this into it: http://linux-vserver.org/CentOS_min_install) | ||
cd ../yum | cd ../yum | ||
vi yum.conf and replace with: | vi yu/yum.conf and replace with: | ||
[main] | [main] | ||
| Line 108: | Line 134: | ||
gpgcheck=1 | gpgcheck=1 | ||
cd | cd yum.repos.d | ||
rm -f *.repo | rm -f *.repo | ||
cp /etc/yum.repos.d/CentOS-Base.repo . | cp /etc/yum.repos.d/!CentOS-Base.repo . | ||
cp /etc/vservers/.distributions/fc3 /etc/vservers/.distributions/centos4</pre> | |||
<span id="d.-vserver-creation"></span> | <span id="d.-vserver-creation"></span> | ||
== D. VServer creation == | == D. VServer creation == | ||
| Line 126: | Line 146: | ||
First, let's create a minimal install of CentOS. We set this up earlier by putting the rpm packages to pkgs/01 | First, let's create a minimal install of CentOS. We set this up earlier by putting the rpm packages to pkgs/01 | ||
<pre class="code">vserver min-centos4 build -m yum --hostname domain.com --interface domain=eth0:192.168.0.136/24 --initstyle sysv --context 500 --force -- -d centos4</pre> | |||
<pre class="code">vserver min-centos4 build -m yum --hostname domain.com --interface domain=eth0:192.168.0.136/24 --initstyle sysv | |||
This should take some time to install depending on your Internet connection. | This should take some time to install depending on your Internet connection. | ||
One thing that is not created by this is the /etc/resolv.conf file. Manually create it, putting in your DNS servers. | |||
Once it is created, you can start it: | Once it is created, you can start it: | ||
<pre class="code">vserver min-centos4 start</pre> | <pre class="code">vserver min-centos4 start</pre> | ||
Then you can enter it: | Then you can enter it: | ||
<pre class="code">vserver min-centos4 enter</pre> | <pre class="code">vserver min-centos4 enter</pre> | ||
</div> | </div> | ||
| Line 211: | Line 177: | ||
</div> | </div> | ||
Document last modified | Document last modified Tue, 12 Apr 2005 17:40:59<br /> | ||
<div class="form"> | <div class="form"> | ||
Revision as of 02:21, 11 November 2025
CentOS 4 Specific Hints
This is meant to help those with this distribution, successfully install Linux-VServer.
A. Kernel Issues
- Get and compile kernel
The CentOS default Kernel release is highly patched already and thus are not compatible with the patches supplied by linux-vserver.org. For this reason, we are going to use a vanilla-kernel (read: an unmodified original linux kernel) from kernel.org. For this part see http://linux-vserver.org/Step-by-Step+Guide+2.6
- Compile the kernel with:
make menuconfig make make modules_install make install
- CentOS, properly modifies the grub.conf file for the new kernel, but we still need to make some more changes:
- Fix /etc/fstab
- CentOS uses LABEL, which is not compatible with a vanilla kernel
- Run 'mount' to see what drives are pointing where
- Change the corresponding lines in /etc/fstab to point to the real device name:
Before:
LABEL=/ / ext3 defaults 1 1 LABEL=/boot1 /boot ext2 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 LABEL=SWAP-hda2 swap swap defaults 0 0 /dev/hdb /media/cdrom auto pamconsole,exec,noauto,managed 0 0 /dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
Mount:
/dev/hda3 on / type ext3 (rw) none on /proc type proc (rw) none on /sys type sysfs (rw) none on /dev/pts type devpts (rw,gid=5,mode=620) usbfs on /proc/bus/usb type usbfs (rw) /dev/hda1 on /boot type ext2 (rw) none on /dev/shm type tmpfs (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
After:
/dev/hda3 / ext3 defaults 1 1 /dev/hda1 /boot ext2 defaults 1 2 none /dev/pts devpts gid=5,mode=620 0 0 none /dev/shm tmpfs defaults 0 0 none /proc proc defaults 0 0 none /sys sysfs defaults 0 0 /dev/hda2 swap swap defaults 0 0 /dev/hdb /media/cdrom auto pamconsole,exec,noauto,managed 0 0 /dev/fd0 /media/floppy auto pamconsole,exec,noauto,managed 0 0
- Fix /boot/grub/grub.conf
- This file also needs to be modified for the same reasons
- Change all lines that use LABEL in /boot/grub/grub/conf to point to the real device name
Change:
kernel /vmlinuz-2.6.9-5.0.3.EL ro root=LABEL=/
To:
kernel /vmlinuz-2.6.9-5.0.3.EL ro root=/dev/hda1
- Disable SELinux
- SELinux conflicts with Linux-VServer. Disable it in /etc/selinux/config (SELINUX=disabled)
- Reboot
- If it boots, you did it right, otherwise, go back and check everything.
B. Tool Hints
- Many like to configure the tools with the following options:
./configure --prefix=/usr --sysconfdir=/etc --with-vrootdir=/vservers make make check make install
C. Adding CentOS 4 Support into the tools
cd /usr/lib/util-vserver/distributions cp fc3 centos4 cd centos4 mkdir pubkeys cp /usr/share/rhn/RPM-GPG-KEY-centos4 ./pubkeys/ (Should be there from a properly updated !CentOS install) ln -s ../redhat/initpre . ln -s ../redhat/initpost . cd pkgs rm -f 01 02 03 vi 01 (put the contents of this into it: http://linux-vserver.org/CentOS_min_install) cd ../yum vi yu/yum.conf and replace with: [main] cachedir=@YUMCACHEDIR@ reposdir=@YUMETCDIR@/yum.repos.d debuglevel=2 logfile=@YUMLOGDIR@/log pkgpolicy=newest distroverpkg=centos-release tolerant=1 exactarch=1 retries=20 obsoletes=1 gpgcheck=1 cd yum.repos.d rm -f *.repo cp /etc/yum.repos.d/!CentOS-Base.repo . cp /etc/vservers/.distributions/fc3 /etc/vservers/.distributions/centos4
D. VServer creation
- Build a new minimal vserver
First, let's create a minimal install of CentOS. We set this up earlier by putting the rpm packages to pkgs/01
vserver min-centos4 build -m yum --hostname domain.com --interface domain=eth0:192.168.0.136/24 --initstyle sysv --context 500 --force -- -d centos4
This should take some time to install depending on your Internet connection.
One thing that is not created by this is the /etc/resolv.conf file. Manually create it, putting in your DNS servers.
Once it is created, you can start it:
vserver min-centos4 start
Then you can enter it:
vserver min-centos4 enter