IT. POST LIST

POST ALL LABEL

DOCKER - Ubuntu-Desktop - NoVncViewer

By 때찌때찌맴매 - 4월 07, 2018


DOCKER - Ubuntu-Desktop - NoVncViewer

* 해당 작업은 docker가 설치 되어 있는 환경에서 진행하고, docker로  ubuntu desktop 을 올려  웹브라우저로 ubuntu를 접속하는 방법 입니다.
[ Quick Start ]
[root@localhost ]# docker run -d -p 6080:80 --name ubuntu_dt dorowu/ubuntu-desktop-lxde-vnc
Unable to find image 'dorowu/ubuntu-desktop-lxde-vnc:latest' locally
Trying to pull repository docker.io/dorowu/ubuntu-desktop-lxde-vnc ... 
latest: Pulling from docker.io/dorowu/ubuntu-desktop-lxde-vnc
5ed55f09d535: Extracting [=====================>                             ] 184.9 MB/424.1 MB
e9ee3a2f4ce1: Download complete 
f228aa1b5acd: Download complete 

[root@localhost ]# docker images
REPOSITORY                  TAG                 IMAGE ID            CREATED             SIZE
docker.io/dorowu/ubuntu-…   latest              5077c595d94a        5 days ago          1.1 GB

[root@localhost ]# docker ps -a
CONTAINER ID    MAGE           COMMAND       CREATED     STATUS    PORTS                NAMES
bd95bd7d0599    dorowu/ubuntu… "/startup.sh" 56 seconds ago…       0.0.0.0:6080->80/tcp ubuntu_dt

[접속 확인]
Web Browse chrome

http://xxx.xxx.xxx.xxx:6080/



* start menu -> Internet -> 브라우저 실행
  브라우저에서 크롬은 실행이 안되네요.. 원인을 찾아봐야 할듯 합니다.
  아래 있는 크롬 사운드는 모듈이 없어서 실행이 안됩니다.
  파이어 폭스만 정상적으로 됩니다.


[ NOVnc 사운드 모드 ]

* centos7에는 기본적으로 모듈이 설치되어 있습니다. modprobe 로 모듈만 적재 시켜 주시면 될것 같습니다.
* 아래는 ubuntu 16.04 서버에서 진행 하였습니다.

[root@localhost ]# apt-get install linux-generic build-essential alsa-utils

[root@localhost ]# modprobe snd-aloop index=2
modprobe: FATAL: Module snd-aloop not found in directory /lib/modules/4.4.0-62-generic

* 모듈을 찾을 수 없다면 리부팅 진행 

docker run -it --rm -p 6080:80 --device /dev/snd -e ALSADEV=hw:2,0 dorowu/ubuntu-desktop-lxde-vnc

* 해당 명령어로 진행시 백그라운드 실행이 아닌 포그라운드 실행으로 로그 확인이 가능 합니다.
* ctrl+d 입력시 컨테이너 삭제및 종료 됩니다. 운영시에는 -d 옵션 추가와 --rm 옵션을 제거 하고 진행합니다.

[root@localhost ]# docker run -itd -p 6080:80 --device /dev/snd -e ALSADEV=hw:2,0 --name ubuntu_dt dorowu/ubuntu-desktop-lxde-vnc
Unable to find image 'dorowu/ubuntu-desktop-lxde-vnc:latest' locally
latest: Pulling from dorowu/ubuntu-desktop-lxde-vnc
5ed55f09d535: Downloading [==========================>                        ] 223.5 MB/424.1 MB
e9ee3a2f4ce1: Verifying Checksum 
f228aa1b5acd: Download complete 

* 기본 모드로 실행을 한번 이상했다면 다운로드 없이 진행됩니다.

[접속 확인]
* 일반 접속과는 달리  /?video   붙여 줍니다. 해당 주소 부분을 제거 하면 일반 모드로 접속 됩니다.

http://xxx.xxx.xxx.xxx:6080/#/?video



* 접속시 접근 속도가 느립니다. 반응속도 역시 느립니다...
  start menu -> Internet -> Chromium Web Browser Sound 실행합니다.
  youtube 접속을 통해 사운드 확인이 되었습니다. 하지만, 반응 속도 및 서버가 부하가 올라가네요.. 
  사용하기에는 효율적이지 못할 것 같습니다.
[VNC viewer]

* VNC 서비스 포트 5900를 호스트로 연결 됩니다.

[root@localhost ]# docker run -p 6080:80 -p 5900:5900 dorowu/ubuntu-desktop-lxde-vnc

* vnc 뷰어 기본포트 5900으로 연결 하고, 서비스 보호를 하려면 패스워드 옵션을 넣습니다.

[root@localhost ]# docker run -p 6080:80 -p 5900:5900 -e VNC_PASSWORD={"패스워드"} dorowu/ubuntu-desktop-lxde-vnc
* {"패스워드"} 에 패스워드를 입력 후 vnc 뷰어 접속시 패스워드 입력후 접근 가능합니다.

[ HTTP Base Authentication ]

* 해당 이미지는 브라우저 접근시 패스워드를 넣을 수 있습니다.
root@localhost ]#  docker run -p 6080:80 -e HTTP_PASSWORD=mypassword dorowu/ubuntu-desktop-lxde-vnc


* ssl, 해상도 설정, 사용자 설정 역시 옵션을 통해 지정 할 수 있습니다.  자세한 내용은 상단 참조 사이트에서 확인 해주세요.


  • Share:

You Might Also Like

0 개의 댓글