Headless installation and configuration on Windows10

Moderators: Site Moderators, FAHC Science Team

wuerfelfreak
Posts: 9
Joined: Mon Mar 23, 2020 9:03 am

Re: Headless installation and configuration on Windows10

Post by wuerfelfreak »

CaptainStarbuck wrote:It would be a huge service to the globe if this thread concluded with a final script and instructions for use.
There you are: https://gitlab.com/nilslennart.bruns/cm ... er-wrapper
I wrote another NSIS installer that does all the difficult work.
You only need to put the original installer and this one in the same directory. (must be namend "fah-installer_7.5.1_x86.exe") (Download the orginal one from http://foldingathome.org! Because of licensing i can't redistribute it on Gitlab.)

Example

Code: Select all

.\cmd-fah-installer-wrapper.exe /S /user=wuerfelfreak /team=233518 /passkey=000000000yourPasskey00000000 /allow=0.0.0.0/0 /password=yourPassword
Direkt Download: https://gitlab.com/nilslennart.bruns/cm ... line=false


1. It runs the FAH-Installer in silent mode
2. It adds the missing Registry key for the service to work
3. It adds the config
4. It adds the system service
5. Profit

After installing FAH will start at boot without user intervention.

But! When you just want to install this on your friends PC over RDP i would strongly recommend to use the graphical installer.
Also I don't really know what I am doing as I normally only work with Linux so please check anything before executing!
CaptainStarbuck
Posts: 3
Joined: Mon Mar 30, 2020 5:28 pm

Re: Headless installation and configuration on Windows10

Post by CaptainStarbuck »

@wuerfelfreak - I will try this on a couple systems as time permits and hope that others do the same.
With some confirmations of success, the next step I would recommend for the F@H team would be for a press release and tweets about how easy it is to do this = Marketing for something really useful.
Thanks!
js2010
Posts: 15
Joined: Tue Mar 24, 2020 4:17 pm

Re: Headless installation and configuration on Windows10

Post by js2010 »

My install script is on the bottom of page one. The trick is the data directory location is stored in the uninstall part of the registry. The data folder has to be created, but can be empty at first (unless you want all the themes). Then you can copy your config.xml to the data directory. Thanks for the sqlite tip. The stats are on the web too: https://stats.foldingathome.org. Yes, Folding@Home should document a silent install.
Last edited by js2010 on Wed Apr 01, 2020 3:57 pm, edited 1 time in total.
Anicube
Posts: 2
Joined: Wed Apr 01, 2020 3:06 pm

Re: Headless installation and configuration on Windows10

Post by Anicube »

@wuerfelfreak

I tried your installer and it works good.
There is just a little problem: While installing it shows a Popup Window "registry". As long as the OK Button is not pressed it will not continue installing. I checked your sourcecode, removed the popup message and compiled it localy. After that it worked.

Another thing to mention:
When you uninstall the Client it cant erase the Windows Service so I had to do it manually.

I used the Installer to rollout 130 Clients today. I used a Powershell script that reads the ActiveDirectory OU that stores all the Clients, copies the client and the installer in one folder on the PC and then executes it remotely.

Thanks for your work ^^
fowie
Posts: 11
Joined: Mon Mar 23, 2020 11:23 pm

Re: Headless installation and configuration on Windows10

Post by fowie »

Anicube wrote:@wuerfelfreak

I tried your installer and it works good.
There is just a little problem: While installing it shows a Popup Window "registry". As long as the OK Button is not pressed it will not continue installing. I checked your sourcecode, removed the popup message and compiled it localy. After that it worked.

Another thing to mention:
When you uninstall the Client it cant erase the Windows Service so I had to do it manually.

I used the Installer to rollout 130 Clients today. I used a Powershell script that reads the ActiveDirectory OU that stores all the Clients, copies the client and the installer in one folder on the PC and then executes it remotely.

Thanks for your work ^^
I think erasing the windows service can be accomplished by running

Code: Select all

FAHClient.exe --uninstall-serivce 
before you uninstall FAHClient
wuerfelfreak
Posts: 9
Joined: Mon Mar 23, 2020 9:03 am

Re: Headless installation and configuration on Windows10

Post by wuerfelfreak »

Anicube wrote: I tried your installer and it works good.
[..]
I used the Installer to rollout 130 Clients today. I used a Powershell script that reads the ActiveDirectory OU that stores all the Clients, copies the client and the installer in one folder on the PC and then executes it remotely.
Thank you for the great feedback! I fixed both your complaints immeately.
The uninstalling was easily automated by also setting the registry key "InstalledService" as REG_DWORD 0x00000001
Then the uninstaller knows that it has to remove the service.

130 Clients are quite an impressive amount for me as a student. Way more than the 40 PCs I could convince my school to provide.
js2010
Posts: 15
Joined: Tue Mar 24, 2020 4:17 pm

Re: Headless installation and configuration on Windows10

Post by js2010 »

Anyone else notice the config.xml has mixed unix and windows line endings, some with carriage returns and some without? But all lines with linefeeds. It's obvious in emacs. It still works anyway.
Anicube
Posts: 2
Joined: Wed Apr 01, 2020 3:06 pm

Re: Headless installation and configuration on Windows10

Post by Anicube »

wuerfelfreak wrote:
Anicube wrote: I tried your installer and it works good.
[..]
I used the Installer to rollout 130 Clients today. I used a Powershell script that reads the ActiveDirectory OU that stores all the Clients, copies the client and the installer in one folder on the PC and then executes it remotely.
Thank you for the great feedback! I fixed both your complaints immeately.
The uninstalling was easily automated by also setting the registry key "InstalledService" as REG_DWORD 0x00000001
Then the uninstaller knows that it has to remove the service.

130 Clients are quite an impressive amount for me as a student. Way more than the 40 PCs I could convince my school to provide.
Well, every PC uses power and schools usually have no money anyway.. as sad as it is. We are using the Point of Sale PCs in the Soccer Stadium now for the Folding. They are a bit weak and are only passive cooled but kinda get the job done :lol:
And there are no games or visitors now anyway ^^
olliecampbell
Posts: 10
Joined: Mon Mar 23, 2020 7:15 pm

Re: Headless installation and configuration on Windows10

Post by olliecampbell »

js2010 wrote:

Code: Select all

start /wait fah-installer_7.5.1_x86.exe /S
"C:\Program Files (x86)\FAHClient\FAHClient.exe" --install-service
reg add HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FAHClient /v DataDirectory /f /d C:\Users\user\AppData\Roaming\FAHClient
mkdir c:\users\user\appdata\roaming\fahclient
copy /y config.xml c:\users\user\roaming\fahclient
net start "Folding@home Client"

Just a thought, you could replace the "user" in those paths with %username% and assuming the script is run as the intended user it will replace the variable with their username.
js2010
Posts: 15
Joined: Tue Mar 24, 2020 4:17 pm

Re: Headless installation and configuration on Windows10

Post by js2010 »

It's actually running as system, but it's using a permanent admin's profile for the data. It's probably better to have a %user% or %datadir% variable at the top. The data directory could really be anywhere.
js2010
Posts: 15
Joined: Tue Mar 24, 2020 4:17 pm

Re: Headless installation and configuration on Windows10

Post by js2010 »

Trying out modifying the sqlite database, using the sqlite3 shell, to script the connection tab in the gui (take away the doublequotes in cmd):

Code: Select all

echo "INSERT INTO clients ( name, address, port, password ) VALUES ( 'comp001','comp001','36330','' )" | sqlite3 fahcontrol.db
echo "select * from clients" | sqlite3 fahcontrol.db

local|127.0.0.1|36330|
comp001|comp001|36330|
js2010
Posts: 15
Joined: Tue Mar 24, 2020 4:17 pm

Re: Headless installation and configuration on Windows10

Post by js2010 »

What's better, 10 computers running at 100% cpu or 100 computers running at 10% cpu?
Neil-B
Posts: 2027
Joined: Sun Mar 22, 2020 5:52 pm
Hardware configuration: 1: 2x Xeon E5-2697v3@2.60GHz, 512GB DDR4 LRDIMM, SSD Raid, Win10 Ent 20H2, Quadro K420 1GB, FAH 7.6.21
2: Xeon E3-1505Mv5@2.80GHz, 32GB DDR4, NVME, Win10 Pro 20H2, Quadro M1000M 2GB, FAH 7.6.21 (actually have two of these)
3: i7-960@3.20GHz, 12GB DDR3, SSD, Win10 Pro 20H2, GTX 750Ti 2GB, GTX 1080Ti 11GB, FAH 7.6.21
Location: UK

Re: Headless installation and configuration on Windows10

Post by Neil-B »

On the basis all100 computers same spec/setup/etc. … 10 computers at 100% as WUs completed quicker
2x Xeon E5-2697v3, 512GB DDR4 LRDIMM, SSD Raid, W10-Ent, Quadro K420
Xeon E3-1505Mv5, 32GB DDR4, NVME, W10-Pro, Quadro M1000M
i7-960, 12GB DDR3, SSD, W10-Pro, GTX1080Ti
i9-10850K, 64GB DDR4, NVME, W11-Pro, RTX3070

(Green/Bold = Active)
LancasterUni
Posts: 7
Joined: Sat Apr 04, 2020 10:07 am

Re: Headless installation and configuration on Windows10

Post by LancasterUni »

In case it's of use, in the last week I've rolled out an installation to 272 Windows 10 PCs (with the permission of the institution, in fact I was asked to pick this up as a project). I have gone for running as service so if you need GPU folding this isn't for you. I used EMCO packager to capture an install of the client and create an msi, with the client set to run as a service. Any msi creator would do. I edited the msi to drop in a custom config.xml file with my team, user and passkey, and remove desktop and menu shortcuts. I added this application to a group policy in our AD, and also added firewall rules to control which machines could talk to FAHclient, and what it can talk to. I got sign off for the configuration from our Security Manager. I also added the service to the policy so that I could configure it for Delayed Automatic startup (I saw some issues with FAHclient service not starting on the first reboot after installation), and to startup (if not already running) at GP refresh.

I can now attached that policy to a lab OU and reboot the lab remotely using Powershell (it does still sometimes take two reboots to get going) and the clients are then up and running. I have a management server that I have FAHControl installed on, and I use DB Browser for SQLite to bulk import new machines from a CSV file. FAHControl, not surprisingly, has to be closed while you edit the DB.

Once the labs are needed again for students I will remove the group policy, reboot the machines and they will be back to normal.

On the subject of FAHControl, I do seem to have reached some kind of limit for the number of clients it can handle. Although it is still able to show me which clients are online (which is the main thing), it doesn't seem to be able to give me a live update of what each client is doing in terms of work, which is a shame. Has anyone else seen this problem? The server is fine in terms of CPU and network bandwidth and FAHControl doesn't seem to be using much resource.
wuerfelfreak
Posts: 9
Joined: Mon Mar 23, 2020 9:03 am

Re: Headless installation and configuration on Windows10

Post by wuerfelfreak »

I did have the same problems with FAHControl, which is why I am currently working on a similar Program which is geared more to managing hundreds of clients. Maybe i can complete it in the next week. The FAHClient-API is not good, but gets the job done.

I am also working on a second installer which uses auto login to use the GPU as well. Currently I am stuck on the windows account creation dialog which pops up, the first time a newly created user logs in.
Post Reply