반응형
📌 리눅스 클립보드 3종류
- PRIMARY
- 마우스로 드래그한 선택 영역.
- 붙여넣기는 중간 버튼(또는 Shift+Insert).
- xclip -o -selection primary 로 확인.
- CLIPBOARD
- Ctrl+C / Ctrl+V 같은 단축키로 다루는 영역.
- Windows와 RDP에서 공유되는 것은 이쪽입니다.
- xclip -o -selection clipboard 로 확인.
- SECONDARY
- 거의 쓰이지 않음
(PRIMARY → CLIPBOARD 자동 동기화)
1) autocutsel 사용
sudo apt install autocutsel -y
세션에서 자동 실행되도록 추가:
autocutsel -fork autocutsel -selection PRIMARY -fork
(보통 ~/.xsession이나 ~/.xinitrc, 또는 XFCE의 Session and Startup → Application Autostart에 등록)
✅ 정리
- Windows ↔ Linux는 CLIPBOARD만 동기화.
- 마우스 드래그(=PRIMARY)를 Windows로 넘기려면 → PRIMARY를 CLIPBOARD에 자동 복사하는 도구 필요.
- autocutsel 로 해결 가능.
👉 바로 xclip -o -selection primary 실행해 보시면, 드래그한 텍스트가 나오실 겁니다.
그다음 autocutsel을 켜고 다시 해보면 Windows에도 전달될 거예요.
🔧 root GUI 세션에서 autocutsel 자동 실행하기
1) 패키지 설치
apt update apt install autocutsel -y
2) 수동 실행 확인
root GUI 세션에서 터미널 열고:
autocutsel -fork autocutsel -selection PRIMARY -fork
→ 이제 드래그한 텍스트가 xclip -o -selection clipboard 로 보이고, Windows에도 복사되는지 확인하세요.
3) 자동 시작 등록
(A) XFCE Autostart 폴더 이용
mkdir -p /root/.config/autostart
cat > /root/.config/autostart/autocutsel.desktop << "EOF"
[Desktop Entry]
Type=Application
Exec=sh -c "autocutsel -fork && autocutsel -selection PRIMARY -fork"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=autocutsel
Comment=Sync PRIMARY and CLIPBOARD for RDP sessions
EOF
(B) 또는 /etc/xdg/autostart/에 등록 (모든 사용자 공통)
cat > /etc/xdg/autostart/autocutsel.desktop << "EOF"
[Desktop Entry]
Type=Application
Exec=sh -c "autocutsel -fork && autocutsel -selection PRIMARY -fork"
Hidden=false
NoDisplay=false
X-GNOME-Autostart-enabled=true
Name=autocutsel
Comment=Sync PRIMARY and CLIPBOARD for RDP sessions
EOF
4) 재로그인 / 재부팅 후 확인
RDP로 root 로그인 → 드래그 복사 → Windows에 붙여넣기 가능해야 합니다.
ps -ef | grep autocutsel 로 프로세스가 떠 있는지도 확인하세요.
반응형
'ChatGPT > 프로...Linux' 카테고리의 다른 글
| Win->Linux 카피시 라인마다... "^M" 제거 (0) | 2025.09.03 |
|---|---|
| DNS 안 될때 (1) | 2025.08.25 |
| Tcp로 간단 Text 주고 받기 (0) | 2025.04.03 |
| 하나의 IP에 두개의 인터페이스 이름을 만드는 방법 (0) | 2025.04.02 |
| Ubuntu) 한국 표준시(KST)인 Asia/Seoul로 변경 (0) | 2025.04.02 |