virtualbox centos7 pxe 설치

컴퓨터 2019. 11. 27. 10:42

virtualbox centos7 pxe 설치
https://powerade-kim.blogspot.com/2019/02/pxe.html


DHCP서비스와 충돌하는 dnsmasq 서비스 종료
ps -ef | grep dnsmasq

kill -9 프로세스 번호
systemctl disable dnsmasq



에러2:
/sbin/dmsquash-live-root: line 286: printf: write error: No space left on device

이 에러는 컴퓨터 자체의 메모리가 부족함을 뜻한다. 메모리를 2기가 이상으로 변경하면 정상적으로 진행이 된다.

 

 

 

Pxe Boot Server Setup on RHEL 7 | Kicktstart Server on RHEL 7 | Pxe Server Configure Step by Step
https://www.youtube.com/watch?v=eeYMMi5Hvg4

1 http server (필수는 아님)
2 tftp server
3 dhcp server
4 yum should configured
5. selinux and iptables should be disable

systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld

iptables -L


sestatus


vi /etc/sysconfig/selinux
SELINUX=enforcing 을 SELINUX=disabled 로 변경후 저장한다.
reboot

SELinux 해제
https://www.lesstif.com/pages/viewpage.action?pageId=6979732


6 boot the client with dhcp aloing bootp

################################################

yum install httpd xinetd syslinux tftp-server dhcp* vsftpd


#mount /dev/cdrom /mnt

mkdir /var/www/rhel7


cp -var /mnt/* /var/www/rhel7/
chmod -R 755 /var/www/rhel7/

또는
mount /dev/cdrom /var/www/rhel7


vim /etc/httpd/conf.d/pxe.conf

Alias /rhel7 /var/www/rhel7/


Options Indexes FollowSymLinks
Order Deny,Allow
Allow from all



# vsftpd 방식

mdkir /var/ftp/pub/centos7

mount /dev/cdrom /var/ftp/pub/centos7


cp -a /usr/share/syslinux/* /var/lib/tftpboot/

2개만 하면 될 듯
menu.c32
pxelinux.0

mkdir /var/lib/tftpboot/rhel7
cp /var/www/rhel7/images/pxeboot/vmlinuz /var/lib/tftpboot/rhel7/
cp /var/www/rhel7/images/pxeboot/initrd.img /var/lib/tftpboot/rhel7/


# vsftpd 방식
cp /var/ftp/pub/images/pxeboot/vmlinuz /var/lib/tftpboot/rhel7/
cp /var/ftp/pub/images/pxeboot/initrd.img /var/lib/tftpboot/rhel7/


mkdir /var/lib/tftpboot/pxelinux.cfg


vi /var/lib/tftpboot/pxelinux.cfg/default

default menu.c32
timeout 100

menu title ### RHEL 7 PXE BOOT Menu ###

label 1
menu lable ^1) Install RHEL 7
menu default
kernel rhel7/vmlinuz
#append initrd=rhel7/initrd.img repo=http://192.168.56.10/rhel7

append initrd=rhel7/initrd.img ks=ftp://192.168.56.10/pub/ks.cfg


vi /etc/xinetd.d/tftp

        disable                 = no


systemctl restart httpd
systemctl enable httpd



subnet 192.168.56.0 netmask 255.255.255.0 {

    option routers 192.168.56.2;
    option subnet-mask 255.255.255.0;
    range dynamic-bootp 192.168.56.160 192.168.56.200;

    option domain-name-servers 150.183.95.96;
    default-lease-time 21600;
    max-lease-time 43200;

    allow booting;
    allow bootp;
    next-server 192.168.56.154;   # 부팅 파일이 있는 서버 주소
    filename "pxelinux.0";
}


dhcpd configtest


systemctl restart dhcpd.service
systemctl enable dhcpd.service


cp anaconda-ks.cfg /var/www/html/
chmod 755 /var/www/html/anaconda-ks.cfg


vi /var/www/html/anaconda-ks.cfg


vi /var/lib/tftpboot/pxelinux.cfg/default


systemctl restart xinetd
systemctl enable xinetd


systemctl start vsftpd
systemctl enable vsftpd

 

# ftp 동작 테스트
wget ftp://192.168.56.10/pub/GPL

 

# selinux 때문에 안 되면
setsebool -P allow_ftpd_full_access on


centos7 kickstart example
https://github.com/archonik/centos-7-kickstart-example/blob/master/ks.cfg

'컴퓨터' 카테고리의 다른 글

linux 하드 디스크 추가  (0) 2019.11.27
버추얼 박스 네트워크  (0) 2019.11.27
인터넷 도메인 domain 검색  (0) 2019.11.22
vagrant 설정  (0) 2019.11.13
Decision trees in python with scikit-learn and pandas  (0) 2019.11.07