五月综合激情婷婷六月,日韩欧美国产一区不卡,他扒开我内裤强吻我下面视频 ,无套内射无矿码免费看黄,天天躁,日日躁,狠狠躁

新聞動態(tài)

Ubuntu20.04 VNC 安裝與設(shè)置實現(xiàn)

發(fā)布日期:2022-01-27 17:50 | 文章來源:gibhub

VNC是一個遠(yuǎn)程桌面協(xié)議。按照本文的說明進(jìn)行操作可以實現(xiàn)用VNC對Ubuntu 20.04進(jìn)行遠(yuǎn)程控制。一般的VNC安裝方式在主機(jī)沒有插顯示器的時候是無法使用的。下面的操作可以在主機(jī)有顯示器和沒有顯示器時都能夠正常工作。

首先安裝x11vnc

sudo apt-get install x11vnc -y

設(shè)置vnc密碼

sudo x11vnc -storepasswd /etc/x11vnc.pass 

創(chuàng)建x11vnc自啟動服務(wù)

創(chuàng)建 /etc/systemd/system/x11vnc.service,并寫入以下內(nèi)容

[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth /run/user/1000/gdm/Xauthority -forever -loop -noxdamage -repeat -rfbauth /etc/x11vnc.pass -rfbport 5900 -shared
[Install]
WantedBy=multi-user.target

啟動x11vnc服務(wù)

sudo systemctl enable x11vnc
sudo service x11vnc start

此時如果遠(yuǎn)程的主機(jī)上接了顯示器,那么就可以在局域網(wǎng)通過VNC進(jìn)行訪問了。

為了能夠保證遠(yuǎn)程主機(jī)無論是否有顯示器,我們都能通過VNC進(jìn)行遠(yuǎn)程訪問,我們還要做下面的修改

創(chuàng)建默認(rèn)的xorg.conf文件

sudo Xorg :1 -configure

此時程序會生成 /root/xorg.conf.new文件

我的默認(rèn)文件內(nèi)容如下

Section "ServerLayout"
 Identifier   "X.org Configured"
 Screen   0 "Screen0" 0 0
 InputDevice  "Mouse0" "CorePointer"
 InputDevice  "Keyboard0" "CoreKeyboard"
EndSection
Section "Files"
 ModulePath  "/usr/lib/xorg/modules"
 FontPath   "/usr/share/fonts/X11/misc"
 FontPath   "/usr/share/fonts/X11/cyrillic"
 FontPath   "/usr/share/fonts/X11/100dpi/:unscaled"
 FontPath   "/usr/share/fonts/X11/75dpi/:unscaled"
 FontPath   "/usr/share/fonts/X11/Type1"
 FontPath   "/usr/share/fonts/X11/100dpi"
 FontPath   "/usr/share/fonts/X11/75dpi"
 FontPath   "built-ins"
EndSection
Section "Module"
 Load "glx"
EndSection
Section "InputDevice"
 Identifier "Keyboard0"
 Driver   "kbd"
EndSection
Section "InputDevice"
 Identifier "Mouse0"
 Driver   "mouse"
 Option   "Protocol" "auto"
 Option   "Device" "/dev/input/mice"
 Option   "ZAxisMapping" "4 5 6 7"
EndSection
Section "Monitor"
 Identifier  "Monitor0"
 VendorName  "Monitor Vendor"
 ModelName  "Monitor Model"
EndSection
Section "Device"
    ### Available Driver options are:-
    ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
    ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
    ### <percent>: "<f>%"
    ### [arg]: arg optional
    #Option   "Accel"        # [<bool>]
    #Option   "AccelMethod"     # <str>
    #Option   "Backlight"      # <str>
    #Option   "CustomEDID"     # <str>
    #Option   "DRI"         # <str>
    #Option   "Prese

將此文件復(fù)制至 /usr/share/X11/xorg.conf.d/xorg.conf

這個文件保證在主機(jī)上插有顯示器的時候,系統(tǒng)界面能在顯示器上正常顯示。下面我們再給系統(tǒng)添加一個虛擬顯示器,當(dāng)主機(jī)沒有顯示器的時候系統(tǒng)就使用這個虛擬顯示器。

安裝虛擬顯卡驅(qū)動

sudo apt install xserver-xorg-video-dummy

在這個文件的最后添加下面的內(nèi)容

Section "Monitor"
 Identifier "Monitor1"
 HorizSync  1.0 - 2000.0
 VertRefresh 1.0 - 200.0
 # Add 16:9 modes, others are automatically detected.
 Modeline "1280x720" 74.48 1280 1336 1472 1664 720 721 724 746
 Modeline "1920x1080" 172.80 1920 2040 2248 2576 1080 1081 1084 1118
EndSection

Section "Device"
 Identifier "Card1"
 Driver "dummy"
 VideoRam 256000
EndSection
Section "Screen"
 DefaultDepth 24
 Identifier "Screen1"
 Device "Card1"
 Monitor "Monitor1"
 SubSection "Display"
  Depth 24
  Modes "1920x1080"
 EndSubSection
EndSection

這樣我們就創(chuàng)建了一個使用虛擬顯卡的虛擬顯示器。為了讓虛擬的顯示器和真實顯示器都能工作,我們需要把最上面的ServerLayout 進(jìn)行更改

Section "ServerLayout"
    Identifier   "X.org Configured"
    Screen   0 "Screen0" 0 0
 Screen   1 "Screen1" 0 0
EndSection

現(xiàn)在重新啟動遠(yuǎn)程電腦,就可以在沒有顯示器的情況下遠(yuǎn)程了。

以上的方法還有一個問題。就是在用戶沒有登錄的其情況下是沒辦法遠(yuǎn)程的。所以需要把用戶設(shè)置成自動登錄。

到此這篇關(guān)于Ubuntu20.04 VNC 安裝與設(shè)置實現(xiàn)的文章就介紹到這了,更多相關(guān)Ubuntu20.04 VNC 安裝與設(shè)置內(nèi)容請搜索本站以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持本站!

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非maisonbaluchon.cn所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場,如有內(nèi)容涉嫌侵權(quán),請聯(lián)系alex-e#qq.com處理。

實時開通

自選配置、實時開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對1客戶咨詢顧問

在線
客服

在線客服:7*24小時在線

客服
熱線

400-630-3752
7*24小時客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部