desktop icon indicating copy to clipboard operation
desktop copied to clipboard

Failed to start Xvfb: context deadline exceeded:

Open bishwenduk029 opened this issue 1 year ago • 3 comments

I am not sure but this simple script used to work earlier, but now e2b-desktop containers are not coming up and I keep getting this error

Error: context deadline exceeded: This error is likely due to exceeding 'timeout' — the total time a long running request (like process or directory watch) can be active. It can be modified by passing 'timeout' when making the request. Use '0' to disable the timeout.

I tried with timeout value zero but no luck.

Any help would be great. Thanks.

from e2b_desktop import Sandbox

def main():
    try:
        print("Creating custom-computer-agent desktop sandbox...")
        
        # Create the desktop sandbox
        desktop = Sandbox.create(
            template="custom-computer-agent"
        )
        
        print(f"Sandbox created with ID: {desktop.sandbox_id}")
        
        # Start the stream
        print("Starting desktop stream...")
        desktop.stream.start()
        
        # Get interactive stream URL
        interactive_url = desktop.stream.get_url()
        print(f"Interactive VNC URL: {interactive_url}")
        
        # Get view-only stream URL
        view_only_url = desktop.stream.get_url(view_only=True)
        print(f"View-only VNC URL: {view_only_url}")
        
        print(f"\nSandbox ID: {desktop.sandbox_id}")
        print("Sandbox is ready for VNC access!")
        
        # Keep the script running to maintain the connection
        print("\nPress Ctrl+C to stop the stream and close the sandbox...")
        
        # Wait for user interrupt
        try:
            while True:
                import time
                time.sleep(1)
        except KeyboardInterrupt:
            print("\nStopping desktop stream...")
            desktop.stream.stop()
            print("Stream stopped.")
            
    except Exception as e:
        print(f"Error: {e}")
        return 1
    
    return 0

if __name__ == "__main__":
    exit(main())

so I tried to copy the Sandbox from desktop, and re-run then I get

Error: Failed to start Xvfb: context deadline exceeded: This error is likely due to exceeding 'timeout' — the total time a long running request (like process or directory watch) can be active. It can be modified by passing 'timeout' when making the request. Use '0' to disable the timeout.

version of e2b-desktop is "e2b-desktop>=2.0.2",

bishwenduk029 avatar Oct 20 '25 01:10 bishwenduk029

ENG-3198

linear[bot] avatar Oct 20 '25 01:10 linear[bot]

Hey, @bishwenduk029 you using a custom template? If so, can you share?

mishushakov avatar Oct 20 '25 17:10 mishushakov

When I run the script using the default Desktop template:

Creating custom-computer-agent desktop sandbox...
Sandbox created with ID: idoobj81uvn4522aavpd1
Starting desktop stream...
Interactive VNC URL: https://6080-idoobj81uvn4522aavpd1.e2b.app/vnc.html?autoconnect=true&resize=scale
View-only VNC URL: https://6080-idoobj81uvn4522aavpd1.e2b.app/vnc.html?autoconnect=true&view_only=true&resize=scale

Sandbox ID: idoobj81uvn4522aavpd1
Sandbox is ready for VNC access!

Press Ctrl+C to stop the stream and close the sandbox...
Image

mishushakov avatar Oct 20 '25 17:10 mishushakov