Thursday, July 14, 2016

Install Windows 7/Windows 10 without CD using pxe

following the howto of the link on  section
- "*** setup adk and create winpe iso image"
- "*** setup linux (samba)  that provide windows 7 installation file"
http://www.atechnote.com/2016/07/install-windows-7windows-10-using-winpe.html

after that you will get an iso, winpex86.iso

*** on pxe server
1- install necessary packages
$ sudo apt-get install pxelinux syslinux dnsmasq

2- create a directory to store all data
$ mkdir ~/winpenetinstall && cd ~/winpenetinstall

3- copy necessary file to our directory,
$ cp /usr/lib/PXELINUX/pxelinux.0 ~/winpenetinstall
$ cp /usr/lib/syslinux/modules/bios/*.c32 ~/winpenetinstall
$ cp /usr/lib/syslinux/memdisk ~/winpenetinstall


4- update boot menu
$ mkdir pxelinux.cfg

- create file ~/ubuntudiskless/pxelinux.cfg/default with the following content
default menu.c32
prompt 0
timeout 300
ONTIMEOUT local
menu title ########## PXE Boot Menu ##########
label 1
menu label ^1) install windows 7
linux memdisk
INITRD winpex86.iso
append iso raw
menu label ^2) install windows 7




5- copy our iso, winpex86.iso, from the first step to ~/winpenetinstall directory
$ cp winpex86.iso ~/winpenetinstall

6- create bash script file to start our tftp and dhcp so we name it as dnsmasq-tftp.sh with content below
#/bin/bash
ifconfig vmnet2 192.168.13.1 up
dnsmasq -i vmnet2 --dhcp-range=192.168.13.100,192.168.13.200 \
    --dhcp-boot=pxelinux.0 \
    --enable-tftp --tftp-root=~/winpenetinstall -d -p0 -K --log-dhcp --bootp-dynamic


7- run the script to start pxe server
$ sudo sh ~/winpenetinstall/dnsmasq-tftp.sh

*** on client that want to install windows 7
1- choose to boot from NIC, after finish booting we will get a cmd shell, by default winpe will assign ip using dhcp, but if you does have dhcp server we can assign ip address using the following command

c:\> netsh interface ip set address "Ethernet0" static 192.168.202.254 255.255.255.0


2- then we can map drive from our samba server to drive z: with the following command

c:\> net use z: \\192.168.202.1\win7

3- now we change the drive to drive z: and run setup.exe, then the installation windows 7 process will start

c:\> z:
z:\> setup.exe


screenshot of windows installation


No comments:

Post a Comment