Created
March 24, 2025 12:38
-
-
Save si3mshady/4fddaabac9cd61e66fc744124eefbc10 to your computer and use it in GitHub Desktop.
π» Installs a full XFCE desktop environment and XRDP server on Ubuntu, enabling remote desktop access to run QGroundControl, DroneKit scripts, Prometheus, Grafana, and LangChain-based AI agents. This script is the foundation for developing, testing, and teaching agentic drone systems in a cloud-hosted environment. Ideal for educators, drone develβ¦
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # === STEP 0: Update System === | |
| echo "[*] Updating system..." | |
| sudo apt-get update && sudo apt-get upgrade -y | |
| # === STEP 1: Install XFCE Desktop Environment === | |
| echo "[*] Installing XFCE4 desktop environment..." | |
| sudo DEBIAN_FRONTEND=noninteractive apt-get install -y xfce4 xfce4-session | |
| # === STEP 2: Install XRDP and dependencies === | |
| echo "[*] Installing XRDP and Xorg backend..." | |
| sudo apt-get install -y xrdp xorgxrdp | |
| sudo systemctl enable xrdp | |
| # === STEP 3: Add xrdp user to ssl-cert group === | |
| echo "[*] Adding xrdp to ssl-cert group..." | |
| sudo adduser xrdp ssl-cert | |
| # === STEP 4: Configure xrdp to use XFCE === | |
| echo "[*] Configuring XRDP to use XFCE4..." | |
| echo "startxfce4" > ~/.xsession | |
| # Patch /etc/xrdp/startwm.sh to avoid blank screen | |
| echo "[*] Patching /etc/xrdp/startwm.sh to launch XFCE..." | |
| sudo sed -i.bak '/fi/a startxfce4' /etc/xrdp/startwm.sh | |
| # === STEP 5: Restart XRDP service === | |
| echo "[*] Restarting XRDP..." | |
| sudo systemctl restart xrdp | |
| # === STEP 6: Set password for current user === | |
| echo "[*] Setting password for user: $USER" | |
| sudo passwd $USER | |
| # === STEP 7: Open port 3389 for RDP === | |
| echo "[*] Allowing RDP through firewall (TCP 3389)..." | |
| sudo ufw allow 3389/tcp | |
| sudo ufw reload | |
| # === DONE === | |
| echo "[β ] XRDP setup complete. You can now connect via RDP to your VM using:" | |
| echo "π IP or External DNS" | |
| echo "π Port: 3389" | |
| echo "π Username: $USER" | |
| echo "π Password: the one you just set" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment