Set up RHCSA/RHCE Lab with CentOS

Overview of the Lab

Before we get started, let's take a look at an overview of our lab. For our lab we will have one physical system and three virtual machines:

Type Hostname IP Address
Physical host.example.com 192.168.1.50
Virtual server1.example.com 192.168.122.50
Virtual tester1.example.com 192.168.122.150
Virtual outsider1.example.org 192.168.100.100

  1. Download and Install CentOS on host. 

  2. Create an Apache Installation Server on host.

    1. yum install httpd
    2. chkconfig httpd on
    3. mount -o loop centos.iso /media
    4. mkdir /var/www/html/inst
    5. cp -ar /media/. /var/www/html/inst
    6. chcon -R --reference=/var/www/html /var/www/html/inst
    7. service httpd start
    8. open port 80 with system-config-firewall-tui from command line.
  3. Create a vsftpd Installation Server on host.

    1. yum install vsftpd
    2. chkconfig vsftpd on
    3. mount -o loop centos.iso /media
    4. mkdir /var/ftp/pub/inst
    5. cp -ar /media/. /var/ftp/pub/inst
    6. chcon -R -t public_content_t /var/ftp
    7. service vsftpd start
    8. open port 21 with system-config-firewall-tui from command line.
  4. Install and Configure KVM

    1. yum -y install qemu-kvm python-virstinst virt-manager virt-top virt-viewer libvirt libvirt-client
    2. mkdir -p /home/qemu/images
    3. usermod -d /home/qemu qemu
    4. chown -R qemu.qemu /home/qemu
    5. chcon --reference /var/lib/libvirt/images /home/qemu/images
    6. rmdir /var/lib/libvirt/images
    7. ln -s /home/qemu/images/ /var/lib/libvirt/images
  5. Set up a Network Adapter for outsider1

    1. Download outsider1.xml file.
    2. virsh net-define --file outsider1.xml
  6. Download the Following Kickstart Files

    1. Download ks_server1.cfg, ks_tester1.cfg, and ks_outsider1.cfg.
    2. Move the cfg files to /var/ftp/pub
    3. virt-install -n server1.example.com \
      --disk path=/var/lib/libvirt/images/server1.example.org.img,size=12 \
      --vcpus=2 -r 768 --os-type=linux --os-variant=rhel6 \
      --network network:default --vnc --accelerate \
      --location ftp://192.168.1.50/pub/inst \
      --extra-args "ks=ftp://192.168.1.50/pub/ks_server1.cfg"
    4. virt-install -n tester1.example.com \
      --disk path=/var/lib/libvirt/images/tester1.example.org.img,size=12 \
      --vcpus=2 -r 768 --os-type=linux --os-variant=rhel6 \
      --network network:default --vnc --accelerate \
      --location ftp://192.168.1.50/pub/inst \
      --extra-args "ks=ftp://192.168.1.50/pub/ks_tester1.cfg"
    5. virt-install -n tester1.example.com \
      --disk path=/var/lib/libvirt/images/tester1.example.org.img,size=12 \
      --vcpus=2 -r 768 --os-type=linux --os-variant=rhel6 \
      --network network:default --vnc --accelerate \
      --location ftp://192.168.1.50/pub/inst \
      --extra-args "ks=ftp://192.168.1.50/pub/ks_tester1.cfg"

Comments

Popular posts from this blog

Introduction