How to install the chroot environment of centos

Source: Internet
Author: User
Sometimes we have specific development requirements for the OS environment, but do not want to affect the current system environment. Now we can use the chroot environment. Note that the root permission is required to install the chroot environment. 1) First, create a directory for the chroot environment, such as mkdir/data/jails /...
Sometimes we have specific development requirements for the OS environment, but do not want to affect the current system environment. Now we can use the chroot environment.
Note that the root permission is required to install the chroot environment.
1) First, create a directory for the chroot environment, for example, mkdir/data/jails/myos
2) Download and install the corresponding centos-release file from centos official website or image website, for example: wget centos-release-5-8.el5.centos.x86_64.rpmhttp: // up.2cto.com/2012/0327/20120327042858716.rar
Rpm-I -- nodeps -- root =/data/jails/myos centos-release-5-8.el5.centos.x86_64.rpm 3) install the yum tool for the chroot environment so that we can continue to install other software packages in the chroot environment: yum-y -- installroot =/data/jails/myos install yum
4) mount some nodes to the chroot environment (this is not required here, but if www.2cto.com you need to enable some services in the chroot environment, you 'd better do it ): mount -- bind/dev/data/jails/myos/devmount -- bind/proc/data/jails/myos/procmount -- bind/sys/data/jails/myos/sys
5) after the setup is complete, go in and adjust the time zone to make it possible: chroot/data/jails/myscp/usr/share/zoneinfo/Asia/Shanghai/etc/localtime) if you find that your system network is faulty, it may be that your DNS settings are incorrect. please refer to/etc/resolv in the main environment. conf file.
Author: fire Meteor X
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.