1, configure the YUM source to the instructor location.
in the folder, '/etc/yum.repos.d', create the file,
the content is as:
baseurl= the location of the YUM source
in my case the location of YUM source is "= http://instructor.example.com/pub/rhel6/dvd"
make sure you have network connection to http://instructor.example.com/pub/rhel6/dvd, this has already been done before.
gpgcheck=0 (without the gpg check)
Set the YUM source at Instructor computer, first insert the CentOS ISO image into the VirtualBox, as below,
set the automatic mount the CentOS ISO image by editing the configuration file, /etc/fstab, below is the result of command "cat /etc/fstab"
reboot the computer,
the last line as: "/dev/cdrom /var/ftp/pub/rhel6/dvd iso9660 auto,ro 0 0"
the folder /var/ftp/pub is linked to /var/www/html/pub, as below picture shows,
so this DVD file can be accessed by http protocol from the student computer. Below pic shows the link:
2, set the selinux as enforcing mode,
edit the file /etc/sysconfig/selinux
needs to reboot for SELinux take effect.
3, enable the firewall,
service iptables save
4, mount the example.iso to /mnt/iso, and auto mount at system boot time,
mkdir /mnt/iso mount -o loop /root/examine.iso /mnt/iso
Write into the fstab file,
vim /etc/fstab /root/examine.iso /mnt/iso iso9660 defaults,loop 0 0
to test the result,
mount -a df -h
5, showmount -e localhost to show the directory shared in your system
if the command didn't display anything, means the NFS service didn't start,
if NFS service start fail, means rpcbind service didn't start,
service rpcbind start service nfs start showmount -e localhost