# Proxmox RDP 자동화 시스템 Proxmox VE 호스트에서 **RDP 초기 설정** 및 **RDP/Shell 모드 API 전환**을 지원하는 통합 솔루션 ## 개요 이 시스템은 두 가지 주요 기능을 제공합니다: 1. **Proxmox RDP 초기 설정** - 부팅 시 자동으로 원격 Windows PC에 RDP 연결 2. **RDP Toggle API** - 외부에서 API 호출로 RDP/Shell 모드 실시간 전환 프론트엔드 또는 curl 명령으로 Proxmox 물리 화면을 Shell ↔ RDP 모드로 즉시 전환 가능합니다. --- ## 🚀 빠른 설치 ### 1️⃣ Proxmox RDP 초기 설정 (자동 부팅 연결) Proxmox 호스트가 부팅 시 자동으로 RDP 연결하도록 설정: ```bash curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/RDP/proxmox-auto-rdp-setup.sh | bash ``` **설치 내용:** - ✅ X Window + Openbox 윈도우 매니저 - ✅ FreeRDP3 클라이언트 설치 - ✅ 자동 로그인 및 X 시작 설정 - ✅ RDP 서버 연결 정보 구성 - ✅ 풀스크린 RDP 자동 실행 ### 2️⃣ RDP Toggle API 설치 (원격 제어) API를 통해 RDP/Shell 모드를 원격으로 전환: ```bash curl -fsSL https://git.0bin.in/thug0bin/pve9-repo-fix/raw/branch/main/RDP/install-rdp-api.sh | bash ``` **설치 내용:** - ✅ FastAPI 기반 REST API 서버 - ✅ Python venv 환경 구성 - ✅ systemd 서비스 자동 시작 - ✅ 포트 8090에서 API 실행 --- ## 📖 사용 방법 ### RDP Toggle API 사용 #### 서비스 확인 ```bash systemctl status rdp-toggle-api ``` #### API 테스트 ```bash # 현재 상태 확인 curl http://localhost:8090/status # RDP 모드로 전환 curl -X POST http://localhost:8090/toggle \ -H 'Content-Type: application/json' \ -d '{"mode":"rdp"}' # Shell 모드로 전환 curl -X POST http://localhost:8090/toggle \ -H 'Content-Type: application/json' \ -d '{"mode":"shell"}' ``` --- ## 📡 API 엔드포인트 ### GET /status 현재 RDP/Shell 모드 상태 확인 ```bash curl http://localhost:8090/status ``` **응답 예시:** ```json { "current_mode": "shell", "rdp_active": false, "last_changed": "2025-11-17T10:30:00", "config": { "rdp_server": "192.168.0.229", "rdp_username": "user", "local_user": "rdpuser" } } ``` ### POST /toggle RDP/Shell 모드 전환 ```bash # RDP 모드 활성화 curl -X POST http://localhost:8090/toggle \ -H 'Content-Type: application/json' \ -d '{"mode":"rdp"}' # Shell 모드로 전환 curl -X POST http://localhost:8090/toggle \ -H 'Content-Type: application/json' \ -d '{"mode":"shell"}' ``` ### GET /config 현재 RDP 연결 설정 조회 ```bash curl http://localhost:8090/config ``` ### PUT /config RDP 연결 설정 업데이트 ```bash curl -X PUT http://localhost:8090/config \ -H 'Content-Type: application/json' \ -d '{ "rdp_server": "new-server.example.com:3389", "rdp_username": "newuser", "rdp_password": "newpassword" }' ``` --- ## 🔗 프론트엔드 연동 ### React 예시 ```jsx import { useState, useEffect } from 'react'; const RDPToggle = () => { const [status, setStatus] = useState(null); const API_URL = 'http://your-proxmox-ip:8090'; // 상태 확인 const fetchStatus = async () => { const res = await fetch(`${API_URL}/status`); const data = await res.json(); setStatus(data); }; // 모드 전환 const toggleMode = async (mode) => { await fetch(`${API_URL}/toggle`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ mode }) }); fetchStatus(); // 상태 갱신 }; useEffect(() => { fetchStatus(); }, []); return (
현재 모드: {status?.current_mode}