gcp에서 vm생성한 후 원격접속하는 과정이다.

console에서 cloud shell을 연다.

gcloud beta compute ssh vm명
gcloud beta compute ssh instance-1

아무 설정도 안했기 때문에 주의 message와 함께 ssh key 생성여부를 물어본다
Warning: The private SSH key file for gcloud does not exist
...
This tool needs to create the directory [.../.ssh] before being able to generate SSH keys
Do you want to continue (Y/n)?   에서 Y로 진행한다.

Generating public/private rsa key pair.
Enter passphrase :  비밀번호입력
Enter same passphrase again : 비밀번호입력

그러면 key정보 등이 있는 위치를 알려준다.

이때 cloud shell의 현재 region과 vm의 region이 다르면
Did you mean zone [asia-east1-a] for instance : [instance-1] (Y/n) 이 나온다
현재 설정된 region은 asia-ease1-a인데 instance-1 이 맞냐? 안맞는데 Y를 눌렀더니
No zone specified. Using zone [asia-northeast3-a] for instance: [instance-1] 이라고 친절하게
instance-1은 asia-northease3-a 를 쓰고 있어 라고 알려준다.

현재 작업하는 region을 바꾸거나
Did you mean zone [asia-east1-a] for instance : [instance-1] (Y/N) 이 나오면 n을 누른다

다시 password 설정을 한다
Enter passphrase for key ... : 비밀번호입력
Enter passphrase for key ... : 비밀번호입력

생성되어 해당 instance에 접속된다.

ubuntu의 xwindow를 설치한다.
sudo apt install -y ubuntu-desktop xrdp

(시간이 꽤... 걸리네...)

설치 후 데몬 활성화

systemctl enable gdm3
systemctl enable xrdp
service gdm3 start
service xrdp start

포트확인(3389가 열려있어야 함)
netstat -lntp

rdp 설정 및 연결

vi /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla

[Allow Colord all Users] Identity=unix-user:* Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile ResultAny=no ResultInactive=no ResultActive=yes

수정후
service xrdp restart

이제 자신의 windows pc에서
시작 - mstsc

vm ip 입력
아까 생성한 비밀번호 입력

참조 : https://blog.dalso.org/google-cloud-platform-2/15905

 

GCP VM 인스턴스 GUI로 접근하기 - 달소씨의 하루

앞서 virt용으로 설치한 Ubuntu를 비롯한 GCP에서 제공하는 모든 이미지에는 GUI가 적용되어있지 않습니다. 그래서 Ubuntu에서 GUI를 사용할수 있도록 하는 Gnome을 설치해보도록 하겠습니다. 사용자 계

blog.dalso.org

 

728x90
BLOG main image
"그게 뭐 어쨌다는 거냐?" 늘 누가 나에게 나에대한 말을할 때면 이말을 기억해라. by nobang

카테고리

nobang이야기 (1933)
Life With Gopro (7)
Life With Mini (79)
Diary (971)
너 그거 아니(do you know) (162)
난 그래 (159)
Study (290)
속지말자 (10)
Project (34)
Poem (15)
Song (0)
Photo (113)
낙서장 (45)
일정 (0)
C.A.P.i (2)
PodCast (0)
nobang (27)
고한친구들 (4)
recieve (0)
History (0)
android_app (2)

최근에 올라온 글

최근에 달린 댓글

최근에 받은 트랙백

Total :
Today : Yesterday :