-
Notifications
You must be signed in to change notification settings - Fork 238
Closed
Description
Headful Mode Crashes on Windows Due to Xvfb Invocation ([WinError 2] file not found)
Description
When running FARA in headful mode on Windows, the agent crashes immediately with repeating errors:
[WinError 2] The system cannot find the file specified
INFO:main:Closing browser...
The crash occurs before the browser opens, and the script attempts to close the browser multiple times.
Steps to Reproduce
- Clone the repo on a Windows machine
- Run:
python test_fara_agent.py --headful --task "how many pages does wikipedia have" --start_page "https://www.bing.com/
" --endpoint_config "endpoint_configs/azure_foundry_config.json"
- Observe crash
Expected Behavior
- Browser should launch in a visible headful window on Windows
- Agent should proceed with normal page navigation and task execution
Actual Behavior
- Script attempts to start Xvfb, which does not exist on Windows
- Raises:
[WinError 2] The system cannot find the file specified
- Cleanup then repeatedly tries (and fails) to stop Xvfb
Root Cause
The browser initialization logic always attempts to launch Xvfb, even on Windows.
Xvfb is a Unix-only virtual framebuffer and is not available on Windows systems.
Proposed Fix (Implemented Locally)
- Detect OS using
platform.system() - Only start Xvfb on Linux/macOS
- On Windows:
- Skip Xvfb entirely
- Allow Playwright to use native Windows display for headful mode
- Cleanup logic should only attempt to stop Xvfb on non-Windows systems
Impact
- Headful mode is currently broken on all Windows devices
- Makes debugging agent behavior impossible on Windows
Environment
- OS: Windows 10/11
- Python: 3.x
- Playwright: current version bundled with repo
- FARA version: latest main branch
Additional Notes
Here's a PR with the working fix: #19
husseinmozannar and ataymano
Metadata
Metadata
Assignees
Labels
No labels