### Start Folding@Home Sandbox Instance (PowerShell) Source: https://context7.com/microsoft/windows-sandbox/llms.txt Orchestrates the creation and launch of a Windows Sandbox instance configured for Folding@Home. It includes system verification, configuration setup, and sandbox initialization. Requires the FAHSandbox module. Accepts optional username, team ID, and verbose output parameters. ```powershell # Import the FAHSandbox module Import-Module .\Module\FAHSandbox.psd1 # Start a Folding@Home sandbox with default anonymous username Start # Start with a custom username and team ID Start -username 'my_username' -team '251561' # Start with verbose output for troubleshooting Start -username 'john_doe' -team '251561' -Verbose # The function will: # 1. Verify BIOS virtualization is enabled # 2. Check/enable Windows Sandbox feature # 3. Download latest Folding@Home installer # 4. Create configuration files # 5. Launch Windows Sandbox automatically ``` -------------------------------- ### Standalone Folding@Home Sandbox Installation Script Source: https://context7.com/microsoft/windows-sandbox/llms.txt A comprehensive PowerShell script to automate the setup and launch of Folding@Home within Windows Sandbox. It checks for virtualization and Hyper-V, enables the Sandbox feature, downloads the FAH installer, creates necessary configuration and startup scripts, and launches the sandbox with custom user settings. Requires administrator privileges and specific Windows versions. ```powershell # Run with default anonymous username Powershell.exe -ExecutionPolicy Bypass -File .\install_folding_sandbox_on_host.ps1 # Run with custom username Powershell.exe -ExecutionPolicy Bypass -File .\install_folding_sandbox_on_host.ps1 -username 'contributor_name' # Run with custom username and team Powershell.exe -ExecutionPolicy Bypass -File .\install_folding_sandbox_on_host.ps1 -username 'john_doe' -team '251561' # The script performs all operations automatically: # 1. Verifies BIOS virtualization enabled # 2. Verifies Hyper-V is present # 3. Checks/enables Windows Sandbox feature # 4. Downloads latest FAH installer from official source # 5. Creates fah_sandbox_conf.xml with user settings # 6. Generates init.cmd startup script # 7. Creates fah_sandbox.wsb configuration # 8. Launches Windows Sandbox with configuration # Example execution: # PS C:> cd ".\Folding In Sandbox\" # PS C:\Folding In Sandbox> Powershell.exe -ExecutionPolicy Bypass -File .\install_folding_sandbox_on_host.ps1 -username 'researcher' # Output: # Verifying that virtualization is enabled in BIOS... # Verifying that virtualization is enabled in Windows 10... # Checking to see if Windows Sandbox is installed... # Windows Sandbox already installed. # Checking for latest version of foldingathome... # Using FAH v7.6. # Creating init command... # Starting sandbox... # Requirements: # - Windows 10 Pro/Enterprise build 18362 or newer # - Administrator privileges # - Virtualization enabled in BIOS # - 4GB RAM minimum recommended ``` -------------------------------- ### Download Folding@Home Installer (PowerShell) Source: https://context7.com/microsoft/windows-sandbox/llms.txt Downloads the latest Folding@Home client installer. It checks for existing installations and version compatibility to optimize download efficiency. Saves the installer as 'folding_installer.exe' in the user's profile configuration directory. ```powershell # Download the latest Folding@Home installer GetFAH # The function performs these operations: # 1. Queries https://download.foldingathome.org for latest version # 2. Checks if installer already exists in %USERPROFILE%\fah_conf # 3. Verifies file size matches expected size # 4. Downloads if missing or size mismatch # 5. Saves as folding_installer.exe # Example output: # Checking for latest version of foldingathome... # Using FAH v7.6 # Downloading latest folding executable: C:\Users\YourName\fah_conf\folding_installer.exe # Saving to C:\Users\YourName\fah_conf\folding_installer.exe... # Installer location: %USERPROFILE%\fah_conf\folding_installer.exe ``` -------------------------------- ### Create Sandbox Initialization Script and Configuration Source: https://context7.com/microsoft/windows-sandbox/llms.txt Generates a batch script for initializing Folding@Home within a Windows Sandbox and the corresponding sandbox configuration file (.wsb). The init.cmd script handles silent installation, firewall configuration, and client launch. The .wsb file defines sandbox settings, including mapped folders and the logon command. ```powershell # Generate logon script and sandbox configuration CreateLogonScript # Creates two files: # 1. %USERPROFILE%\fah_conf\init.cmd (batch script) # 2. %USERPROFILE%\fah_conf\fah_sandbox.wsb (sandbox config) # The init.cmd script performs these steps inside the sandbox: # - Starts Folding@Home installer in silent mode # - Waits for installation completion # - Creates working directory on sandbox desktop # - Copies configuration file # - Configures Windows Firewall rules for FAH client # - Launches FAH client with configuration # The .wsb configuration file structure: # # Enable # # # C:\Users\YourName\fah_conf # true # # # # C:\users\wdagutilityaccount\desktop\fah_conf\init.cmd # # ``` -------------------------------- ### Install and Run Folding@Home in Windows Sandbox (PowerShell) Source: https://github.com/microsoft/windows-sandbox/blob/master/Folding In Sandbox/README.md This PowerShell script automates the process of setting up Windows Sandbox for Folding@Home. It checks and enables the Windows Sandbox feature, downloads the latest Folding@Home installer, generates necessary configuration and initialization scripts, and launches the sandbox. The script requires administrative privileges and can optionally accept a username for Folding@Home configuration. Note that Windows Sandbox has specific OS requirements (Windows 10 Pro/Enterprise Insider build 18362+). ```powershell # install_folding_sandbox_on_host.ps1 param( [string]$username ) # Check if running as administrator if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { Write-Host "This script must be run as Administrator." Start-Process powershell.exe -ArgumentList "-File `"{0}`" -Verb RunAs -ArgumentList `"-username {1}`"" -PassThru { $process.WaitForExit() } exit } # Check and enable Windows Sandbox $sandboxFeature = Get-WindowsOptionalFeature -Online -FeatureName "Containers-DisposableClientVM" -NoRestart if ($sandboxFeature.State -ne "Enabled") { Write-Host "Enabling Windows Sandbox feature..." Enable-WindowsOptionalFeature -Online -FeatureName "Containers-DisposableClientVM" -NoRestart Write-Host "Windows Sandbox feature enabled. A restart is required to complete the installation." Read-Host "Press Enter to restart your computer now, or close this window to restart later." Restart-Computer } # Download Folding@Home installer $foldingAtHomeInstallerUrl = "https://client.foldingathome.com/public/release/latest/Folding@home-setup-x64.exe" $foldingAtHomeInstallerPath = "$PSScriptRoot\Folding@home-setup-x64.exe" Write-Host "Downloading Folding@Home installer from $foldingAtHomeInstallerUrl..." Invoke-WebRequest -Uri $foldingAtHomeInstallerUrl -OutFile $foldingAtHomeInstallerPath # Generate Folding@Home configuration file $foldingConfigPath = "$PSScriptRoot\config.xml" $foldingConfigContent = " . 0 standalone ignore ignore 0 0 " if ($username) { $foldingConfigContent = $foldingConfigContent.Replace("", "") } $foldingConfigContent | Out-File -FilePath $foldingConfigPath -Encoding UTF8 # Create init.cmd script for the sandbox $initCmdPath = "$PSScriptRoot\init.cmd" $initCmdContent = "@echo off cd /d %~dp0 start /wait Folding@home-setup-x64.exe /S /D=C:\\FoldingAtHome start FoldingAtHome.exe -config=config.xml" $initCmdContent | Out-File -FilePath $initCmdPath -Encoding ASCII # Generate Windows Sandbox configuration file (.wsb) $sandboxConfigPath = "$PSScriptRoot\FoldingSandbox.wsb" $sandboxConfigContent = " 4096 4 cmd.exe /C c:\\Windows\\Setup\\Scripts\\setup.cmd $PSScriptRoot c:\\Windows\\Setup\\Scripts true force force force force " $sandboxConfigContent | Out-File -FilePath $sandboxConfigPath -Encoding UTF8 Write-Host "Windows Sandbox configuration for Folding@Home created at $sandboxConfigPath." # Start Windows Sandbox Write-Host "Starting Windows Sandbox..." Start-Process $sandboxConfigPath Write-Host "Script finished." ``` -------------------------------- ### Verify BIOS Virtualization Support (PowerShell) Source: https://context7.com/microsoft/windows-sandbox/llms.txt Checks if virtualization is enabled in BIOS and Windows. Returns a boolean value indicating readiness for Windows Sandbox. Provides example outputs for success and failure scenarios. ```powershell # Check if virtualization is properly enabled $isEnabled = VerifyBios if ($isEnabled) { Write-Host "Virtualization is enabled and ready" } else { Write-Host "ERROR: Virtualization not enabled" Write-Host "Please enable virtualization in BIOS settings" } # Example output when successful: # Verifying that virtualization is enabled in BIOS... # Verifying that virtualization is enabled in Windows 10... # Returns: $true # Example output when failed: # ERROR: Please Enable Virtualization capabilities in your BIOS settings... # Returns: $false ``` -------------------------------- ### Generate Folding@Home Configuration File (PowerShell) Source: https://context7.com/microsoft/windows-sandbox/llms.txt Creates the Folding@Home XML configuration file. This includes user credentials, team assignment, and performance settings optimized for sandbox execution. The configuration is saved as 'fah_sandbox_conf.xml'. ```powershell # Create configuration with custom username and team CreateFAHConf -username 'research_contributor' -team '251561' # The generated XML file structure: # Location: %USERPROFILE%\fah_conf\fah_sandbox_conf.xml # Content: # # # # # # # # # # # Configuration options explained: # - user: Folding@Home username for tracking contributions # - team: Team number (251561 is Windows Sandbox team) ``` -------------------------------- ### Verify and Enable Windows Sandbox Feature (PowerShell) Source: https://context7.com/microsoft/windows-sandbox/llms.txt Checks if the Windows Sandbox feature is enabled. If not, it attempts to enable it and prompts for a system restart if necessary. Returns a boolean indicating if the feature is ready. ```powershell # Verify Windows Sandbox is installed and enabled $sandboxReady = VerifySandbox if ($sandboxReady -eq $false) { Write-Host "Restart required to complete Windows Sandbox installation" Restart-Computer -Confirm } else { Write-Host "Windows Sandbox is ready to use" } # Example when already installed: # Checking to see if Windows Sandbox is installed... # Windows Sandbox already installed. # Returns: $true # Example when installation needed: # Windows Sandbox is not installed, attempting to install it... # Please reboot to finish installing Windows Sandbox, then re-run this script... # Returns: $false ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.