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"

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
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 with content below
ifconfig vmnet2 up
dnsmasq -i vmnet2 --dhcp-range=, \
    --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/

*** 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

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

c:\> net use z: \\\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