Ubuntu 安装 VNC

Ubuntu 安装 VNC

realvnc

前往

https://www.realvnc.com/en/connect/download/vnc/

下载并启动

VNC Server

并完成配置

x11vnc(备选方案)

安装

sudo apt-get install x11vnc
sudo x11vnc -storepasswd /etc/x11vnc.pass

设置密码

自启动

sudo vim /etc/systemd/system/x11vnc.service

输入

[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

运行

sudo systemctl enable x11vnc
sudo service x11vnc start
sudo Xorg :1 -configure
sudo cp /root/xorg.conf.new /usr/share/X11/xorg.conf.d/xorg.conf
sudo apt install xserver-xorg-video-dummy
sudo vim /usr/share/X11/xorg.conf.d/xorg.conf

在最后添加

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

并将开头修改为

Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection
->
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        Screen      1  "Screen1" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

尽情享用吧~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值