레이블이 cygwin x인 게시물을 표시합니다. 모든 게시물 표시
레이블이 cygwin x인 게시물을 표시합니다. 모든 게시물 표시

2015년 12월 6일 일요일

Windows에서 Ubuntu 원격 접속을 위한 CygwinX 사용법

사용하던 CygwinX가 환경이 바뀌고 업데이트가 되더니 접속이 안되어
관련하여 문제를 찾아보고 해결함.

Ubuntu 원격 접속 방법 (Xrdp, VNC, Cygwin X)
http://charlie0301.blogspot.kr/2014/01/ubuntu-xrdp-vnc-cygwin-x.html

예전에는 이것 처럼 사용하면 되었었는데

X server 1.17 부터는 TCP/IP connection을 listen하지 않아 문제가 되는 상황

News

X server 1.17 and X.Org X11 Release 7.7 are now included in Cygwin. Details are available in the announcements here and here.
Since X server 1.17, by default the server does not listen for TCP/IP connections, only accepting local connections on a unix domain socket. See this FAQ for more details.

그래서 FAQ의 항목 중 여러 해결방법이 있는데

http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-xserver-nolisten-tcp-default

그 중 3번째 방법인 -listen tcp option을 사용하면 기존 처럼 tcp connection을 listen하게 되어 문제 없이 동작함.

좀 정리하지만

Windows와 Ubuntu로 구성된 2대의 PC가 있고 
주로 사용하는 Windows PC에서 네트워크를 통해 원격으로 
Ubuntu의 GUI application들을 Windows 바탕화면에서 띄워서 사용하고자 할 때 
CygwinX를 사용하여 위 처럼 설정하여 사용하면 됨.

사용을 위해서는

1. 당연히 Cygwin과 CygwinX 설치 필요 하고 
 > 위 링크 참고 : Ubuntu 원격 접속 방법...

2. CygwinTerminal에서 XWin을 -listen tcp option과 함께 실행 해야 하고


XWin 실행 스크립트관련해서는 아래 링크들 참고

C:\cygwin\bin\run.exe --quote /usr/bin/bash.exe -l -c "cd; /usr/bin/xinit /etc/X11/xinit/startxwinrc -- /usr/bin/XWin :0 -multiwindow -listen tcp"
http://superuser.com/questions/898781/putty-cygwin-x11-forwarding-cant-open-display-error

http://www.trueblade.com/knowledge/automatically-starting-a-cygwin-x-server
C:\opt\cygwin\bin\run.exe -p /usr/X11R6/bin XWin -listen tcp -multiwindow -clipboard -silent-dup-error


3. xterm에서 DISPLAY 설정하고 필요한 application을 실행해서 사용 하면 됨.

http://x.cygwin.com/docs/ug/using-remote-apps.html#using-remote-apps-ssh

$ export DISPLAY=:0.0 

$ ssh -Y username@remote_hostname_or_ip_address

4. putty가 있다면 XWin만 띄워 놓고 putty에서 바로 실행해서 사용 가능함.

putty > Connection > SSH > X11 > X11 forwarding > Enable X11 forwarding 체크




2015년 3월 15일 일요일

Caused by: org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]

cygwin X 등을 사용하여 SSH X11 forwarding을 하다
갑자기 shell에서 GUI application들이 아래와 같은 에러 메세지를 보여주고
실행이 안될 경우 X server가 죽었는지 확인 필요.

이것 때문에 GTK 확인하고 java 버전확인하고 삽질하다
아래 답변 보고 Cygwin X 서버 확인하여 보니 X server가 죽어 있었음.


java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at QBootLoader.main(SourceFile:99)
Caused by: org.eclipse.swt.SWTError: No more handles [gtk_init_check() failed]



2013년 3월 13일 수요일

Ubuntu 원격 접속 방법 (Xrdp, VNC, Cygwin X)

이전 블로그에서 이전 함 (원본 글 2013/03/13 작성)

Ubuntu를 설치하고 윈도우에서 원격 접속을 하려고 프로그램을 찾아봤는데
마땅히 맘에 드는게 없다. 
그나마 간편하고 맘에 드는게 윈도우 보조프로그램의 원격 데스크탑 연결 이지만 copy & Paste가 되지 않아.. 좀 아니 많이 아쉽..



윈도우에서 Ubuntu의 application을 실행 할 수 있게 해준다. 
뭐 Xmanager가 훨 좋지만 이건 공짜고 하니.
그럭저럭 쓸만한데 윈도우 조절 같은데 좀 불안정 할 때가 있음.

* 최신 CygwinX에서 연결 안될 때 참고할 게시물
: http://charlie0301.blogspot.kr/2015/12/windows-ubuntu-cygwinx.html

설치 및 설정
 . 설치
 Cygwin/X packages are located in the X11 category.
  • xorg-server (required, the Cygwin/X X Server)
  • xinit (required, scripts for starting the X server: xinit, startx, startwin (and a shortcut on the Start Menu to run it),startxdmcp.bat )
  • xorg-docs (optional, man pages)
  • X-start-menu-icons (optional, adds icons for X Clients to the Start menu)
  • You may also select any X client programs you want to use, and any fonts you would like to have available.
  • You may also want to ensure that the inetutils or openssh packages are selected if you wish to use telnet or ssh connections to run remote X clients.

 . 연결
On your Windows machine:
  1. Make sure you have the openssh package installed.
  2. Launch Cygwin/X
  3. Ensure the DISPLAY environment variable is set correctly. (This step is not neccessary if you are entering your commands into an X terminal, as DISPLAY must already be set in that case)
    $ export DISPLAY=:0.0
    
     (안되면 export $DISPLAY=:0)
  4. Run the ssh command to connect to the remote host:
    $ ssh -Y username@remote_hostname_or_ip_address
    
  5. Enter your password when prompted by ssh.
  6. Your ssh session should now show you a shell prompt for your remote machine.
    Note: The ssh server will automatically set the DISPLAY environment variable appropriately, typically to something likelocalhost:10.0, so clients will connect to a proxy X11 display on the remote host from which the X11 protocol will be forwarded over ssh to your X server.
    If your login scripts unconditionally set DISPLAY to something else, this will break X11 forwarding.
  7. You can now launch remote X clients in your ssh session, for example:
    $ xterm &
    
    will launch an xterm running on your remote host that will display on your Cygwin/X screen.
  8. Launch other remote clients in the same manner. I recommend starting the remote clients in the background, by appending & to the command name, so that you don't have to open several ssh sessions.
Note: By default, the OpenSSH server does not allow forwarded X connections. This must be configured on the remote host by adding X11Forwarding yes to the sshd_config configuration file. The OpenSSH server must be restarted or SIGHUP'ed to re-read the configuration file after it is changed.
Note: The OpenSSH server requires the xauth command to be available to forward X connections. Consequently, it must be installed on the remote host.



윈도우즈 원격 데스크탑 연결을 사용한 Xrdp serve로 연결

가장 빠르고 화면 표시가 깔끔하다. 
해상도 조절도 잘되고 윈도우에서 전체 화면으로 이용해도 무리가 없다.

단점으로는 
 - 해상도 마다 connection이 생성되고 
 - 윈도우로 Copy & Paste가 안된다.
 - 종종 원격 데스크탑이 focus를 받는 상황(as foreground window)에 떠 있는 상태에서 screen lock되어 login창이 뜨면 특정 키가 안먹을 때가 있음. => Windows key를 누른 다음 키 입력
 - Ubuntu 12.4 LTS에서는 한글 자판 설정이 안된다. (source를 컴파일해서 설치 하던가 자판 파일 수정 필요)
설치 및 설정

sudo apt-get install xrdp

메뉴가 제대로 보이지 않을 경우...

echo "gnome-session --session=ubuntu-2d" > ~/.xsession


* 원격 데스크탑 내에서 D key를 누를 경우 창이 사라지는 문제 관련 해결 링크


VNC Server로 연결

사실 많이 써보진 않았는데 화면이 너무 느리다. client 마다 편차가 심해 한두번 깔아보고 안썼음.
리눅스에서 사용중인 screen을 공유할 수 있어 unique한 화면을 사용할 수 있는 것은 장점.
그리고 다양한 VNC viewer가 존재하고 VNC Server 기능은 기본으로 Ubuntu에서 제공한다.

VNC Viewer로 접속

1. Ubuntu에서 Remote desktop 사용 설정
   Remote Desktop > Sharing > Allow other users to view your desktop > check
   Security > Require the user to enter this password > check > password submit

 
 

2. 윈도우에 VNC viewer 설치
3. Ubuntu 주소를 설정하고 연결 (xxx.xxx.xxx.xxx:0)