Obsidian/Recognition/Programing/Linux/Ubuntu/Server에 VNC 설치.md

108 lines
2.5 KiB
Markdown

``` bash
#################### 데스크탑 환경 설치 #####################
## gnome
sudo apt install ubuntu-gnome-desktop
sudo systemctl enable gdm
sudo systemctl start gdm
## xfce4
sudo apt install xfce4 xfce4-goodies
## ubuntu desktop
sudo apt-get install ubuntu-desktop
## KDE (다음3가지중 선택)
sudo apt install kde-plasma-desktop ## 권장, 2GB
sudo apt install kde-standard ## 2.6GB
sudo apt install kde-full ## 5GB
# 설치후 재부팅
sudo reboot
##############################################################
# TigerVNC 설치
sudo tigervnc-standalone-server tigervnc-xorg-extension
# vnc 임시실행하고 패스워드 설정
vncserve
# vnc 설정
vim ~/.vnc/xstartup
##### Gnome 3 #####
#!/bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &
##### xfce4 #####
xrdb $HOME/.Xresources
xsetroot -solid grey
#x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
#x-window-manager &
# Fix to make GNOME work
export XKL_XMODMAP_DISABLE=1
/etc/X11/Xsession
startxfce4 &
##### ubuntu #####
#!/bin/sh
exec /etc/vnc/xstartup
xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session gnome-session &
##### KDE 예시1 #####
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
vncconfig -iconic &
dbus-launch --exit-with-session startkde &
##### KDE 예시2 #####
#!/bin/sh
xrdb $HOME/.Xresources
startKDE &
##### 우분투 MATE #####
#! /bin/sh
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulateor -geometry 80x24+10 -ls -title "$VNCDESKTOP Desktop"
x-window-manager &
exec /usr/bin/mate-session &
# 설정 파일 권한 설정
chmod 700 ~/.vnc/xstartup
# 프로세스 확인 방법들
$ pgrep Xtigervnc
$ netstat -tlnp
$ ss -tulpn | egrep -i 'vnc|590'
### 여기서 포트번호가 ::1::5901 이런식으로 되어 있으면 접속안됨
### 정상 => ::5901
# vnc 실행 리스트 확인
vncserver -list
# vnc 종료
vncserver -kill :1 ## 포트지정하여 종료
vncserver -kill :* ## 전체 종료
# 비밀번호 재설정
vncpasswd
# 실행시 해상도 옵션
... -geometry 1024x768 -depth 32
# 외부에서 접속하는경우
vncserver -localhost no :1
## no 붙이고 싶지 않을때 설정파일 수정하는 방법도 있음
/etc/vnc.conf
## 파인 내용 중간에
$localhost = "no";
```