2021年4月12日 星期一

用teamviewer連線到沒有螢幕的linux ubuntu主機

在某個Case中,需要把一台 linux 的電腦放在外部的網路做一些測試,因此在那台linux電腦上安裝了teamviewer,但是當我把linux 的螢幕拔掉之後,teamviewer連線到該linux後,就看不到畫面了,因此上網找了一些解決方法,下面這方法應該是可行的。 


安裝 dummy driver

sudo apt-get install xserver-xorg-video-dummy

然後在 /etc/X11/

資料夾內 建立一個 xorg.conf 檔案

檔案內容如下

Section "Device"

    Identifier  "Configured Video Device"

    Driver      "dummy"

EndSection

Section "Monitor"

    Identifier  "Configured Monitor"

    HorizSync 31.5-48.5

    VertRefresh 50-70

EndSection

Section "Screen"

    Identifier  "Default Screen"

    Monitor     "Configured Monitor"

    Device      "Configured Video Device"

    DefaultDepth 24

    SubSection "Display"

    Depth 24

    Modes "1280x800"

    EndSubSection

EndSection


重開機後,再用teamviewer連線,就可以看到畫面了