# 遠端桌面 Remote Desktop :::info 非必要請盡量使用 command line 操作電腦 ::: ## Server (要連線的機器) 1. 下載vino並更改設定 ``` sudo apt install vino ``` ``` gsettings set org.gnome.Vino require-encryption false gsettings set org.gnome.Vino prompt-enabled false gsettings set org.gnome.Vino authentication-methods "['vnc']" gsettings set org.gnome.Vino lock-screen-on-disconnect false gsettings set org.gnome.Vino vnc-password $(echo -n "nycuorcaauv"|base64) ``` 2. 讓vino-server在開機時自動啟動 ``` mkdir -p ~/.config/autostart sudo vim ~/.config/autostart/vino-server.desktop ``` ``` [Desktop Entry] Type=Application Name=Vino VNC server Exec=/usr/lib/vino/vino-server NoDisplay=true ``` 3. 若有外接螢幕,到上一個步驟為止,vino-server就已經可以正常運作了,以下的操作為沒有外接螢幕的解法: ``` sudo apt install xserver-xorg-video-dummy ``` ``` sudo vim /etc/X11/xorg.conf ``` ``` Section "Monitor" Identifier "Monitor0" HorizSync 28.0-80.0 VertRefresh 48.0-75.0 # 1920x1080 @ 60.00 Hz (GTF) hsync: 67.08 kHz; pclk: 172.80 MHz Modeline "1920x1080_60.00" 172.80 1920 2040 2248 2576 1080 1081 1084 1118 -HSync +Vsync EndSection Section "Device" Identifier "Card0" Option "NoDDC" "true" Option "IgnoreEDID" "true" Driver "dummy" EndSection Section "Screen" DefaultDepth 16 Identifier "Screen0" Device "Card0" Monitor "Monitor0" SubSection "Display" Depth 16 Modes "1920x1080" EndSubSection EndSection ``` ``` cat /etc/X11/default-display-manager # 確認display manager 是否為gdm3 ``` ``` sudo vim /etc/gdm3/custom.conf ``` ``` WaylandEnable=false AutomaticLoginEnable = true AutomaticLogin = username ``` ``` sudo reboot ``` 這種配置再次接上螢幕後會有黑屏的情況,若未來有需要再接上螢幕,需要將剛剛的設定改名或刪除 ## Client (你的電腦) 1. 下載VNC viewer(或任何支援VNC的app): https://www.realvnc.com/en/connect/download/viewer/ 2. 輸入server ip  3. 輸入剛才設定的密碼  4. 連線成功  5. 連不到的時候怎麼辦? 連不上可能是因為上一次的連線沒有正常結束,導致新的連線沒辦法建立,可以參考以下方式重新啟動vino server: ``` pkill vino export DISPLAY=:0 /usr/lib/vino/vino-server ``` https://askubuntu.com/questions/952265/how-to-restart-vino-or-my-desktop-environment
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up