Dev Container Template System
This directory contains a template-based dev container configuration system for the Tello Simulator project that automatically adapts to different platforms.
Quick Start
Run the setup script to generate a platform-specific devcontainer.json:
.devcontainer/setup.sh
The script will:
- 🔍 Auto-detect your platform (macOS, Linux, Windows, WSL)
- 📝 Generate the appropriate
devcontainer.jsonfrom the template - 📋 Show platform-specific setup instructions
Files
devcontainer.template.json- Template with platform variablessetup.sh- Platform detection and configuration scriptdevcontainer.json- Generated file (git-ignored)Dockerfile- Base Docker configurationDockerfile.windows- Windows-specific Docker configuration with VNCsupervisord.conf- Process manager for Windows VNC setupsetup-windows.sh- Windows container initialization script
Manual Platform Selection
You can also specify a platform manually:
.devcontainer/setup.sh macos # Force macOS configuration
.devcontainer/setup.sh linux # Force Linux configuration
.devcontainer/setup.sh windows # Force Windows configuration
.devcontainer/setup.sh wsl # WSL with options
Platform Configurations
macOS
- ✅ Uses
host.docker.internal:0for DISPLAY - ❌ No X11 socket mounting (not available on macOS)
- 📦 Requires XQuartz:
brew install --cask xquartz - 🔧 Run
xhost +localhostafter XQuartz setup
Linux
- ✅ Direct X11 socket mounting via
/tmp/.X11-unix - ✅ Host networking for optimal performance
- ✅ Uses local
$DISPLAYenvironment variable - 🚀 Works out of the box on most Linux distributions
Windows
- 🖥️ VNC server on port 5901 (password:
vncpass) - 🌐 Web access:
http://localhost:5901 - 📱 VNC client:
localhost:5901 - 🎯 Virtual framebuffer with Fluxbox window manager
WSL (Windows Subsystem for Linux)
Interactive setup with three options:
- X11 forwarding - Requires Windows X server (VcXsrv, Xming)
- VNC server - Same as Windows setup
- Linux-style - If X11 forwarding already configured
GUI Application Support
All configurations support GUI applications required by the Tello simulator's Ursina engine:
Test GUI support:
python -c "import tkinter; tkinter.Tk().mainloop()"
Run the simulator:
python tello_sim/run_sim.py
Development Notes
- The generated
devcontainer.jsonis git-ignored to prevent platform conflicts - Each developer runs
setup.shonce to configure for their environment - Template uses JSON variable substitution via the setup script
- Windows configuration includes full VNC stack for GUI support
Troubleshooting
Script fails to detect platform:
.devcontainer/setup.sh [platform] # Specify manually
GUI not working:
- macOS: Ensure XQuartz is running and
xhost +localhostwas executed - Linux: Check X11 forwarding with
echo $DISPLAY - Windows: Connect to VNC at
localhost:5901
Container won't start:
- Check Docker is running
- Verify VS Code "Dev Containers" extension is installed
- Try "Dev Containers: Rebuild Container" from Command Palette