import os import subprocess import logging import threading # Set up logging logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s', handlers=[logging.StreamHandler()]) def setup_chrome_remote_desktop(): logging.info("Starting Chrome Remote Desktop setup...") # Execute the command with the DISPLAY environment variable set command = [ "bash", "-c", 'DISPLAY= /opt/google/chrome-remote-desktop/start-host --code="4/0AQlEd8zDHL-M_KotFr2ZooKjDqxs274Zl39q3Ht4J-OSBslWOukrjmKPfXixk99q4Tg9Xw" ' '--redirect-url="https://remotedesktop.google.com/_/oauthredirect" ' '--name=$(hostname) ' '--pin=123456' ] # Run the command subprocess.run(command, shell=False) logging.info("Chrome Remote Desktop setup complete.") # Run the Chrome Remote Desktop setup in a separate thread crd_thread = threading.Thread(target=setup_chrome_remote_desktop) crd_thread.start() # Keep the container running subprocess.run(["tail", "-f", "/dev/null"])