LoginSignup
2
2

More than 5 years have passed since last update.

ネットワークインストールサーバ with Vine Linux 6.3

Last updated at Posted at 2015-05-15

Vine Linux 6.3 をネットワークインストールサーバにする

素の Red Hat のバージョンが1桁だった頃に一度作ったが少しやり方が変わっていたようなのでここで改めて作ってみた時のログ。環境は愛用の Vine を使う。

  • Vine Linux 6.3のマシン1台(192.168.0.2)
  • インストールしたいディストリビューションの ISO 用意

ネットワークインストールの概要

マシンは PXE ブートができる必要がある。PC はブート時にネットワークインストールサーバ側に問い合わせしにいき、インストールプロセスが走る。

構築手順

  1. 必要なパッケージインストール
  2. HTTP Server 設定
  3. ブートイメージの配置
  4. PXEブートの設定
  5. TFTP Server 設定
  6. DHP Server 設定

必要なパッケージインストール

以下を apt-get install する。

  • dhcp-server
  • tftp-server
  • syslinux
  • apache2

HTTP Server 設定

下記のような設定ファイルを作る。

# cat /etc/apache2/conf.d/pxeboot.conf
Alias /vine63 /var/pxe/vine63
<Directory /var/pxe/vine63>
   Options Indexes FollowSymLinks
   Order Deny,Allow
   Deny from all
   Allow from 127.0.0.1 192.168.0.0/24
</Directory>

ブートイメージの配置

インストール用 ISO とブートイメージの準備

ISO はダウンロードしておく、ここでは「Vine63-DVD-x86_64.iso」とする。

# mount -t iso9660 -o loop /home/takeshi/ISO/Vine/Vine63-DVD-x86_64.iso /var/pxe/vine63
# mkdpr -p /var/pxe/vine63
# mkdir -p /var/lib/tftpboot/vine63
# cp /var/pxe/vine63/images/pxeboot/vmlinuz /var/lib/tftpboot/vine63/
# cp /var/pxe/vine63/images/pxeboot/initrd.img /var/lib/tftpboot/vine63/

PXE ブートのイメージを配置

# mkdir -p /var/lib/tftpboot/
# cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
# cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/

PXE ブート時のメニュー画面用ファイル作成

# cat /var/lib/tftpboot/pxelinux.cfg/default
timeout 100
default menu.c32

menu title ########## PXE Boot Menu ##########
label 1
   menu label ^1) Install VineLinux 6.3
   kernel vine63/vmlinuz
   append initrd=vine63/initrd.img method=http://192.168.0.2/vine63 devfs=nomount

label 2
   menu label ^2) Boot from local drive
   localboot

TFTP Server 設定

# cat /etc/xinetd.d/tftp
# default: off
# description: The tftp server serves files using the trivial file transfer \
#       protocol.  The tftp protocol is often used to boot diskless \
#       workstations, download configuration files to network-aware printers, \
#       and to start the installation process for some operating systems.
service tftp
{
        socket_type             = dgram
        protocol                = udp
        wait                    = yes
        user                    = root
        server                  = /usr/sbin/in.tftpd
        server_args             = -s /var/lib/tftpboot
        disable                 = no
        per_source              = 11
        cps                     = 100 2
        flags                   = IPv4
}

DHCP Server 設定

# cat /etc/dhcp/dhcpd.conf
#
# DHCP Server Configuration file.
#   see /usr/share/doc/dhcp*/dhcpd.conf.sample
#   see 'man 5 dhcpd.conf'
#
# -update-style none;
# ddns-update-style ad-hoc;
# ddns-update-style interim;
# ignore client-updates;

allow booting;
allow bootp;

subnet 192.168.0.0 netmask 255.255.255.0 {
        range 192.168.0.240 192.168.0.250;
        option routers                  192.168.0.1;
        option broadcast-address        192.168.0.255;
        option subnet-mask              255.255.255.0;
        option domain-name-servers      192.168.0.2;
        #option time-offset             -18000; # Eastern Standard Time

        default-lease-time 21600;
        max-lease-time 43200;

        #option vendor-class-identifier "PXEClient"; # ISC DHCP 2.0
        filename                        "pxelinux.0";
        next-server                     192.168.0.2;
        host acer{
                hardware ethernet C4:54:44:8B:AE:92;
                fixed-address 192.168.0.245;
       }
}

試行

インストールしたい PC をネットワークブートするように起動する。後はメニューが出てくるのでインストールプロセスをいつもどおり実施する。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2