1.安裝 gnome 相關套件
# sudo apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal
# apt-get install gnome-panel gnome-settings-daemon metacity nautilus gnome-terminal vnc4server
2.啟動一次 再家目錄建立預設資料夾
user@ubuntu:~$ vncserver
You will require a password to access your desktops.
Password:
Verify:
xauth: file /home/user/.Xauthority does not exist
New 'ubuntu:1 (user)' desktop is ubuntu:1
Creating default startup script /home/user/.vnc/xstartup
Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/ubuntu:1.log
3.編輯 /home/user/.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 &
4.再次啟動
user@ubuntu:~$ vncserver -kill :1
Killing Xvnc4 process ID 45058
user@ubuntu:~$ vncserver
New 'ubuntu:1 (user)' desktop is ubuntu:1
Starting applications specified in /home/user/.vnc/xstartup
Log file is /home/user/.vnc/ubuntu:1.log
5.在別台機器啟動 Remmina 遠端桌面客戶端
6.新增並輸入 IP:Port 帳號 密碼
7.連線成功!!
參考來源:http://askubuntu.com/questions/475023/how-to-make-vnc-server-work-with-ubuntu-desktop-without-xfce
參考:https://docs.microsoft.com/zh-tw/azure/virtual-machines/linux/classic/remote-desktop
https://www.digitalocean.com/community/tutorials/how-to-set-up-vnc-server-on-debian-8
https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-14-04
/etc/vnc.conf
vi /etc/alternatives/vncserver -localhost
在localhost 監聽
vncserver -localhost
ssh forward
ssh -L 5901:127.0.0.1:5901 -N -f -l user server_ip_address
移除ssh forward
If you are using Linux you can kill the process by:
ps aux | grep ssh
and then use
kill <id>
To kill the process.
If the kill command is not successfull you can try
kill -9 <id>
來源:https://superuser.com/questions/87014/how-do-i-remove-an-ssh-forwarded-port
移除 監聽
vncserver -kill :2
沒有留言:
張貼留言