• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. dvorak
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 19
    • Best 2
    • Controversial 0
    • Groups 0

    dvorak

    @dvorak

    2
    Reputation
    5
    Profile views
    19
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    dvorak Unfollow Follow

    Best posts made by dvorak

    • RE: simple PXE tutorial

      @george1421 Thanks a ton for those words (OK that iso image seems to be only a legacy/bios boot media.)

      I figured out one thing I was doing very wrong.
      I was PXE booted in UEFI… when hitting F12 to boot the PC, I automatically selected the IPV4 under UEFI, and not the “network boot” under legacy, both of which show up in my F12 menu. Both of which FOG PXE boot works with.

      Well, after using the legacy, the dell iso image (that only shows CD.txt) works flawlessly. Now I think everything will work that requires legacy for me, as some things seems you can’t use PXE UEFI with (perhaps not supported by the manufacturer, some programs like Memtest require spending thousands of dollars to get the “site edition” that works with PXE, etc). Keeping in mind your words in other posts about the size limitations of isos (2gb?), the ones I wish to use should all be small enough. I think we can mark this as solved.

      Thanks so much for your help.

      posted in FOG Problems
      D
      dvorak
    • RE: /opt/fog/.fogsettings MySQL user can't make changes

      @sebastian-roth
      Update I was able to make progress by fixing up the code per-say. I think the OP of the code (ch3i) wrote up something from memory and not from actual tests, and possibly update or make note of any changes in syntax as programs update.

      For instance, hostname --fqdn gives an error “hostname: unrecognized option ‘–fqdn’ BusyBox v1.31.1” so I changed to ‘hostname -f’.

      I was able to get pass the original MySQL errors using your advice, and using the fogstorage account instead. Running both scripts on ubuntu still stops without reason at “checking hostname/domain configurations”. When I run it on FOG (As a postdownloadscript), and it runs after cloning the image,it stops at :
      “Check Mysql Configuration: Done
      Check FOG Mysql Database Status: Done
      Checking hostname/domain configurations *Rebooting system as task is completed”
      Reboot: restarting system

      but upon reboot, I have the same hostname I myself set prior to capturing the image. Fog has a different hostname set to the MAC that I never changed, so if the script worked my hostname should reflect what FOG has.

      IT never makes it to the next part which should say “updating /etc/hostname” nor saying “Done” or “host not found in fog database”. So I am thinking it’s stuck at these lines:

      #########################################################
      	# Get interfaces
      	#########################################################
      	NETWORK_CARDS=($(ls /sys/class/net | grep eth))
      
      	#########################################################
      	# Get host name and domain from FoG database
      	#########################################################
      FUNC_DOTS "Checking hostname/domain configurations"
      	for ETH in ${NETWORK_CARDS[*]}
      	do
      			# read mac address
      			MAC=$(cat /sys/class/net/$ETH/address)
      			# get mac address information from fog web server
      			wget http://$FOG_SERVER/$FOG_WEBROOT/service/hostname.php?mac=$MAC -O /tmp/hostname_check 2>/dev/null
      			HOST_NAME="$(grep 'ok=' /tmp/hostname_check | cut -d "=" -f2)"
      			HOST_DOMAIN_NAME="$(grep 'ADDom' /tmp/hostname_check | cut -d "=" -f2)"
      			if [ "$HOST_NAME" != "" ]
      			then
      				echo "Done ($HOST_NAME.$HOST_DOMAIN_NAME)"
      				sleep 3
      				# A hostname is found - quit the loop
      				break
      			else
      				echo "Error"
      				FUNC_DOTS "Host not found in FOG database"
      				echo "exiting"
      				sleep 3
      				exit
      			fi
      	done
      
      

      Final Update
      I got it to work!
      As first mentioned, I had to update the syntax as it’s been over 7 years since the code was written by OP (ch3i). The update that crashed the above code was :

      NETWORK_CARDS=($(ls /sys/class/net | grep eth))
      

      To get it to work I swapped it to :

      NETWORK_CARDS=($(ls /sys/class/net ))
      

      I learned thru google there was a change (systemd?) that made ls /sys/class/net not use ETH anymore, rather showing something like “enp0s31f6” which is the same as ETH0, but showing the exact location. The code was looking for ETH so just removing that line fixed it.

      Now that it works, I feel I can turn the code into a snap-in or post-download script.

      posted in General
      D
      dvorak

    Latest posts made by dvorak

    • RE: HTTPS Redirect Web GUI

      @JJ-Fullmer said in HTTPS Redirect Web GUI:

      https redirect

      I had this issue, but wanted to add to the Copilot answer that works on RHEL 8.10 running the latest Apache and FOG 1.5.10.1634 (this assumes you installed FOG with NO HTTPS option, in other words HTTPS disabled by default):

      To redirect all HTTP requests on port 80 to HTTPS on port 443 using your provided certificate and key, you can use the following configuration:

      Create a new configuration file in the /etc/httpd/conf.d/ directory, for example, redirect.conf:

      <VirtualHost *:80>
          ServerName ip.of.fog.server
          ServerAlias hostnameOfFogServer
          RewriteEngine On
          RewriteCond %{HTTPS} off
          RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R=301,L]
      </VirtualHost>
      

      Update your SSL configuration in the /etc/httpd/conf.d/ssl.conf file to include your certificate and key:

      <VirtualHost *:443>
          ServerName ip.of.fog.server
          ServerAlias hostnameOfFogServer
          DocumentRoot /var/www/html/
          SSLEngine on
          SSLCertificateFile /opt/fog/ssl/UNIQUE-FOR-ME/MYCERT.cer
          SSLCertificateKeyFile /opt/fog/ssl/UNIQUE-FOR-ME/MYCERT.key
      
          <Directory /var/www/html/fog/>
              DirectoryIndex index.php index.html index.htm
              AllowOverride All
              Require all granted
          </Directory>
      
          <FilesMatch "\.php$">
              SetHandler "proxy:fcgi://127.0.0.1:9000/"
          </FilesMatch>
      
          RewriteEngine On
          RewriteCond %{REQUEST_METHOD} ^(TRACE|TRACK)
          RewriteRule .* - [F]
          RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
          RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-d
          RewriteRule ^/fog/(.*)$ /fog/api/index.php [QSA,L]
      </VirtualHost>
      

      Restart Apache to apply the changes:

      sudo systemctl restart httpd
      

      This configuration will redirect all HTTP requests to HTTPS and use the provided certificate and key for SSL. Make sure to replace ip.of.fog.server and hostnameOfFogServer with your actual server IP and hostname.

      Lastly, When enrolling a cert I used the FQDN and plain hostname as a “Subject Alternative Name”. For my company, this means internal use only (.pvt). This takes care of both redirects (prob could have also talked to the DNS team to redirect the hostname to the FQDN eg hostname.blah.pvt as well. But it’s better (and faster) in the cert if you can do it that way.

      posted in FOG Problems
      D
      dvorak
    • RE: what can i put in boot options on a custom ipxe menu

      A lot has changed since then. We now use “Parameters” instead of “Boot options”.

      My questions is, is it possible to add (or maybe in a future update) commands to the “boot options” that run AFTER pxe finishes loading the iso/files?

      The goal is, instead of editing the ISO (everytime I use DISM to edit wimboot, remake the ISO using imgburn it get sanboot errors, but the original unaltered ISO works fine), I could just run 3 simple commands (.bat script) via FOG (boot options?) that run after it boots. For instance, adding the below to be ran after a WinPE iso loads and you get to a desktop:

      net use Z: yada yada; Explorer Z:\test.iso;“X:\StartScript.exe”

      posted in General
      D
      dvorak
    • RE: Updated Fog and Ubuntu no longer able to login

      @EuroEnglish Check the usual suspects first

      1.) Since it seems your passwords may have changed, make sure they are all synced. This includes the ones in the FOG webUI configurations, in configuration files like the .fog_settings file for instance, MySQL etc.

      2.) Check the permissions of your files on the FOG server. Make sure they mirror what you had before (prob something like fogproject:root or likes). EG the folder with the images, the tftpboot folder as well (esp if you’re PXE booting images from the menu and not just capturing or deploying images).

      3.) Check logs in /var/log/fog and /var/log in general depending on the issues. This will tell you exactly what’s going on if you know how to read the logs. This should actually be #1 on this list.

      4.) Check systemctl status messages: make sure fog-tftp is the correct tftp server running, is actually running, and pointing to where the files actually are (like /tftpboot versus /var/lib/tftpboot).

      posted in FOG Problems
      D
      dvorak
    • RE: new version e2fsck ?

      @george1421 said in new version e2fsck ?:

      FOS Linux OS

      Thanks for that tidbit. Using this guide in the FOG wiki:
      https://wiki.fogproject.org/wiki/index.php/Modifying_the_Init_Image

      I was able to replace initmountdir/sbin/e2fsck with the latest version.

      I booted a fogclient into debug mode and ran “e2fsck -V” to verify the changes.

      Thanks George!

      posted in FOG Problems
      D
      dvorak
    • RE: new version e2fsck ?

      P.S
      I did upgrade e2fsck on our FOG server via SSH to the latest:
      e2fsck 1.47.0 (5-Feb-2023)
      Using EXT2FS Library version 1.47.0, 5-Feb-2023

      but it throws the exact same error.

      UPDATE I got it fixed.

      Used answer from MarSoft found here (the last comment):
      https://github.com/NixOS/nixpkgs/issues/229450

      basically run :
      tune2fs -O ^orphan_file /dev/mydevice
      e2fsck -f /dev/mydevice

      and it is successfully capturing

      @rhromyko maybe try the above and see if it works for you too (that is, if you’re still having issues).

      posted in FOG Problems
      D
      dvorak
    • RE: new version e2fsck ?

      I am getting the same errors. below is a photo:
      MicrosoftTeams-image (1).png
      trying to capture a dual boot image for our labs that includes:
      Windows 10/11 (can verify if important, but is sysprepped)
      Ubuntu 23.04

      did all the fsck, resize2fs, no avail.

      Thanks

      posted in FOG Problems
      D
      dvorak
    • RE: simple PXE tutorial

      @george1421 Thanks a ton for those words (OK that iso image seems to be only a legacy/bios boot media.)

      I figured out one thing I was doing very wrong.
      I was PXE booted in UEFI… when hitting F12 to boot the PC, I automatically selected the IPV4 under UEFI, and not the “network boot” under legacy, both of which show up in my F12 menu. Both of which FOG PXE boot works with.

      Well, after using the legacy, the dell iso image (that only shows CD.txt) works flawlessly. Now I think everything will work that requires legacy for me, as some things seems you can’t use PXE UEFI with (perhaps not supported by the manufacturer, some programs like Memtest require spending thousands of dollars to get the “site edition” that works with PXE, etc). Keeping in mind your words in other posts about the size limitations of isos (2gb?), the ones I wish to use should all be small enough. I think we can mark this as solved.

      Thanks so much for your help.

      posted in FOG Problems
      D
      dvorak
    • RE: simple PXE tutorial

      @george1421 see, the issue is when I run that, I get something like this

      tftp://(my fog ip)/memdisk... ok
      Could not select: EXEC format error (https://ipxe.org/2e008081)
      Could not boot: Exec format error (ipxe)
      Could not boot: Exec format error (https:)
      

      When looking at the ISO, mounting or unzipping it’s just a CD.txt file (there was a [BOOT] folder but it doesn’t show in linux, and seems the ISO is made in way proprietary to DELL/windows. Inside that folder is a Boot-HardDisk.img with has one file, 0.fat inside. I did not see any .efi, BCD, or other files)

      I have the .img version extracted to a folder, but not sure what to point things to in this case
      there’s files like:
      AUTOEXEC.BAT
      COMMAND.COM
      CONFIG.SYS
      DELLBIO.BIN
      DELLDIAG.INI
      DIAK1
      DISK2
      DISK3
      DISKS.BAT
      GUI.EXE
      HIMEM.SYS
      RAMDRIVE.SYS

      with nothing really in DELLDIAG.INI.

      Until further advise, I will probably move on to more regular PXE boot options, like trying to get the WinPE going as we could use a winblows environment (The one I got working, System Rescue CD is a *nix environment)

      posted in FOG Problems
      D
      dvorak
    • RE: simple PXE tutorial

      @Jackalcorn I am still awaiting your response to the questions I asked you previously. Until then, I would have to say that the information you provided was not helpful, and in fact made me more confused and in a worse position than when I started, having second guessed what I already thought I knew.

      If you are able to answer the questions I asked prior please feel free to answer so I as well as others may learn from your wisdom.

      All the best,

      posted in FOG Problems
      D
      dvorak
    • RE: simple PXE tutorial

      @george1421 Thanks a lot. I will report back shortly with the results. I was just able to finally get one image to work, the System Rescue CD using this guide:
      https://forums.fogproject.org/topic/15295/here-config-for-systemrescuecd-8?sort=oldest_to_newest

      Although the above was posted in 2021, and though it was for System Rescue CD version 8, the latest version 10.01 works fine with Fog 1.5.10.

      As for my environment, I am running a RHEL server in vmware that only job is FOG.

      To get the System Rescue CD to work I used “/tftpboot/os/RescueCD/10.01-amd64” instead of the “/var/www/utils/systemrescuecd/” that the above guide used. Here are the PXE parameters that are working for me:

      kernel tftp://${fog-ip}/os/RescueCd/10.01-amd64/sysresccd/boot/x86_64/vmlinuz archisobasedir=sysresccd ip=dhcp archiso_http_srv=http://${fog-ip}/os/RescueCd/10.01-amd64/ checksum
      initrd tftp://${fog-ip}/os/RescueCd/10.01-amd64/sysresccd/boot/intel_ucode.img
      initrd tftp://${fog-ip}/os/RescueCd/10.01-amd64/sysresccd/boot/amd_ucode.img
      initrd tftp://${fog-ip}/os/RescueCd/10.01-amd64/sysresccd/boot/x86_64/sysresccd.img
      imgargs copytoram
      boot || goto MENU
      

      note the old versions of System Rescue CD used “imgargs docache” but according to System Rescue CD website:

      copytoram causes SystemRescue to be fully loaded into memory. This corresponds to the docache option in previous versions. A slower start but once complete, the system will be more responsive and also it will not require the original device to run. It means you can actually work on the device where SystemRescue is installed. This requires 2GB of memory to cache the system.
      

      Again, thank you so much. I have been fighting with this for 2 days, and finally have some success (other than knowing what does NOT work… lol).

      posted in FOG Problems
      D
      dvorak