Questions tagged with Windows Provisioning

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Cannot run GUI/OpenGL on headless macOS EC2 Instance

Hello, I am currently trying to use EC2 mac instances to run a CI/CD pipeline which involves running tests with electron/selenium. In order to run these tests openGL needs to be available. Im currently getting there error on line 49 of https://chromium.googlesource.com/chromium/src/+/8f066ff5113bd9d348f0aaf7ac6adc1ca1d1cd31/ui/gl/init/gl_initializer_mac.cc. With the output on the instance giving: ``` 2022-06-09 19:38:25.937 Electron[52243:188559] +[NSXPCSharedListener endpointForReply:withListenerName:]: an error occurred while attempting to obtain endpoint for listener 'ClientCallsAuxiliary': Connection interrupted [52245:0609/193826.555969:ERROR:gl_initializer_mac.cc(65)] Error choosing pixel format. [52245:0609/193826.556035:ERROR:gl_initializer_mac.cc(193)] GLSurfaceCGL::InitializeOneOff failed. [52245:0609/193826.664827:ERROR:viz_main_impl.cc(188)] Exiting GPU process due to errors during initialization ``` The root cause of this is there is no display connected to the mac1 bare metal dedicated host. It seems the work around here is either using a plug to fake that a display is connected, or connecting to the instance via vnc with the following commands: **On ec2 instance** ``` sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \ -activate -configure -access -on \ -configure -allowAccessFor -specifiedUsers \ -configure -users ec2-user \ -configure -restart -agent -privs -all sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart \ -configure -access -on -privs -all -users ec2-user ``` **On local macbook** ``` ssh -L 5900:localhost:5900 -C -N -i <your private key.pem> ec2-user@<your public ip address> open vnc://localhost ``` After establishing the connection over screen share, I no longer get the openGL issues and the run succeeds. Unfortunately this is not a solution/workaround for my use case as I will need to restart/reboot these instances after each run. I have tested this multiple times and after rebooting the instance the display is no longer present. (I have verified the displays being recognized / not being recognized with displayplacer list) Some more background, this is an issue on the latest AWS Monterey and BigSur AMIs. Is there any way to make the mac1 mini dedicated host think that there is a display plugged into it or trick it into thinking there is a display via software. I need a solution here that can be implemented via a script so setting something up like https://github.com/waydabber/BetterDummy does not work for me. Github seems to have a solution for this with their self-hosted github action runners so I am curious why AWS doesn't seem to support this / should this not be a common use case for an EC2 Mac Instance?
2
answers
1
votes
171
views
Kevin
asked 6 months ago