Headless installation and configuration on Windows10

Moderators: Site Moderators, FAHC Science Team

Re: Headless installation and configuration on Windows10

Postby fowie » Tue Mar 24, 2020 6:16 pm

js2010 wrote:I saw this in process monitor during the install:

Code: Select all
"C:\Program Files (x86)\FAHClient\FAHClient.exe" --install-service


Yes, I tried the --install-service. I believe that runs the sc.exe command to create the service. You can do that instead of running sc.exe manually, but you still have to add the registry keys for the uninstaller for the service to start.
fowie
 
Posts: 11
Joined: Tue Mar 24, 2020 12:23 am

Re: Headless installation and configuration on Windows10

Postby fowie » Tue Mar 24, 2020 7:35 pm

js2010 wrote:I saw this during the install:

Code: Select all
"C:\Program Files (x86)\FAHClient\FAHClient.exe" --install-service


the service itself runs as:

Code: Select all
"C:\Program Files (x86)\FAHClient\FAHClient.exe" --service


A lot of things are installed under the current user, AppData\Roaming\FAHClient, including the config.xml. The service won't start without this appdata\roaming\fahclient folder. How does the service know where to look?


Oddly enough, looks like when you run the service from windows services (not command line) it looks at the registry key HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FAHClient\DataDirectory for the location of the config file. However, if you do silent install, it creates the registry keys, but [b]does not populate that registry value[\b] so you need to set it yourself.
fowie
 
Posts: 11
Joined: Tue Mar 24, 2020 12:23 am

Re: Headless installation and configuration on Windows10

Postby fowie » Tue Mar 24, 2020 7:46 pm

Just for completeness, here's my powershell script for automating the headless install (and service startup):
Code: Select all
        write-host "Starting installer on $bladeIP"
        $sess = new-pssession $bladeIP
        # Copy the files
        copy-item -ToSession $sess -recurse -path C:\FAHRemoteSetup -destination C:\ -Force
        if(!$?)
        {
            Write-Host -ForegroundColor RED "[$bladeIP] $($error[0].Exception)"
            return $FALSE
        }

        $remoteSB =
        {
            param($userFolder, $bladeIP)
            write-host "Running installer remotely and waiting 20 seconds for it to complete"
            & C:\FAHRemoteSetup\fah-installer_7.5.1_x86.exe /S /V
            start-sleep -Seconds 20

            write-host "Setting registry keys remotely"
            ##  Add Program Files (x86)\FAHClient to HKCU\Environment\Path
            $registryPath = "HKCU:\Environment"
            $path = Get-ItemPropertyValue -Path $registryPath -Name "Path"
            $path = $path+";C:\Program Files (x86)\FAHClient"
            Set-ItemProperty -Path $registryPath -Name "Path" -Value $path
            ##  Set the correct path in the uninstaller registry key
            $registryPath = "HKLM:\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FAHClient"
            if(test-path $registryPath)
            {
                set-itemproperty -Path $registryPath -name "DataDirectory" -value "C:\Users\$userFolder\AppData\Roaming\FAHClient"
            }
            else {
                write-host "WARNING: Uninstaller registry key does not exist.  Installer isn't finished or didn't run?"
            }
            #Install the service
            write-host "Remotely installing as a service"           
            & "C:\Program Files (x86)\FAHClient\FAHClient.exe" --install-service
            start-sleep -s 10
            ## Start the service
            Start-Service -Name "Folding@home Client"
        }

        write-host "Creating local config files and directories"
        #create the local config directories
        #this needs to be the same path used in the uninstaller registry key
       $userFolder = [LOCALUSERNAMEHERE]               
        new-item -path "\\$bladeIP\C$\users\$userFolder\AppData\Roaming\FAHClient" -force -itemType Directory

        #Make the config file           
        [xml]$configXml = Get-Content C:\FAHRemoteSetup\config.xml
        $configXml.config.user.value = "$thisBladeUsername"
        $configXml.save("\\$bladeIP\C$\Users\$userFolder\AppData\Roaming\FAHClient\config.xml")

        write-host "Remotely creating registry key and starting service"
        invoke-command -session $sess -ScriptBlock $remoteSB -ArgumentList $userFolder,$bladeIP
        if(!$?)
        {
            Write-Host -ForegroundColor RED "[$bladeIP] $($error[0].Exception)"
            return $FALSE
        }
fowie
 
Posts: 11
Joined: Tue Mar 24, 2020 12:23 am

Re: Headless installation and configuration on Windows10

Postby bruce » Tue Mar 24, 2020 8:31 pm

Windows does not allow the GPU to be used by just anybody. You MUST be logged on and able to display the desktop. Running as a servce only runs CPU assignments.

If you installed from the GUI, the client will have created a GPU slot which will attempt to fold with the GPU and that will fail (and probably abort the service). Manually remove the GPU slot and restart the service.
bruce
 
Posts: 19653
Joined: Thu Nov 29, 2007 11:13 pm
Location: So. Cal.

Re: Headless installation and configuration on Windows10

Postby fowie » Tue Mar 24, 2020 8:35 pm

Agree, @bruce. These servers don't have GPUs so service method works fine for me.
fowie
 
Posts: 11
Joined: Tue Mar 24, 2020 12:23 am

Re: Headless installation and configuration on Windows10

Postby olliecampbell » Wed Mar 25, 2020 1:31 am

Some further learnings aimed at my target install base....

You can't compute using the GPU if F@H is installed as a service so I've decided to stick with a GUI based installation. I can dish out the code I've made for this to work, but don't want to confuse this thread as it's aimed at installing it as a service.
olliecampbell
 
Posts: 10
Joined: Mon Mar 23, 2020 8:15 pm

Re: Headless installation and configuration on Windows10

Postby bruce » Wed Mar 25, 2020 1:42 am

The CPU based service. can do a lot of useful folding. The (some/most?) current COVAID projects for CPUs are testing the virus's susceptibility/sensitivity to specific chemicals/drug_candidates The new server we just brought online are now saturated.

Folding on a CPU is at a very low priority so it doesn't interfere with foreground use ...it just adds a little heat to the room. When not much (or nothing) is happening in the foreground, low priority doesn't slow it up.

GPU folding can cause screen lag, depending on the hardware and everything stops when somebody logs off. The service runs the CPU whenever the OS is running.
bruce
 
Posts: 19653
Joined: Thu Nov 29, 2007 11:13 pm
Location: So. Cal.

Re: Headless installation and configuration on Windows10

Postby js2010 » Wed Mar 25, 2020 3:07 am

I didn't realize there was a second page and have been updating my first post, lol. It seems like folding@home has gone out of their way to make this hard to do. Where is the command line version download for Windows?
js2010
 
Posts: 15
Joined: Tue Mar 24, 2020 5:17 pm

Re: Headless installation and configuration on Windows10

Postby fowie » Wed Mar 25, 2020 5:06 am

js2010 wrote:I didn't realize there was a second page and have been updating my first post, lol. It seems like folding@home has gone out of their way to make this hard to do. Where is the command line version download for Windows?


Install for GUI and command line are the same, you just use the /S flag on the command line to install without a GUI. Note that the /S install is silent, but also does all default settings.
fowie
 
Posts: 11
Joined: Tue Mar 24, 2020 12:23 am

Re: Headless installation and configuration on Windows10

Postby js2010 » Wed Mar 25, 2020 2:48 pm

I would expect the command line version not to depend on that uninstall registry entry for the location of the data?
js2010
 
Posts: 15
Joined: Tue Mar 24, 2020 5:17 pm

Re: Headless installation and configuration on Windows10

Postby fowie » Wed Mar 25, 2020 3:17 pm

js2010 wrote:I would expect the command line version not to depend on that uninstall registry entry for the location of the data?

I expected it wouldn't matter either, but it does. At least for service mode it uses the DataDirectory value to know where to find the config.xml
fowie
 
Posts: 11
Joined: Tue Mar 24, 2020 12:23 am

Re: Headless installation and configuration on Windows10

Postby CaptainStarbuck » Mon Mar 30, 2020 7:30 pm

It would be a huge service to the globe if this thread concluded with a final script and instructions for use. Then anyone can get proper permissions for use and mass-install. I can easily see Facebook threads where "the computer guy that everyone knows" (myself in that group) gets permission to remotely install F@H to friends' PCs. Right now we rely on each person to do their own install, and doing so still seems to be a bit prohibitively mysterious.

It seems there is a fortunate paradox where the virus that has driven many to use this software is also making available global resources for fighting it. That is, there is now a lot of unused equipment in offices, universities, government, and other large organizations. Even for people who now work at home, with company equipment at home, the equipment is not used during business off-hours.

In summary, it would really help if installation is made more accessible to people who aren't as nerdy as us, and if mass remote installation (done properly) is more easily accessible to us nerds. Yeah, that would lead to yet another explosion of workstations with no work units, but that's a different and kinda good problem to have.

Thanks for the effort we see in this thread!!!!!!!!!!
CaptainStarbuck
 
Posts: 3
Joined: Mon Mar 30, 2020 6:28 pm

Re: Headless installation and configuration on Windows10

Postby psjrg » Tue Mar 31, 2020 12:26 am

Popping in from another thread this was relevant to: if anyone find a way to automate adding each remote FAHClient to FAH control, please share.

I don't want to manually copy and paste each IP from a computer lab to FAHControl.
psjrg
 
Posts: 17
Joined: Mon Mar 23, 2020 8:26 am

Re: Headless installation and configuration on Windows10

Postby fowie » Tue Mar 31, 2020 3:57 am

I haven't tried it myself, but the data is in a SQLite database (a file that ends in .db) so you could probably easily make some code in your language of choice that opens that db and inserts new records
fowie
 
Posts: 11
Joined: Tue Mar 24, 2020 12:23 am

Re: Headless installation and configuration on Windows10

Postby psjrg » Tue Mar 31, 2020 4:49 am

fowie wrote:I haven't tried it myself, but the data is in a SQLite database (a file that ends in .db) so you could probably easily make some code in your language of choice that opens that db and inserts new records


Thanks. I'm working on my script now.
psjrg
 
Posts: 17
Joined: Mon Mar 23, 2020 8:26 am

PreviousNext

Return to V7.5.1 Public Release Windows/Linux/MacOS X

Who is online

Users browsing this forum: No registered users and 2 guests

cron