Options for a graphical interface on EC2
- Linux (Ubuntu/Debian):
- Install a virtual X server (xvfb) to run Chrome in non-headless mode.
- Or install a lightweight desktop environment (XFCE, LXDE) and access it via VNC.
- Windows Server EC2:
- The graphical interface is already included. You can launch Chrome/Firefox directly, and Selenium will run in normal mode.
- Remote access:
- VNC, RDP, or NICE DCV (AWS service optimized for graphical sessions).
Points to consider
- Cost: Enabling a graphical interface consumes more CPU/RAM → choose a suitable instance (t2.medium or higher).
- Anti-headless sites: If you want to avoid detection, it's better to use a real graphical environment (via VNC or RDP) rather than --headless.
- Automation: For CI/CD, xvfb remains lighter and avoids maintaining a full graphical interface.
In summary: EC2 doesn't block the graphical interface, but it doesn't install it by default. Therefore, you can proceed by adding a lightweight desktop environment or using xvfb to simulate a screen and run Selenium in normal mode.