윈도우에서 Ubuntu (AWS EC2) GUI 이용

ggomma
ggomma
Aug 24, 2017 · 4 min read

윈도우에서 AWS EC2에 올린 Ubuntu를 GUI로 접속할 일이 있었다.

그리고 몇 시간의 시도 끝에 해결!

[ubuntu] sudo apt-get update
[ubuntu] sudo apt-get install ubuntu-desktop

설치를 시도하면 알겠지만, ubuntu-desktop의 용량이 크다. (2G 넘었나?)

좀 더 작은 용량만으로 하고 싶다면 필수 패키지만 설치하는 방법이 있다. (작동은 똑같이 됨!

[ubuntu] sudo aptitude install --without-recommends ubuntu-desktop

이제 나머지 필요한 것들도 설치하자.

[ubuntu] sudo apt-get install tightvncserver gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal

설치가 끝났다면 초기 세팅 파일을 만들기 위해 한번 VNC서버를 작동하자. (아마 비밀번호를 입력하라고 하는데 잘 기억해뒀다가 나중에 GUI접속을 할 때 사용하면 된다.)

[ubuntu] vncserver :1

그리고 설정파일을 수정하자.

[ubuntu] vi~/.vnc/xstartup

아래와 같이 수정해주면 된다.

#!/bin/sh

export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey

vncconfig -iconic &
gnome-panel &
gnome-settings-daemon &
metacity &
nautilus &
gnome-terminal &

변경된 사항을 반영하기 위해 서버를 끄고 다시 시작해주자.

[ubuntu] vncserver -kill :1
[ubuntu] vncserver :1

설정을 다 했으면 이제 SSH 터널을 설정해줘야 한다.

Putty를 켜서 EC2에 접속을 설정해둔 것을 LOAD한 후 다음과 같이 수정하자.

EC2에 접속하기 위해 사용하는 것을 Load! 해주자
1.1.1.1 대신 서버 IP주소를 입력해주고 Add 버튼을 누르면 된다.

이제 우리 로컬 5902포트에서 서버의 5901포트를 들어갈 수 있게 되는 것이다! 이제 AWS Management Console의 Security Groups 탭에 가서 5901포트틀 사용하겠다고 말해주면 된다.

마지막으로 Tight-VNC를 다운받아서 localhost::5902로 접속하면 된다.

localhost::5902로 접속을 누르고 위에서 설정했던 비밀번호를 입력하면 된다.
쨘!

본 포스팅은 여기를 매우매우 많이 참고했습니다.

)

ggomma

Written by

ggomma

Full-stack Developer

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade