JA2Jj

            Driving forces. Prioritize:
            Tõukejõud. Prioriteetide seadmine:
            Движущие силы. Расставь приоритеты:

              Life              Elu                Жизнь
              Money             Raha               Деньги
              Sex               Seks               Секс
              Faith             Usk                Вера
              Power             Jõud               Власть
              Glory             Au                 Слава
              Rivalry           Konkurents         Соперничество
              Curiosity         Uudishimu          Любопытство
              Love              Armastus           Любовь
              Justice           Õiglus             Справедливость
              Superiority       Üleolek            Превосходство
              Force             Jõud               Сила
              Envy              Kadedus            Зависть
              Fashion           Mood               Мода
              Image             Maine              Впечатление
              Belief in ethics  Usk eetika jõusse  Вера в силу этики

## PROJECT FOG
==============

The whole note is based on following articles:

Install FOG Server on Ubuntu Server 16.04 LTS

  https://www.ceos3c.com/open-source
    /install-fog-server-ubuntu-server-16-04-
    lts-ultimate-guide-virtualbox/

Create Windows 10 Image for Deployment with FOG Server 2019

  https://www.ceos3c.com/sysadmin
    /create-generalized-windows-10-image-deploy-fog-server/

How to update FOG image

  https://www.ceos3c.com/sysadmin/update-fog-image/



# Part I. Build Fog Server (based on Debian Buster x64)
---------------------------------------------------------

The goal is to build FOG-server from Buster Gateway we created last week. A short reminder follows:

  $ su

  # cat /etc/network/interfaces
  # This file describes the network interfaces available on your system
  # and how to activate them. For more information, see interfaces(5).

  source /etc/network/interfaces.d/*

  # The loopback network interface
  auto lo
  iface lo inet loopback

  # The primary network interface
  allow-hotplug enp0s3
  iface enp0s3 inet dhcp

  # The secondary network interface

  allow-hotplug enp0s8
  iface enp0s8 inet static
          address 10.0.10.1
          netmask 255.255.255.0
          gateway 10.0.10.1
          dns-search google.com
          dns-nameservers 10.0.10.1

  # apt-get install dnsmasq
  # tail -n 3 /etc/dnsmasq.conf
  address=/ufo.mars/10.0.10.100
  interface=enp0s8
  dhcp-range=enp0S8,10.0.10.20,10.0.10.25,12h

  # cat /etc/hosts
  127.0.0.1       localhost
  127.0.1.1       buster

  # The following lines are desirable for IPv6 capable hosts
  ::1     localhost ip6-localhost ip6-loopback
  ff02::1 ip6-allnodes
  ff02::2 ip6-allrouters

  # cat /etc/network/if-up.d/00-firewall
  # chmod +x /etc/network/if-up.d/00-firewall

  # systemctl poweroff

Now it's time to rebuild this machine into the FOG server:

  # cat /etc/network/interfaces
  # systemctl stop dnsmasq
  # apt-get autoremove --purge dnsmasq
  # cat /etc/default/grub | grep ^G
  GRUB_DEFAULT=0
  GRUB_TIMEOUT=1
  GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
  GRUB_CMDLINE_LINUX_DEFAULT="" # "quiet"
  GRUB_CMDLINE_LINUX=""
  # update-grub
  # cat /etc/sudoers | grep -PA+2 "^# User p"
  # User privilege specification
  root    ALL=(ALL:ALL) ALL
  opilane ALL=(ALL) NOPASSWD:ALL
  # apt-get install isc-dhcp-server
  # cp /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.orig
  # cat /etc/dhcp/dhcpd.conf
  ddns-update-style none;
  authoritative;
  allow booting;
  allow bootp;
  log-facility local7;
  # required for if option arch.. clause
  option arch code 93 = unsigned integer 16;

  subnet 10.0.10.0 netmask 255.255.255.0 {
    range 10.0.10.20 10.0.10.25;
    option routers 10.0.10.1;
    option broadcast-address 10.0.10.255;
    option subnet-mask 255.255.255.0;

    option domain-name-servers 10.0.10.1;

    if option arch = 00:07 or option arch = 00:09 {
          filename "bootnetx64.efi";
    } else {
          filename "pxelinux.0";
    }

    next-server 10.0.10.1;

    default-lease-time 14400;
    max-lease-time 28800;
  }

  # tail -n4 /etc/default/isc-dhcp-server

  # INTERFACESv4=""
  # INTERFACESv6=""
  INTERFACESv4="enp0s8"

  # apt-get install tftpd-hpa
  # cp /etc/default/tftpd-hpa /etc/default/tftpd-hpa.orig
  # cat /etc/default/tftpd-hpa

  TFTP_USERNAME="tftp"
  TFTP_DIRECTORY="/srv/tftp"
  TFTP_ADDRESS="0.0.0.0:69"
  TFTP_OPTIONS="--secure --create"

  # systemctl enable tftpd-hpa
  # systemctl start tftpd-hpa
  # systemctl status tftpd-hpa

  # apt-get install iptables-persistent

  # cp /etc/iptables/rules.v4 /etc/iptables/rules.v4.before
  # iptables -A INPUT -p udp --dport 67 -j ACCEPT
  # iptables -A INPUT -p udp --dport 69 -j ACCEPT

  # service netfilter-persistent save
  # service netfilter-persistent reload

  # apt-get install syslinux
  # cp /usr/lib/syslinux/memdisk /srv/tftp/

  # apt-get install wget
  # wget http://ftp.ee.debian.org/debian/dists/buster/main/installer-amd64/current/images/netboot/netboot.tar.gz

  # tar xfz netboot.tar.gz -C /srv/tftp/
  # ln -s /srv/tftp/debian-installer/amd64/bootnetx64.efi /srv/tftp/
  # cp /srv/tftp/debian-installer/amd64/boot-screens/txt.cfg /srv/tftp/debian-installer/amd64/boot-screens/txt.cfg.orig
  # cat /srv/tftp/debian-installer/amd64/boot-screens/txt.cfg
  label auto
    menu label ^Automated install
    kernel debian-installer/amd64/linux
    append auto=true priority=critical vga=788 initrd=debian-installer/amd64/initrd.gz --- quiet

  # systemctl enable isc-dhcp-server.service
  # systemctl start  isc-dhcp-server.service
  # systemctl status isc-dhcp-server.service

  # systemctl poweroff

At this point we have built PXE server providing debian buster install image to computers, connected via enp0s8 internal network interface. We can check that everything works using RABBIT diskless Virtual Machine:

  RAM:     1024MB
  CPU:     1 cores
  OS:      Debian Linux x64
  BOOT:    [v] Network
           [ ] All other sources
  Network: Internal

Now it's time to give a closer look to FOG:

  # cd /opt
  # apt-get install git
  # git clone https://github.com/fogproject/fogproject.git fog_stable/
  # cd fog_stable/bin/
  # ./installfog.sh
  # systemctl reboot
  # ls /tftpboot

  10secdelay    intel.pxe   ipxe.pxe      pxelinux.0.old  snponly.efi
  boot.txt      ipxe.efi    ipxe.usb      pxelinux.cfg    undionly.kkpxe
  default.ipxe  ipxe.iso    ldlinux.c32   realtek.efi     undionly.kpxe
  i386-efi      ipxe.kkpxe  libcom32.c32  realtek.kkpxe   undionly.pxe
  intel.efi     ipxe.kpxe   libutil.c32   realtek.kpxe    vesamenu.c32
  intel.kkpxe   ipxe.krn    memdisk       realtek.pxe
  intel.kpxe    ipxe.lkrn   menu.c32      snp.efi

  # cat /etc/dhcp/dhcpd.conf

  ddns-update-style none;
  authoritative;
  allow booting;
  allow bootp;

  log-facility local7;
  # required for if option arch.. clause
  option arch code 93 = unsigned integer 16;

  subnet 10.0.10.0 netmask 255.255.255.0 {
    range 10.0.10.20 10.0.10.25;
    option routers 10.0.10.1;
    option broadcast-address 10.0.10.255;
    option subnet-mask 255.255.255.0;

    option domain-name-servers 192.168.1.1;

    filename "undionly.kpxe";
    next-server 10.0.10.1;

    default-lease-time 14400;
    max-lease-time 28800;
  }

  # cat /etc/default/tftpd-hpa

  # /etc/default/tftpd-hpa
  # FOG Modified version
  TFTP_USERNAME="root"
  TFTP_DIRECTORY="/tftpboot"
  TFTP_ADDRESS=":69"
  TFTP_OPTIONS="-s"

  # systemctl reboot

Now when we are done with Linux Part, again check everything works with diskless RABBIT virtual machine connected to internal network. (See FOG.png in Comics section)


# Part II. Create Windows 10 image
----------------------------------

Download With Media Creation Tool from

  https://www.microsoft.com/en-us/software-download/windows10

What do you want to do?

  ( ) Upgrade the PC now
  (v) Create installation media

Choose which media to use

  ( )
  (v) ISO file

We'll continue with this article tomorrow..

  https://www.ceos3c.com/sysadmin
    /create-generalized-windows-10-image-deploy-fog-server/


# LINKS
-------

1. Known Windows 10 builds

    https://uupdump.ml/known.php

2. ESD to ISO

    https://www.maketecheasier.com/convert-esd-file-iso-windows/

3. dhcpd.conf explained

     https://linux.die.net/man/5/dhcpd.conf

4. Historical dos with CD-ROM boot disk

     http://sdfox7.com/win95/BOOT95B.EXE

5. Windows 10 including Desktop on Raspberry Pi

    https://www.tomshardware.com/reviews
      /install-windows-10-on-raspberry-pi,5993.html

# ANNEX A. HISTORICAL PXE BOOT DOS

  cat /srv/tftp/pxelinux.cfg/default
  # D-I config version 2.0
  # search path for the c32 support libraries (libcom32, libutil etc.)
  path debian-installer/amd64/boot-screens/
  include debian-installer/amd64/boot-screens/menu.cfg
  default debian-installer/amd64/boot-screens/vesamenu.c32
  prompt 0
  timeout 0

Replace with

  default memdisk initrd=winb95b.IMA

Show running daemons

  service --status-all

Restart tftp daemon

  systemctl restart tftpd-hpa

Extract banana DOS

  # cd /srv/tftp
  # wget http://sdfox7.com/win95/BOOT95B.EXE
  # unzip BOOT95B.EXE
  # rm BOOT95B.EXE
  # ls
  bootnetx64.efi    ldlinux.c32  pxelinux.0    version.info
  debian-installer  memdisk      pxelinux.cfg  winb95b.IMA

test with RABBIT virtual machine
