Fog Project - Serviço de imagens/formatação PXE


Como instalar:
1 - Download Ubuntu Ubuntu Server 16.10: https://www.ubuntu.com/download/server/thank-you?version=16.10&architecture=amd64

2 - Depois de instalar o Ubuntu ativando a opção SSH server, acesse usando o Putty ou Mobaxterm

3 - Instalar Git e Update:
Comandos:

apt-get update -y
apt-get upgrade -y
apt-get install git -y
git clone https://github.com/FOGProject/fogproject.git /root/fogproject
cd /root/fogproject/bin
./installfog.sh


4 - Durante a instalação, use as opções de acordo com a necessidade, esta é para caso você já tenha um DHCP server:
  1. Choose 2 (ubuntu).
  2. Choose N (normal).
  3. Leave the IP address as 192.168.0.61(que é o ip do pc com fog)
  4. Choose Yes for the router address setup and accept the default (192.168.0.1 ou altere para o ip do dhcp).
  5. Same for DNS.
  6. Choose No when invited to change the default NIC.
  7. Confirm Yes for dhcp service.
    1. You'll have to configure the Windows Server if you don't want to use FOG for DHCP.
  8. Install additional language packs if you need them, otherwise select No.
  9. Leave the default answer No for the invitation to donate computer resources.
  10. Confirm Yes to the summary information.
  11. Press Enter to acknowledge the MySQL warning (see below for the step that this refers to).
  12. Set a password for MySQL when requested.
  13. Did you leave the password blank?  Answer No.
  14. Enter your MySQL password and confirm it.
  15. Start a browser
  16. Browse to http://192.168.0.62/fog/management.
  17. Click Install/Upgrade now.
  18. Press Enter, once the database is updated / installed.
5 - Se você tem um DHCP que não pode alterar nada então instale o DNSMASQ
obs.: Você deve adicioar a opção 66 next-server como o ip do servidor FOG e o fileboot name que geralmente é o undio
Comandos:

apt-get install dnsmasq
Criar ltsp.conf 
Comandos:

nano /etc/dnsmasq.d/ltsp.conf

Cole o script abaixo alterando o que for pertinente
# Sample configuration for dnsmasq to function as a proxyDHCP server,
# enabling LTSP clients to boot when an external, unmodifiable DHCP
# server is present.
# The main dnsmasq configuration is in /etc/dnsmasq.conf;
# the contents of this script are added to the main configuration.
# You may modify the file to suit your needs.

# Don't function as a DNS server:
port=0

# Log lots of extra information about DHCP transactions.
log-dhcp

# Dnsmasq can also function as a TFTP server. You may uninstall
# tftpd-hpa if you like, and uncomment the next line:
# enable-tftp

# Set the root directory for files available via FTP.
tftp-root=/tftpboot

# The boot filename.
dhcp-boot=pxelinux.0

# rootpath option, for NFS
dhcp-option=17,/images

# kill multicast
dhcp-option=vendor:PXEClient,6,2b

# Disable re-use of the DHCP servername and filename fields as extra
# option space. That's to avoid confusing some old or broken DHCP clients.
dhcp-no-override

# PXE menu.  The first part is the text displayed to the user.  The second is the timeout, in seconds.
pxe-prompt="Press F8 for boot menu", 3

# The known types are x86PC, PC98, IA64_EFI, Alpha, Arc_x86,
# Intel_Lean_Client, IA32_EFI, BC_EFI, Xscale_EFI and X86-64_EFI
# This option is first and will be the default if there is no input from the user.
pxe-service=X86PC, "Boot from network", pxelinux

# A boot service type of 0 is special, and will abort the
# net boot procedure and continue booting from local media.
pxe-service=X86PC, "Boot from local hard disk", 0

# If an integer boot service type, rather than a basename is given, then the
# PXE client will search for a suitable boot service for that type on the
# network. This search may be done by multicast or broadcast, or direct to a
# server if its IP address is provided.
# pxe-service=x86PC, "Install windows from RIS server", 1

# This range(s) is for the public interface, where dnsmasq functions
# as a proxy DHCP server providing boot information but no IP leases.
# Any ip in the subnet will do, so you may just put your server NIC ip here.
# Since dnsmasq is not providing true DHCP services, you do not want it
# handing out IP addresses.  Just put your servers IP address for the interface
# that is connected to the network on which the FOG clients exist.
# If this setting is incorrect, the dnsmasq may not start, rendering
# your proxyDHCP ineffective Você deve alterar aqui para seu dhcp
dhcp-range=192.168.1.10,proxy

# This range(s) is for the private network on 2-NIC servers,
# where dnsmasq functions as a normal DHCP server, providing IP leases.
# dhcp-range=192.168.0.20,192.168.0.250,8h

# For static client IPs, and only for the private subnets,
# you may put entries like this:
# dhcp-host=00:20:e0:3b:13:af,10.160.31.111,client111,infinite

service dnsmasq restart
Desabilite o firewall
service ufw disable
Dê permissões

chown -R fog:root /images

chown -R fog:root /tftpboot

Reinicie o servidor e tente boot em alguma máquina via PXE

Caso dê tudo certo e nas opções de cadastras ou outras derem o erro PANIC KERNEL você precisará executar os seguintes comandos:
mv /tftpboot/pxelinux.0 /tftpboot/pxelinux.0.OLD1

mv /tftpboot/undionly.kpxe /tftpboot/pxelinux.0

Você precisará alterar alguns itens
Vá na pasta abaixo e delete o arquivo bzImage
rm -r /var/www/fog/service/ipxe/bzImage

rm -r /var/www/fog/service/ipxe/bzImage32

Vá no site: https://fogproject.org/kernels/
Baixe a versão mais nova bzImage e bzImage32

wget https://fogproject.org/kernels/bzImage

wget https://fogproject.org/kernels/bzImage32

Para DHCP windows: https://wiki.fogproject.org/wiki/index.php/FOGUserGuide

FOG Configuration>FOG Settings> TFTP Server> Altere a senha

Como testar se o serviço tftp está ok: https://wiki.fogproject.org/wiki/index.php/Unable_to_connect_to_TFTP

Como adicionar ISO para boot:
Vá em FOG Configuration > iPXE New Menu Entry
Menu item: Dê um nome básico para o item ex.: ubuntuserver1610
Description: Dê um nome mais completo (será o nome que aparecerá no boot): Ubuntu Server 16.10
Parameters: Dependendo do tipo de iso e sistema esses parâmetros mudam, para linux e derivados user este;

kernel http://ipdoseuserver/fog/service/ipxe/memdisk iso
initrd http://ipdoseuserver/iso/ubuntu-16.10-desktop-amd64.iso
chain memdisk ||
goto MENU

Lembrando que você deve criar uma pasta chamada iso dentro de var/www/ e dar a permissão CHMOD -R 777 para ela

Coloque para todos os hosts e salve.

Link interessante sobre a ferramenta PDQ + FOG = https://www.youtube.com/watch?v=xoxwUC-fOJU


Como criar imagem:

1 - Primeira coisa a se fazer é com o client conectar na rede via cabo, verifique se na BIOS a opção boot via network LEGACY está habilitado.

2 - Faça o boot via rede, na tela do FOG selecione a opção QUICK REGISTRATION AND INVENTORY para registrar o host no sistema do FOG.

3 - Seu host aparecerá em http://ipdoseuserver/fog/management/index.php?node=host&sub=list

4 - Vá em http://ipdoseuserver/fog/management/index.php?node=image&sub=add preencha os campos, selecione o sistema operacional e salve.

5 - Vá em seu Host que você fará a cópia, clique nele, altere Host Image para a imagem name que você criou, salve novamente.

6 - Inicie o windows normalmente, com tudo instalado e configurado da forma que você quer a imagem você precisará usar um comando chamado sysprep, iniciar > cmd (execute como administrator) > cd sysprep > sysprep /oobe /generalize /shutdown

7 - Enquanto o cliente está fazendo a configuração você terá que acessar o servidor http://ipdoseuserver/fog/management/index.php?node=host&sub=list na linha do seu host existem duas setas uma para cima e a outra para baixo, você deverá clicar na seta para cima, desmarque a opção WAKE ON LAN e deixe  Schedule Instant e então clique em create capture task

8 - O servidor criar a tarefa, agora você precisa esperar o client desligar, quando isso acontecer, ligue-o novamente e faça o boot novamente via network, automaticamente o servidor começará a capturar a imagem, a partir daí é só esperar.

Como fazer o Deploy da imagem

1 - Com a BIOS configurada para Boot network legacy faça o boot via rede

2 - Acesse o portal do FOG via PXE e então selecione a opção deploy

3 - Selecione a imagem e pronto, só esperar

Proxima
Esta é a mais nova página atual
Anterior
Proxima »

2 comentários

Clique aqui para comentários
William A. dos Santos
Administrador
13 de julho de 2018 às 09:25 ×

"5 - Se você tem um DHCP que não pode alterar nada então instale o DNSMASQ"

Não entendi essa parte do DHCP que não posso alterar, se eu posso alterar o item 66 e 67 dentro do DHCP eu ignoro essa parte do DNSMASQ?

Responder
avatar
mackenzegahm
Administrador
4 de março de 2022 às 07:47 ×

Harrah's Cherokee Casinos & Gaming - Mapyro
Find Casinos 포천 출장마사지 & 화성 출장안마 Gaming near you, and ways to get from 상주 출장샵 Harrah's Cherokee Casinos & Gaming 성남 출장마사지 locations in Cherokee, 양주 출장안마 NC.

Responder
avatar
Obrigado pelo seu comentário