一、参考:

centos:
https://blog.csdn.net/hffwj/article/details/124450231
ubuntu:
https://blog.csdn.net/asdssadddd/article/details/132675452
无显示器VNC控制

二、centos系统vnc配置

注:
如果配置的普通用户,则远程连接端和原桌面的显示不一致。若需要与原桌面一致,则需要配置root用户,同时server端也要登陆root用户,在设置中开启屏幕共享,并禁用VNC Server的加密。

yum install dconf
dconf-editor
# 在dconf-editor中,展开->org->desktop->remote-access
# 取消选中require-encryption

三、jetson agx orin vnc配置

3.1 vino

sudo apt install vino
gsettings set org.gnome.Vino prompt-enabled false

gsettings set org.gnome.Vino require-encryption false
cd /usr/share/glib-2.0/schemas

sudo cp org.gnome.Vino.gschema.xml org.gnome.Vino.gschema.xml.old

sudo vi org.gnome.Vino.gschema.xml 

添加:

<key name='enabled' type='b'>
      <summary>Enable remote access to the desktop</summary>
      <description>
              If true, allows remote access to the desktip via the RFB
              protocol. Users on remote machines may then connect to the
              desktop using a VNC viewer.
      </description>
      <default>false</default>
    </key>
sudo glib-compile-schemas /usr/share/glib-2.0/schemas
/usr/lib/vino/vino-server

3.2 tigervnc

sudo apt install tigervnc-standalone-server
# 不要使用sudo执行vncpasswd
vncpasswd
sudo nano ~/.vnc/xstartup
#!/bin/sh

unset SESSION_MANAGER

unset DBUS_SESSION_BUS_ADDRESS

exec startxfce4

chmod u+x ~/.vnc/xstartup
vncserver
vncserver -list
vncserver -kill :1
vncserver -localhost no -geometry 1280x720 -depth 24

四、共享文件配置

4.1安装samba

sudo apt update
sudo apt install samba

4.2创建共享文件夹

sudo mkdir /home/shared
sudo chmod 777 /home/shared

4.3编辑samba配置文件

sudo nano /etc/samba/smb.conf

[shared]
path = /home/shared
writable = no  # 设置为不可写
guest ok = yes
guest only = yes
create mask = 0555  # 设置文件的默认权限为只读
directory mask = 0555  # 设置目录的默认权限为只读
# 在复制时,删除注释,否则会报错

4.4重启samba服务

sudo service smbd restart

五、 无显示器VNC控制

5.1安装并配置虚拟桌面

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

cd /usr/share/X11/xorg.conf.d
sudo gedit xorg.conf
Section "Device"
    Identifier "DummyDevice"
    Driver "dummy"
    VideoRam 256000
EndSection
 
Section "Screen"
    Identifier "DummyScreen"
    Device "DummyDevice"
    Monitor "DummyMonitor"
    DefaultDepth 24
    SubSection "Display"
        Depth 24
        Modes "1920x1080_60.0"
    EndSubSection
EndSection
 
Section "Monitor"
    Identifier "DummyMonitor"
    HorizSync 30-70
    VertRefresh 50-75
    ModeLine "1920x1080" 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +Hsync +Vsync
EndSection
sudo reboot
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐