@bristow-0 I do all my images using Proxmox VMs and I haven’t had any issues. In my case, I only deploy Sysprep-ed Windows so I’m not sure how it would work with Linux. I know that Sysprep strips away any hardware-specific data from the Windows image, so you would need to do the same for Linux.
Posts made by rodluz
-
RE: Deploy a VM on a physical computer?
-
RE: Duda acerca del servidor FOG
@thedark5776 Bueno en mi trabajo no usamos FOG con computadoras Mac. Puede ser que @george1421 te pueda dar sugerencias en cómo usar FOG para la captura y despliegue de imágenes para computadoras Mac.
Me imagino que también depende en que systema operativo. ¿Nos pudieras decir si estas queriendo usar FOG en Mac con MacOS o Windows?
Well at my job, we don’t use FOG to capture and deploy images to Mac computers. Maybe @george1421 has some suggestions for you on how to use FOG to capture and deploy images for Mac.
I imagine that this depends on the operating system you are trying to use. Could you let us know if you are trying to use MacOS or Windows on the Macs? -
RE: Duda acerca del servidor FOG
@thedark5776 solo reiterando y añadiendo a lo que @george1421 respondió. Todo depende en como quisieras usar el servidor FOG. Si quieres usar FOG solo para el despliegue de imágenes unas pocas veces al año, entonces si puedes apagar el servidor. Ahora si quisieras usar FOG para administrar las computadoras después del despliegue usando los servicios incluidos con FOG como snapins, administrador de impresoras, mantenimiento de Active Directory, etc., entonces necesitas mantener el servidor prendido.
Si apagas el servidor, necesitas chequear que el orden de inicio en el BIOS/UEFI tenga el disco duro or Windows Boot Manager como la primera opción.
Just to reiterate and add to what @george1421 answered. It all depends on how you want to use your FOG server. If you want to use it just to image some computers a few times a year, then you could just turn the server off. If you want to manage the computers after imaging them using the included FOG services like snapins, printer management, Active Directory support, etc., then the server needs to stay on.
If you do turn the server off, make sure that the computer’s boot order has the hard drive/Windows boot manager as the first option. -
RE: PXE boot hanging at bzImage and Init.xz during capture task
@yeet I can’t really speak for that model of the ProBook, only have a 650 G8 at hand and it works, but I had an issue like that on 5 EliteBook 850 G6 from a batch of 50.
I also tried all the same things that @Sebastian-Roth suggested with no luck. What I ended up doing for those few was to connect them using a USB-C to Ethernet adapter until right after the bzImage and init.xz then quickly switch the cable to the integrated Ethernet port when it’s connecting to the net0 interface.
As Sebastian said, you may have some luck using ipxe.efi.
-
RE: Modify FOS with new package
@sebastian-roth I figured out how to simplify it using
patch
yesterday. I will look into the link that you posted.As you said, probably not something to be merged into the official FOS kernel. I’m guessing that I would not be the only one using FOG that would find this helpful so (unless there is a better way) I’m going to fork the FOS repo and make my changes there. Like I said before, I will write up what I did and try to streamline it as much as possible for anyone to reproduce.
-
RE: Modify FOS with new package
@george1421 Okay so I found it in /proc/devices and I was able to get the HP program working!!
I had to add the program files to the init.xz filesystem and modify parts of the program to not use themodprobe
&rmmod
commands.
I also had to create the directories needed for dynamically loaded modules and add the compiled module into it so that the program can look for it there.I now have to do the third part which is custom postinit scripts to use the system MAC address instead of the dongle address. This should be pretty easy.
Once I have that working, I am going to do a full write-up of it for reference for myself in the future and anyone else that comes across this.
-
RE: Modify FOS with new package
Hello, it has been a while since I have tried anything for this.
I now have more time and more equipment to actually work on this.I have taken some time to learn a bit more about the Linux kernel and adding a module to it (still so much more to learn).
@george1421 I used the reference link, excluding the arm specific parts of the Kconfig, and compiled the kernel. I can see that the driver was added during the compiling process because I see this outputCC drivers/hpuefi/hpuefi.o
, but I can’t figure out if I did it correctly.
When I pxe boot to Debug Mode I can’t runlsmod
ormodprobe
to find if it was installed.These are the steps I did to compile the kernel. Please let me know if this is correct.
1 . Clone FOS repo from GitHub
2. Run./build.sh --kernel-only --arch x64
3. When the output “We are ready to build. Would you like to edit the config file [y|n]?
” comes up, I opened another terminal and then did this:a. Made directory
hpuefi
in/path/to/fos/kernelsourcex64/drivers/
b. Copied the hpuefi module fileshpuefi.c
&hpuefi.h
to that directory.
c. MadeMakefile
in/path/to/fos/kernelsourcex64/drivers/hpuefi
with content:obj-$(CONFIG_HPUEFI) += hpuefi.o
d. Made
Kconfig
in/path/to/fos/kernelsourcex64/drivers/hpuefi
with content:config HPUEFI tristate "HP UEFI Kernel Module"
e. Modified
/path/to/fos/kernelsourcex64/drivers/Makefile
adding:obj-$(CONFIG_HPUEFI) += hpuefi/
f. Modified
/path/to/fos/kernelsourcex64/drivers/Kconfig
adding beforeendmenu
:source "drivers/hpuefi/Kconfig"
g. Modified
/path/to/fos/kernelsourcex64/arch/x86/configs/x86_64_defconfig
adding:CONFIG_HPUEFI=y
4 . Returned to the original terminal with the prompt still open and entered
n
.
5. Enteredy
for the prompt:HP UEFI Kernel Module (HPUEFI) [N/y/?] (NEW)
6. PressedEnter
for everything else.After it finished, I copied the bzImage to my testing FOG server.
I can boot into Debug Mode but don’t know if the module was added successfully.Sorry for the long read but hope this is enough information to figure out if/what I did wrong.
-
RE: Modify FOS with new package
@george1421 Thank you for the explanation. I am trying to do this not as a fix for the passthrough to work, instead as a patch/workaround. @Sebastian-Roth I don’t think this should be added to FOS for everyone since it doesn’t really fix anything, again it’s just a workaround for me. I have read many threads of people bringing up this issue and maybe this can be a sort of solution for now but it would only work on HP machines.
In my case, iPXE is getting the correct MAC (passthrough from BIOS) but FOS is not. My thought was to run this utility when registering the computer to FOG so that the MAC address attached to it is the passthrough one instead of the adapter.I tried this utility on a laptop running Ubuntu and I know that I can retrieve the system MAC address for sure, and that it is correct. I am limited in my Linux knowledge to know how to add the module to FOS and then compile it. I honestly got lost with the reference that @george1421 provided.
-
Modify FOS with new package
Hello I need some guidance in modifying FOS to include a new package/software.
I have some new HP laptops that don’t have an ethernet port, this means that I have to use a USB-C to Ethernet adapter. When I register those laptops to FOG, the MAC address it adds is from the adapter instead of the passthrough system MAC address. It seems to me like the issue is with HP’s UEFI/BIOS programming, because it also doesn’t passthrough when in Windows/Linux.
HP has a software called “HP Flash and Replicated Setup Utilities for Linux” which I can use to retrieve the system’s MAC address from Linux.
My idea is to modify FOS and add that software to it, then modify the FOG registration script to check if the UEFI/BIOS has a system MAC address that differs to the one FOS can see. (Side note: I know that this would only work with HP computers and it is fine because we only use HP)
I know that I can modify the registration script using this https://wiki.fogproject.org/wiki/index.php/Modifying_the_Init_Image, but I am limited in my Linux knowledge in modifying FOS with the software.
Here are the install commands from “user guide”:
To install the kernel module: • tar xzf hpuefi-mod-x.x.x.tgz • cd hpuefi-mod-x.x.x/ • make • sudo make install To install the utility applications: • tar xzf hp-flash-<version><architecture>.tgz • cd hp-flash-<version><architecture> • sudo ./install.sh
Since FOS is stripped down a lot, it doesn’t have the make command or the Linux headers to be able to run the make command, also it would be horrible to have to install the software every time FOS loads.
I would greatly appreciate any help possible.
Thank you in advanced! -
RE: Very slow boot.php and bzImage during pxe boot
@sebastian-roth I will have to wait until late next month to update. I have to image around 200 computers in the coming weeks so I’ll leave those laptops as the last devices to image in case something breaks with the update.
Thanks for all your help, I will reply to the thread after I update the server. -
RE: Very slow boot.php and bzImage during pxe boot
@sebastian-roth Okay so this is the whole output
>>>Start PXE over IPv4. Station IP address is 10.28.68.52 Server IP address is 10.27.70.100 NBP filename is ipxe.efi NBP filesize is 1060352 Bytes Downloading NBP file... Succeed to download NBP file. iPXE initializing devices...ok iPXE 1.21.1+ (gc64d) -- Open source Network Boot Firmware -- http://ipxe.org Features: DNS FTP HTTP HTTPS iSCSI NFS TFTP SRP VLAN AoE EFI Menu Configuring (net0 30:24:A9:...)..... ok Received DHCP answer on interface net0 tftp://10.27.70.100/default.ipxe... ok http://10.27.70.100/fog/service/ipxe/boot.php... ok Booting... (Press ESC to access the menu)
The iPXE version is newer, because it used to be
1.20.1+
before the change.I was the one that set up the DHCP setting for my colleague’s and my VLANs so they are both
ipxe.efi
.
I checked to make sure that nothing is broken between VLANs and switches and that everything is Gigabit.
I also tried disabling theADVANCE MENU LOGIN
&PXE MENU HIDDEN
just to check and still same issue. I went into the FOG Configuration and updated the MAC addresses too but no luck. -
RE: Very slow boot.php and bzImage during pxe boot
@sebastian-roth Okay so I did that and it’s still acting the same way.
I guess the next step would be to update to the dev-branch?
-
RE: Very slow boot.php and bzImage during pxe boot
@sebastian-roth Thanks for the help. I prefer to swap out the iPXE binaries first and see if that helps.
Do I just copy those linked files into
/tftpboot
then change ownership tofogproject:root
andchmod 655
the files, or is there something else I need to do? -
RE: Very slow boot.php and bzImage during pxe boot
@sebastian-roth Hello and thank you for the reply. I tried multiple times on the other FOG server just to make sure with different “bad” laptops and they all worked.
The other FOG server is on 1.5.9.94.
I took a “bad” laptop to the server room and plugged it in to the same switch that my FOG server is connected to and I am still having the same issue.
I originally thought it could be the NIC on those “bad” laptops so ran speed tests using Windows and Linux(Ubuntu) and they are fine. Maybe it could be something with the MAC on the laptops and FOG not accepting it.
I tried using a USB-C to Ethernet adapter to test and it works perfectly with that.I could just use multiple of those adapters to image the computers but they hold the host data after I register the laptops.
EDIT:
I originally had the kernel version using 4.19.64. Updated it last week to 5.10.34. Just updated it to 5.10.50 today and still having the same issue. -
Very slow boot.php and bzImage during pxe boot
FOG Version: 1.5.9
OS: Ubuntu 20.04 - up to dateHello, I am having a very strange issue. I have 30 new HP EliteBook 850 G6 laptops with sequential serial numbers. Some of the laptops are working perfectly when trying to register them as hosts. Others, are not booting to the host registration screen because the bzImage part takes around a minute to go up 1%.
When going into pxe boot, the laptop take a while to get to the iPXE menu items.http://10.27.70.100/fog/service/ipxe/boot.php... ok #This happens instantly http://10.27.70.100/fog/service/ipxe/boot.php................ ok # This takes around 10-15 seconds http://10.27.70.100/fog/service/ipxe/boot.php......... n% # This takes about 5-10 seconds
Once I press enter on the
Perform Full Host Registration and Inventory
menu option, I get:bzImage................................ n% # Takes around a minute to go up 1%
At first I thought I may have a batch of laptops that are bad, so I looked through the serial numbers and noticed its all over the place.
I took a laptop that I know doesn’t work to a coworker’s area and used her FOG to see what would happen and there was no issue. This makes me think I screwed up on something with my FOG server.
Only changes I have done to the server recently are post download scripts and add new images/snapins.
Any ideas?
Thanks in advanced!
-
RE: FOS not mounting drive for post download scripts.
@george1421 @Sebastian-Roth So I modified my postdownload scripts to manually mount the correct drive if the code that was originally there didn’t do it. It is working for me so I am adding my post download scripts below in case anyone comes across this thread and finds it helpful for them. This works for me in my environment, but may not work for everyone.
I took inspiration from the
getHardDisk()
function in https://github.com/FOGProject/fos/blob/master/Buildroot/board/FOG/FOS/rootfs_overlay/usr/share/fog/lib/funcs.shThe scripts are a bit of a mess but working
fog.postdownload
#!/bin/bash ## This file serves as a starting point to call your custom postimaging scripts. ## <SCRIPTNAME> should be changed to the script you're planning to use. ## Syntax of post download scripts are #. ${postdownpath}<SCRIPTNAME> clearScreen; dots "Running post download scripts." mkdir /ntfs &>/dev/null ntfs-3g -o force,rw $part /ntfs echo "Mounting Device"; if [ "$?" = 0 ]; then if [ ! -d "/ntfs/Windows" ]; then . ${postdownpath}mountLargestPartition fi echo "Done" debugPause . ${postdownpath}getMachineModel . ${postdownpath}getPlatformVersion . ${postdownpath}fog.drivers . ${postdownpath}fog.unattend if [ -z "$auditMode" ]; then . ${postdownpath}fog.bcu fi echo "Unmounting Device"; umount /ntfs; debugPause else echo "Failed to mount device"; sleep 30; debugPause fi
mountLargestPartition
#!/bin/bash dots "Running the manual mount script" drive=$(lsblk -dpno KNAME -I 3,8,9,179,202,253,259 | uniq | sort -V) driveCleaned=${drive//'/dev/'/} #Remove `/dev/` from variable partition="" partSize=0 # Get the largest partition while IFS= read -r line; do tempPartSize=$(blockdev --getsize64 /dev/$line) if [ $tempPartSize -gt $partSize ]; then partSize=$tempPartSize partition="/dev/$line" fi done < <(ls /dev | grep -E "${driveCleaned}[a-zA-Z0-9]+") umount /ntfs &> /dev/null ntfs-3g -o force,rw $partition /ntfs
getMachineModel
#!/bin/bash dots "Retrieving Machine Model" machine=$(dmidecode -s system-product-name) # Gets machine model machine="${machine// /_}" # Replace spaces with underscores echo "${machine}" debugPause
getPlatformVersion
#!/bin/bash dots "Retrieving Platform Version from Registry" # Create a registry file to be able to search the ReleaseId from # reged -x gives out an abort error message but from all my testing it still works. reged -x /ntfs/Windows/System32/config/SOFTWARE HKEY_LOCAL_MACHINE\\SOFTWARE \\ /out.reg &> /dev/null || true if [ -f /out.reg ] then PlatformVersion=$(cat /out.reg | grep 'ReleaseId') PlatformVersion=${PlatformVersion:13:4} # Grab only actual the ReleaseId. Full text looks like "ReleaseId"="1909" echo "${PlatformVersion}" else echo "No registry file found." debugPause dots "Retrieving Platform Version from PlatformVersion.rek file" if [ -f "/ntfs/Windows/PlatformVersion.rek" ] then PlatformVersion=$(<"/ntfs/Windows/PlatformVersion.rek") echo "${PlatformVersion}" debugPause else echo "No platform version file found." debugPause fi fi
fog.drivers
#!/bin/bash dots "Preparing Drivers" mkdir /ntfs/Drivers &>/dev/null; echo "In Progress" dots "Adding drivers to driver path" cp -ar "/images/drivers/${machine}/${PlatformVersion}/" /ntfs/Drivers if [ "$?" = 0 ]; then echo "Done" else echo "Failed!" fi debugPause regfile="/ntfs/Windows/System32/config/SOFTWARE" echo "regfile ${regfile}" key="\Microsoft\Windows\CurrentVersion\DevicePath" echo "key ${key}" devpath="%SystemRoot%\inf;%SystemDrive%\Drivers" echo "devpath ${devpath}" reged -e “$regfile” &>/dev/null <<EOFREG ed $key $devpath q y EOFREG echo “Drivers done.”
fog.unattend
#!/bin/bash dots "Searching for Platform Version" # If $PlatformVersion is not null/empty if [ -n "$PlatformVersion" ]; then echo "Found" debugPause dots "Removing old unattend file" rm -f /ntfs/Windows/Panther/*nattend.xml if [ "$?" = 0 ]; then echo "Done" else echo "Failed to remove file!" echo "Aborting fog.unattend" debugPause sleep 60 return fi debugPause dots "Checking image mode" if [ -n "$auditMode" ] && [ "$auditMode" -eq 1 ]; then echo "AUDIT" debugPause dots "Copying audit mode unattend file" cp "/images/unattends/UnattendAuditMode.xml" "/ntfs/Windows/Panther/Unattend.xml" if [ "$?" = 0 ]; then echo "Done" else echo "Failed!" fi debugPause else echo "OOBE" debugPause dots "Copying unattend file with driver path" cp "/images/unattends/UnattendWithDriverPath.xml" "/ntfs/Windows/Panther/Unattend.xml" if [ "$?" = 0 ]; then echo "Done" else echo "Failed!" fi debugPause fi else echo "No valid Platform Version." echo "Skipping unattend." debugPause fi
fog.bcu
#!/bin/bash dots "Copying BIOS change script" if [ -f "/images/drivers/CMSL-BIOS_Change.ps1" ] then cp "/images/drivers/CMSL-BIOS_Change.ps1" "/ntfs/Drivers" echo "Done" debugPause else echo " Failed! Could not find bios change script." debugPause sleep 60 fi echo "fog.bcu done." debugPause
-
RE: FOS not mounting drive for post download scripts.
I did a few more tests and realized that the
$part
variable is also not set on the image that is working, so probably not that. The other thing I realized, my working image has the NTFS partition on /dev/sda4 but the “bad” image has it on /dev/sda3. Not sure why the new image is different.A bit more context, in case it could be the issue:
- The “good” image is Windows 10 Version 1909
- The “bad” image is Windows 10 Version 20H2
-
FOS not mounting drive for post download scripts.
Hello, I am having an issue when deploying one of my images. After Partclone is done, my post download scripts start, however it seems that the
$part
variable is not set correctly so the/ntfs
directory only hasRecovery
andSystem Volume Information
and is not mounting my ntfs partition.I haven’t changed anything of the mounting part from
fog.postdownload
.dots "Running post download scripts." mkdir /ntfs &>/dev/null ntfs-3g -o force,rw $part /ntfs echo "Mounting Device"; if [ "$?" = 0 ]; then echo "Done" debugPause . ${postdownpath}getMachineModel ... ...
I’m pretty sure it’s something with the specific image I am using, since I tried a different image and I don’t have that problem. I don’t know how my new image could be affecting this, but I didn’t do anything different for the “bad” image.
I’m not sure what I should try to figure out what the issue is.
I was able to mount the /dev/sda3 partition manually usingntfs-3g -o force,rw /dev/sda3 /ntfs
-
RE: Passing variable from ipxe menu to FOS
@george1421 Thanks so much! So what fixed it for me was just removing all the other iPXE commands. So now my parameters are:
login kernel bzImage loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10..../fog/ consoleblank=0 nvme_core.default_ps_max_latency_us=0 rootfstype=ext4 mac=${net0/mac} ftp=10.... storage=10....:/images/ storageip=10.... irqpoll chkdsk=0 capone=1 type=down img=1909GoldenImage imgType=n imgPartitionType=all imgid=43 osid=9 imgFormat=0 auditMode=1 imgfetch init.xz boot || menu
This works perfectly for what I need.