현재 사용하고 있는 상태는 리눅스 데스크탑 1대, 윈도우 XP 데스크탑 1대 그리고 윈도우 XP 노트북 1대.
하지만, 이리저리 옮겨가며 키보드, 마우스를 사용하긴 여긴 힘든게 아니다 ㅡ.ㅜ
또한, 데스크탑 2대는 키보드, 마우스, 모니터 각 1대로 그냥 여기 꼽았다, 뺐다 쓰고 있는 상황이다.
이전에는 키보드,마우스,모니터 공유기(?)가 있어서 사용가능했었는데, 필요 없어서 누구 줘버렸었다 ㅡ.ㅜ;

윈도우 XP 두대는 Synergy(http://synergy.sf.net 에서 Open Source로 진행 중인 프로젝트이다, http://synergy2.sourceforge.net 인 것 같다.)를 이용해서 공유는 해봤었다.
어느 날인가 이 Synergy가 리눅스에서도 지원되는지는 잘 몰랐었는데, 소스포지닷넷(sf.net)에서 지원하는 것보면 거의 리눅스용인데... 생각하면서 살펴보니, 리눅스에서도 지원한 걸 봤던 기억이 난다.

리눅스는 아직 해보지 않았었다. 하지만, 생각보다 간단했다 ㅎㅎ

일단은 리눅스가 어떤 리눅스인지에 따라 설치 방법이 달라지겠지만, Synergy 리눅스용 프로그램을 어떻게 구해보면 금방 가능해진다.
원래는 위 사이트에서 다운로드가 되어야하는데, 어찌된 영문인지 다운로드 페이지가 뜨질 않았다. ㅡ.ㅜ
하는 수 없이.. 젠투(Gentoo) 리눅스를 사용하고 있는 상황이라 emerge 패키지 시스템을 사용해서 설치하는 수 밖에..

# emerge -s synergy
Searching...
[ Results for search key : synergy ]
[ Applications found : 1 ]

*  x11-misc/synergy
      Latest version available: 1.3.1
      Latest version installed: 1.3.1
      Size of files: 774 kB
      Homepage:      http://synergy2.sourceforge.net/
      Description:   Lets you easily share a single mouse and keyboard between multiple computers.
      License:       GPL-2

패키지가 있어서 다행이다. 설치는 아주 간단하다.

# emerge synergy

그러면 /usr/bin 폴더에 synergyc와 synergys 파일이 생성되게 되는데, 이 파일이 각각 클라이언트와 서버 역할을 할 수 있도록 한다.
일단, 도움말을 보고..

# synergyc --help
Usage: synergyc [--daemon|--no-daemon] [--debug <level>] [--display <display>] [--name <screen-name>] [--restart|--no-restart] <server-address>

Start the synergy mouse/keyboard sharing server.

  -d, --debug <level>      filter out log messages with priorty below level.
                           level may be: FATAL, ERROR, WARNING, NOTE, INFO,
                           DEBUG, DEBUG1, DEBUG2.
      --display <display>  connect to the X server at <display>
  -f, --no-daemon          run the client in the foreground.
*     --daemon             run the client as a daemon.
  -n, --name <screen-name> use screen-name instead the hostname to identify
                           ourself to the server.
  -1, --no-restart         do not try to restart the client if it fails for
                           some reason.
*     --restart            restart the client automatically if it fails.
  -h, --help               display this help and exit.
      --version            display version information and exit.

* marks defaults.

The server address is of the form: [<hostname>][:<port>].  The hostname
must be the address or hostname of the server.  The port overrides the
default port, 24800.

Where log messages go depends on the platform and whether or not the
client is running as a daemon.

이미 노트북을 서버로 사용해서 키보드, 마우스를 사용하고 있으니, 리눅스에선 클라이언트로 해서 노트북에 접속하면 된다.

# synergyc --no-daemon --display localhost:1 --name desktop-linux 서버IP주소
INFO: synergyc.cpp,716: Synergy client 1.3.1 on Linux 2.6.27-gentoo-r10 #1 SMP Fri Apr 17 12:14:01 KST 2009 i686
DEBUG: CXWindowsScreen.cpp,841: XOpenDisplay("localhost:1")
DEBUG: CXWindowsScreenSaver.cpp,339: xscreensaver window: 0x00000000
DEBUG: CXWindowsScreen.cpp,111: screen shape: 0,0 1280x1024
DEBUG: CXWindowsScreen.cpp,112: window is 0x00600004
DEBUG: CScreen.cpp,38: opened display
NOTE: synergyc.cpp,330: started client
DEBUG: CXWindowsClipboard.cpp,313: open clipboard 0
DEBUG: CXWindowsClipboard.cpp,266: empty clipboard 0
DEBUG: CXWindowsClipboard.cpp,289: grabbed clipboard 0
DEBUG: CXWindowsClipboard.cpp,348: close clipboard 0
DEBUG: CXWindowsClipboard.cpp,313: open clipboard 1
DEBUG: CXWindowsClipboard.cpp,266: empty clipboard 1
DEBUG: CXWindowsClipboard.cpp,289: grabbed clipboard 1
DEBUG: CXWindowsClipboard.cpp,348: close clipboard 1
NOTE: synergyc.cpp,247: connected to server
INFO: CScreen.cpp,98: entering screen
DEBUG: CServerProxy.cpp,523: recv clipboard 0 size=1328
DEBUG: CXWindowsClipboard.cpp,313: open clipboard 0
DEBUG: CXWindowsClipboard.cpp,266: empty clipboard 0
DEBUG: CXWindowsClipboard.cpp,289: grabbed clipboard 0
DEBUG: CXWindowsClipboard.cpp,300: add 1316 bytes to clipboard 0 format: 0
DEBUG: CXWindowsClipboard.cpp,348: close clipboard 0
DEBUG: CServerProxy.cpp,523: recv clipboard 1 size=1328
DEBUG: CXWindowsClipboard.cpp,313: open clipboard 1
DEBUG: CXWindowsClipboard.cpp,266: empty clipboard 1
DEBUG: CXWindowsClipboard.cpp,289: grabbed clipboard 1
DEBUG: CXWindowsClipboard.cpp,300: add 1316 bytes to clipboard 1 format: 0
DEBUG: CXWindowsClipboard.cpp,348: close clipboard 1
INFO: CScreen.cpp,116: leaving screen

간단히 synergy 서버 역할을 하고 있는 노트북에선 아래와 같은 설정만 해놓으면 된다.
나 같은 경우에는 노트북이 오른쪽에 있고, 리눅스 데스크탑이 왼쪽에 있는 상황. 그리고 XP 데스크탑이 위쪽에 있는 것으로 설정하였다.
즉, 리눅스 데스크탑에서 화면 오른쪽으로 이동하면, 노트북 화면으로 이동되는 것이다.
 - desktop : 윈도우 XP 데스크탑 (시너지 클라이언트)
 - desktop-linux : Gentoo Linux 데스크탑 (시너지 클라이언트)
 - notebook : 윈도우 XP 노트북로 여기에 연결되어 있는 키보드와 마우스 사용함 (시너지 서버)


이렇게 서버에서 설정된 상황에서 리눅스에서 시너지 클라이언트(synergyc)로 접속하면 된다.

리눅스 상에선 X 윈도 화면이 나오는 디스플레이 번호를 잘 부여해야 한다.

나의 경우에는 ./start_xserver 실행하여 Xserver를 실행하고, 다른 ssh 화면에서 ./start_xclient 실행하여 Xclient를 실행하고, 또 다른 ssh 화면에서 ./start_mpwm 실행하여 mpwm(윈도우 매니저)를 실행한다. 그리고 또 다른 ssh 화면에서 디스플레이 화면을 1번으로 설정하고, xterm을 띄운다. 이러면, 리눅스 상에 있는 모니터엔 디스플레이 화면 1을 사용하는 Xwindow가 띄워진 상태가 된다. 이 상태에서 위에서 적힌 synergyc를 실행해야 해당 디스플레이 화면에 마우스 포인터가 나오게 되는 것이다.

참고를 위해 바로 위에서 사용한 쉘 스크립트를 적어본다.

# vim start_xserver.sh

#!/bin/bash

export LD_LIBRARY_PATH=/root/xorg/lib
/root/xorg/bin/xinit -- /root/xorg/bin/Xorg -verbose 6 -config mpx.xorg.conf



# vim start_xclient.sh

#!/bin/bash

export LD_LIBRARY_PATH=/root/xorg/lib
/root/xorg/bin/Xorg -ac -config mpx.xorg.conf :1



# vim start_mpwm.sh

#!/bin/bash

export LD_LIBRARY_PATH=/root/xorg/lib
export DISPLAY=localhost:1
/root/xorg/bin/mpwm



# vim c.sh

#!/bin/bash

export PATH=/root/xorg/bin:$PATH
export LD_LIBRARY_PATH=/root/xorg/lib
export DISPLAY=localhost:1



위에 있는 c.sh를 이용해 source c.sh로 실행하여, 현재 쉘 환경에 적용한 후, xerm을 실행하면 된다.

Posted by wbhacker :