Hello,
I’m working with CedricoR,
We don’t have probrem with windows host working with uefi.
On Ubuntu host, system crash booting refind after pxe. If we choose EXIT in FOG host conf, we have to choose manually booting from harddrive. Then Ubuntu works
Posts made by lebrun78
-
RE: problem after deployment with release 1.5.10
-
RE: FOG 1.5.10 officially released
Hello and thank you for your very useful job !
The installation instructions in https://news.fogproject.org/fog-1-5-10-officially-released/ link seams not good.
The link drives me to installer archiveArnaud
-
RE: powershell snapin no output, non error
@JJ-Fullmer
No log film created.
Task created as you proposed require administrator login to be executed. That is not the purpose of the snapin.
But I have no idea how to work around the problem@Tom-Elliott
Do you have any idea how to keep pxe boot with eufi Windows ?If I have to get up from my chair every time I have to deploy, that’s no big deal.
-
RE: powershell snapin no output, non error
@Tom-Elliott
Yes Tom, I agree,
That’s why JJ-Fullmer create a task executed as user administrator to modify the boot order.
I have a powershell problem, to how to create a task trigger at the creation of the task -
RE: powershell snapin no output, non error
@JJ-Fullmer
Thank you for your work, this script runs with snapin but does not do the expected job, the pxe is not ranked àat the good place :$adminUsr = "$($ENV:ComputerName)\Administrateur" $trigger = New-ScheduledTaskTrigger -AtLogOn -User $adminUsr; $settings = New-ScheduledTaskSettingsSet -WakeToRun -Priority 0; $principal = New-ScheduledTaskPrincipal -UserId $adminUsr -RunLevel Highest -LogonType Interactive; $sb = { $firmware = cmd /c "C:\windows\system32\bcdedit.exe" /enum firmware; $fullLine = (($firmware | Select-String "IPV4" -Context 1 ).context.precontext)[0]; $GUID = '{' + $FullLine.split('{')[1]; $result = cmd /c "C:\windows\system32\bcdedit.exe" /set "{fwbootmgr}" displayorder $GUID /addfirst; #make c:\temp if it doesn't exist if (!(Test-Path 'C:\temp')) { mkdir 'C:\temp'; } #log everything in a new C:\temp\firmware.log file New-Item -path C:\temp\firmware.log -itemType File -value "Firmware: $($firmware | out-string)`n`nFullLine: $fullLine`nGUID_ipV4: $GUID`nresult: $result`n" -force; } New-Item C:\netboot.ps1 -value $sb.tostring() -force; $action = New-ScheduledTaskAction -Execute "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -Argument "-File C:\netboot.ps1" $task = New-ScheduledTask -Action $action -Description "update bcd" -Principal $principal -Trigger $trigger -Settings $settings; $taskName = "boot-to-IPV4"; Register-ScheduledTask -InputObject $task -TaskName $taskName; Start-ScheduledTask -TaskName $taskName; while ((Get-ScheduledTask $taskName).State -eq 'Running') { Start-Sleep -Seconds 1; } Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -EA 0; move-Item 'C:\netboot.ps1' 'C:\netbootOLD.ps1' -force -ea 0;
-
RE: powershell snapin no output, non error
@JJ-Fullmer
I tried command line step by step with psexec, it works
I tried command line step by step with your modified script, it works
I tried snapin withSnapin Command read-only: C:\windows\SysWOW64\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy bypass -NoProfile -File boot-uefi-pxe_win.ps1
and with boot-uefi-pxe_win.ps1
$bcdedit = "C:\windows\System32\bcdedit.exe" $firmware = & {start-process -filepath $bcdedit -args "/enum firmware" -Wait -RedirectStandardOutput output.txt ; get-content output.txt; remove-item output.txt} $fullLine = (($firmware | Select-String "IPV4" -Context 1 ).context.precontext)[0] $GUID = '{' + $FullLine.split('{')[1] $result = & {start-process $bcdedit -args "/set `"{fwbootmgr}`" displayorder $GUID /addfirst" -Wait -RedirectStandardOutput output.txt ; get-content output.txt; remove-item output.txt} # $firmware = $(bcdedit /enum firmware) # $fullLine = (($firmware | Select-String "IPV4" -Context 1 ).context.precontext)[0] # $GUID = '{' + $FullLine.split('{')[1] # $result = $(cmd /c bcdedit /set "{fwbootmgr}" displayorder $GUID /addfirst) $dateheure = (date).ToString() if (!(Test-Path 'C:\temp')) { mkdir 'C:\temp' } #log everything in a new C:\temp\firmware.txt file New-Item -path C:\temp\firmware.txt -itemType File -value "Firmware: $($firmware | out-string)`n`nFullLine: $fullLine`nGUID: $GUID`nresult: $result`ndate: $dateheure`n" -force
And the result is allways
Get-Content C:\temp\firmware.txt Firmware: FullLine: GUID: result: date: 03/04/2023 17:30:13
My OS is Windows 11
-
RE: powershell snapin no output, non error
@JJ-Fullmer
Running your script step by step works, I don’t understand why it doesn’t work by snapin.
Is it possible to test a script by the system account used by fog service? -
RE: powershell snapin no output, non error
@JJ-Fullmer
Thank you for your proposition
I now have the file with the title of each item, but the values are empty I modified by adding the date, just to have a trace$firmware = (bcdedit /enum firmware) $fullLine = (($firmware | Select-String "IPV4" -Context 1 ).context.precontext)[0] $GUID = '{'bcdedit /set "{fwbootmgr}" displayorder $GUID /addfirst) $datetime = (date).ToString() if (!(Test-Path 'C:\temp')) { mkdir 'C:\temp' } #log everything in a new C:\temp\firmware.txt file New-Item -path C:\temp\firmware.txt -itemType File -value "Firmware: $($firmware | out-string)`n`nFullLine: $fullLine`nGUID: $GUID`nresult: $result`ndate: $datetime`n" -force
I get
Firmware: FullLine: GUID: result: date: 03/04/2023 09:35:36
I tried adding cmd /c > it’s the same
-
RE: powershell snapin no output, non error
When I run the command
C:\> powershell.exe -ExecutionPolicy RemoteSigned -NoProfile -File boot-uefi.ps1
I get :
L'opération a réussi.
-
powershell snapin no output, non error
I try to run the script as snapin
# Create text file containing firmware settings bcdedit /enum firmware > c:\temp\firmware.txt # Find the line containing "IPV4", and read the line just before that $FullLine = (( Get-Content c:\temp\firmware.txt | Select-String "IPV4" -Context 1 ).context.precontext)[0] # Delete our temporary file #del firmware.txt # Split line into fields using the first left-curly as the delimiter, # and then grab the second field (and restore the first left-curly) $GUID = '{' + $FullLine.split('{')[1] # Set the boot order #bcdedit /set {fwbootmgr} displayorder $GUID {bootmgr} cmd /c bcdedit /set "{fwbootmgr}" displayorder $GUID /addfirst # SIG # Begin signature block # MIIECAYJKoZIhvcNAQcCoIID+TCCA/UCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
But I get no c:\temp\firmware.txt file
I think the script is not executedHere is the command line viewed on the fog console:
powershell.exe -ExecutionPolicy RemoteSigned -NoProfile -File boot-uefi.ps1I get this log
------------------------------------------------------------------------------ 31/03/2023 16:08:35 Client-Info Client Version: 0.11.19 31/03/2023 16:08:35 Client-Info Client OS: Windows 31/03/2023 16:08:35 Client-Info Server Version: 1.5.8 31/03/2023 16:08:35 Middleware::Response Success 31/03/2023 16:08:35 SnapinClient Running snapin boot-uefi-pxe-first 31/03/2023 16:08:35 Middleware::Communication Download: http://148.60.x.x//fog/service/snapins.file.php?mac=B8:85:84:AC:89:FA&taskid=5453 31/03/2023 16:08:36 SnapinClient C:\Program Files (x86)\FOG\tmp\boot-uefi.ps1 31/03/2023 16:08:36 Bus Emmiting message on channel: Notification 31/03/2023 16:08:36 SnapinClient Starting snapin 31/03/2023 16:08:40 SnapinClient Snapin finished 31/03/2023 16:08:40 SnapinClient Return Code: 0 31/03/2023 16:08:40 Bus Emmiting message on channel: Notification 31/03/2023 16:08:40 Middleware::Communication URL: https://fogus/fog/service/snapins.checkin.php?taskid=5453&exitcode=0&mac=B8:85:84:AC:89:FA&newServ
Any idea ?
-
RE: Windows delete pxe boot after deploy
I try to run the script as snapin
But I get no c:\temp\firmware.txt file
I think the script is not executedHere is the command line viewed on the fog console:
powershell.exe -ExecutionPolicy RemoteSigned -NoProfile -File boot-uefi.ps1I get this log
------------------------------------------------------------------------------ 31/03/2023 16:08:35 Client-Info Client Version: 0.11.19 31/03/2023 16:08:35 Client-Info Client OS: Windows 31/03/2023 16:08:35 Client-Info Server Version: 1.5.8 31/03/2023 16:08:35 Middleware::Response Success 31/03/2023 16:08:35 SnapinClient Running snapin boot-uefi-pxe-first 31/03/2023 16:08:35 Middleware::Communication Download: http://148.60.x.x//fog/service/snapins.file.php?mac=B8:85:84:AC:89:FA&taskid=5453 31/03/2023 16:08:36 SnapinClient C:\Program Files (x86)\FOG\tmp\boot-uefi.ps1 31/03/2023 16:08:36 Bus Emmiting message on channel: Notification 31/03/2023 16:08:36 SnapinClient Starting snapin 31/03/2023 16:08:40 SnapinClient Snapin finished 31/03/2023 16:08:40 SnapinClient Return Code: 0 31/03/2023 16:08:40 Bus Emmiting message on channel: Notification 31/03/2023 16:08:40 Middleware::Communication URL: https://fogus/fog/service/snapins.checkin.php?taskid=5453&exitcode=0&mac=B8:85:84:AC:89:FA&newServ
Any idea ?
-
RE: Windows delete pxe boot after deploy
This powershell script is better:
# Create text file containing firmware settings bcdedit /enum firmware > c:\temp\firmware.txt # Find the line containing "IPV4", and read the line just before that $FullLine = (( Get-Content c:\temp\firmware.txt | Select-String "IPV4" -Context 1 ).context.precontext)[0] # Delete our temporary file #del firmware.txt # Split line into fields using the first left-curly as the delimiter, # and then grab the second field (and restore the first left-curly) $GUID = '{' + $FullLine.split('{')[1] # Set the boot order #bcdedit /set {fwbootmgr} displayorder $GUID {bootmgr} cmd /c bcdedit /set "{fwbootmgr}" displayorder $GUID /addfirst
-
RE: Windows delete pxe boot after deploy
I found on this forum a solution:
This powershel script works to set boot on pxe :This PowerShell script moves the first non windows entry to the top of the list. # This script looks for the first non-Windows Boot Manager entry in the UEFI/GPT boot order and moves it to the top # For preventing newly installed Windows from hijacking the top boot order spot on my UEFI/GPT image testing VMs # by mmseng # https://github.com/mmseng/bcdedit-revert-uefi-gpt-boot-order # Notes: # - There's very little point in using this on regular production machines being deployed. Its main use is for machines being repeatedly imaged, or might be useful for lab machines. # - AFAICT bcdedit provideds no way to pull the friendly names of the devices in the overall UEFI boot order list. Therefore, this script only moves the first entry it identifies in the list which is NOT "{bootmgr}" (a.k.a. "Windows Boot Manager"). It's up to the user to make sure the boot order will exist in a state where the desired result is achieved. # - In my case, my test UEFI VMs initially have the boot order of 1) "EFI Network", 2) whatever else. When Windows is installed with GPT partitioning, it changes the boot order to 1) "Windows Boot Manager", 2) "EFI Network", 3) whatever else. In that state, this script can be used to change the boot order to 1) "EFI Network", 2) "Windows Boot Manager", 3) whatever else. # - This functionality relies on the completely undocumented feature of bcdedit to modify the "{fwbootmgr}" GPT entry, which contains the overall list of UEFI boot devices. # - AFAICT bcdedit is really only designed to edit Windows' own "{bootmgr}" entry which represents one of the "boot devices" in the overall UEFI list. # - Here are some sources: # - https://www.cnet.com/forums/discussions/bugged-bcdedit-349276/ # - https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/bcd-system-store-settings-for-uefi # - https://www.boyans.net/DownloadVisualBCD.html # - https://serverfault.com/questions/813695/how-do-i-stop-windows-10-install-from-modifying-bios-boot-settings # - https://serverfault.com/questions/714337/changing-uefi-boot-order-from-windows # Read current boot order echo "Reading current boot order..." $bcdOutput = cmd /c bcdedit /enum "{fwbootmgr}" echo $bcdOutput # Kill as many of the stupid characters as possible echo "Removing extraneous characters from boot order output..." $bcdOutput = $bcdOutput -replace '\s+','' $bcdOutput = $bcdOutput -replace '`t','' $bcdOutput = $bcdOutput -replace '`n','' $bcdOutput = $bcdOutput -replace '`r','' $bcdOutput = $bcdOutput.trim() $bcdOutput = $bcdOutput.trimEnd() $bcdOutput = $bcdOutput.trimStart() $bcdOutput = $bcdOutput -replace ' ','' echo $bcdOutput # Define a reliable regex to capture the UUIDs of non-Windows Boot Manager devices in the boot order list # This is difficult because apparently Powershell interprets regex is a fairly non-standard way (.NET regex flavor) # https://docs.microsoft.com/en-us/dotnet/standard/base-types/regular-expressions # Even then, .NET regex testers I used didn't match the behavior of what I got out of various Powershell commands that accept regex strings # However this seems to work, even though I can't replicate the results in any regex testers $regex = [regex]'^{([\-a-z0-9]+)+}' echo "Defined regex as: $regex" # Save matches echo "Save strings matching regex..." $foundMatches = $bcdOutput -match $regex # Grab first match # If Windows Boot Manager (a.k.a. "{bootmgr}" was the first in the list, this should be the second # Which means it was probably the first before Windows hijacked the first spot # Which means it was probably my "EFI Network" boot device $secondBootEntry = $foundMatches[0] echo "First match: $secondBootEntry" # Move it to the first spot echo "Running this command:" echo "cmd /c bcdedit $bcdParams /set `"{fwbootmgr}`" displayorder $secondBootEntry /addfirst" cmd /c bcdedit $bcdParams /set "{fwbootmgr}" displayorder $secondBootEntry /addfirst
-
Windows delete pxe boot after deploy
Hello,
In UEFI, Windows clears the PXE entry from the BIOS settings after a deployment.
What method do you use to keep PXE in UEFI boot options?Arnaud
-
RE: Deploy on sata disk image captured on nvme disk
@sebastian-roth
Here is the photo of the error I get on first boot.:(Il have no raid configuration neither on source or destination machine.
So I don’t understant why I get errors with mdadm files.If I edit the /etc/fstab file, I always have the error “ALERT! /dev/nvme0n1p2 does not exist”
-
RE: Deploy on sata disk image captured on nvme disk
@sebastian-roth
Hello Sebastian,
The distrib is ubuntu 20.04.
I tried to edit the fstab from/dev/nvme0n1p2 / ext3 errors=remount-ro 0 1 /dev/nvme0n1p3 /lereste ext2 defaults 1 2
to
/dev/sda2 / ext3 errors=remount-ro 0 1 #/dev/nvme0n1p3 /lereste ext2 defaults 1 2
It was not enough.
Boot repair did the job but it is a complex process difficult to reproduce. -
Deploy on sata disk image captured on nvme disk
Hello,
Fog is able to deploy an image captured on an nvme disk to a machine with a sata disk.
But on restart, the fstab is not good and the machine remains stuck in the busy box.
Do you have any advice to solve this problem? -
keep mono /opt/fog-service/FOGUserService.exe process after user logout
Hello,
I have a problem with the process /opt/fog-service/FOGUserService.exe launched by mono on an Ubuntu20.
The process still exists after the user logs off.
As a result, the user’s samba mount still exists and this causes issues when the user try a new session.
How is this process launched ?
Do you have any idea why it does not close.
The problem didn’t exist when we used an nfs mount instead of a samba mount.Arnaud
-
RE: FOG Multicast Not starting anymore
@george1421
changed to pm.max_spare_servers = 35
other paramaters had the correct valueThe hardware :
PowerEdge R440
IntelXeon
Silver 4208 CPU @ 2.10GHz
memory size: 16GiB
network BCM57412 NetXtreme-E 10Gb -
RE: FOG Multicast Not starting anymore
Geoges, should I use this topic as a reference ?
https://forums.fogproject.org/topic/10717/can-php-fpm-make-fog-web-gui-fast/2