"我的NVIDIA开发者之旅” | 征文活动进行中.......

首先是因为小编是没有显示器用,想着用vnc操作图形界面,使用了nvidia自带的vnc远程方法是无效的在没显示器的情况下(有显示器的环境可以),所以不适合随时随地开发,先附上nvidai的操作方法共享一下黑屏。

  README-vncLinux for TegraConfiguring VNC from the command-line
=======================================================================A VNC server allows access to the graphical display of a Linux for Tegra system
over the network. This allows you to work physically remote from the Linux for
Tegra system, and avoids the need to connect an HDMI display, USB keyboard, or
mouse.All commands specified below should be executed from a terminal on the Linux
for Tegra system. This could be a serial port, an SSH session, or a graphical
terminal application running on the HDMI display.----------------------------------------------------------------------
Installing the VNC Server
----------------------------------------------------------------------It is expected that the VNC server software is pre-installed. Execute the
following commands to ensure that it is:sudo apt update
sudo apt install vino----------------------------------------------------------------------
Enabling the VNC Server
----------------------------------------------------------------------Execute the following commands to enable the VNC server:# Enable the VNC server to start each time you log in
mkdir -p ~/.config/autostart
cp /usr/share/applications/vino-server.desktop ~/.config/autostart# Configure the VNC server
gsettings set org.gnome.Vino prompt-enabled false
gsettings set org.gnome.Vino require-encryption false# Set a password to access the VNC server
# Replace thepassword with your desired password
gsettings set org.gnome.Vino authentication-methods "['vnc']"
gsettings set org.gnome.Vino vnc-password $(echo -n 'thepassword'|base64)# Reboot the system so that the settings take effect
sudo rebootThe VNC server is only available after you have logged in to Jetson locally. If
you wish VNC to be available automatically, use the system settings application
to enable automatic login.----------------------------------------------------------------------
Connecting to the VNC server
----------------------------------------------------------------------Use any standard VNC client application to connect to the VNC server that is
running on Linux for Tegra. Popular examples for Linux are gvncviewer and
remmina. Use your own favorite client for Windows or MacOS.To connect, you will need to know the IP address of the Linux for Tegra system.
Execute the following command to determine the IP address:ifconfigSearch the output for the text "inet addr:" followed by a sequence of four
numbers, for the relevant network interface (e.g. eth0 for wired Ethernet,
wlan0 for WiFi, or l4tbr0 for the USB device mode Ethernet connection).----------------------------------------------------------------------
Setting the Desktop Resolution
----------------------------------------------------------------------The desktop resolution is typically determined by the capabilities of the
display that is attached to Jetson. If no display is attached, a default
resolution of 640x480 is selected. To use a different resolution, edit
/etc/X11/xorg.conf and append the following lines:Section "Screen"Identifier    "Default Screen"Monitor       "Configured Monitor"Device        "Tegra0"SubSection "Display"Depth    24Virtual 1280 800 # Modify the resolution by editing these valuesEndSubSection
EndSection

VNC,为一种使用RFB协议的屏幕画面分享及远程操作软件。此软件借由网络,可发送键盘与鼠标的动作及即时的屏幕画面。VNC与操作系统无关,因此可跨平台使用,例如可用Windows连线到某Linux的电脑,反之亦同。甚至在没有安装客户端程序的电脑中,只要有支持JAVA的浏览器,也可使用。-- 维基百科

vncserver
此服务程序必须在在主(或遥控)计算机上运行。你只能作为使用者(不需要根用户身份)使用此项服务。
vncviewer
本地应用程序,用于远程接入运行vncserver的计算机并显示其环境。你需要知道远程计算机的IP地址和vncserver设定的密码。
vncpasswd
vncserver的密码设置工具。vncserver服务程序没有设置密码将不能运行(好习惯)。如果你没有设置,运行vncserver时它会提示你输入一个密码。所以,一般我不会单独运行这个命令来设置密码。
vncconnect
告诉vncserver连接到远程一个运行vncviewer的计算机的IP和端口号。这样我就可以避免给其他人一个接入的密码

测试了好几个不同版本的vnc找到了几款款能显示的。

方法一:

安装方式也非常简单,此处默认系统已经安装了vncserver,如果没有安装,使用如下命令进行安装:

sudo apt-get install vnc4server

然后安装xfce

sudo apt-get install xfce4

可以使用如下命令,查看是否安装成功:

ps -A | grep xfce4

修改配置文件xstartup为:

#!/bin/sh# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrcdbus-launch startxfce4[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
x-window-manager &
xrdb $HOME/.Xresources

然后重新生成52号桌面即可

vncserver -kill :52
vncserver -geometry 1920x1080 :52

报错问题

Unable to connect to VNC Server using your chosen security
setting. Either upgrade VNC Server to a more recent ersion from RealVNC, or select a weaker level of encryption.

终端输入如下命令即可解决

gsettings set org.gnome.Vino require-encryption false

在一开始配置的时候我遇到了一个字体缺失的问题,就是在log文件里找到的

apt-get  install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic

还有一个方法也将就能用:

方法二:

sudo apt install tigervnc-standalone-server

为 VNC 设置密码。 您不需要仅查看密码。

vncpasswd

Change to the ~/.vnc directory and create your xstartup file:

cd ~/.vnc
sudo vi xstartup

将以下内容添加到您的 xstartup 文件中,其中您的主目录名称是:

#!/bin/sh
export XDG_RUNTIME_DIR=/run/user/1000
export XKL_XMODMAP_DISABLE=1
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
xrdb /home/.Xresources
xsetroot -solid grey
gnome-session &
startlxde &

使 xstartup 文件可执行:

$ sudo chmod 755 ~/.vnc/xstartup

检查您的主目录是否存在 .Xresources 文件:如果 .Xresources 文件不存在,则创建它

 ls -al /home/.Xresources
touch /home//.Xresources

将 VNC 设置为自动启动。 切换到正确的 systemd 目录:

cd /etc/systemd/system Create a file called vncserver@.service (yes, that @ symbol is required)
sudo vi vncserver@.service

将以下文本添加到文件中,更改用户、组和主目录以反映您的安装。 将 ExecStart 行中的显示器分辨率更改为您喜欢的分辨率( 1080P 分辨率的示例,为方便起见已将其注释掉)。

不要忘记用您的实际远程用户用户名替换nvidia。保存文件并在完成后退出

nvidia@nvidia-desktop:/etc/systemd/system$ sudo cat vncserver@.service
[Unit]Description=Start TightVNC server at startupAfter=syslog.target network.target[Service]Type=forkingUser=nvidiaGroup=nvidiaWorkingDirectory=/home/nvidiaPIDFile=/home/nvidia/.vnc/%H:%i.pidExecStartPre=-/usr/bin/vncserver -kill :%i > /dev/null 2>&1ExecStart=/usr/bin/vncserver -depth 24 -geometry 1280x800 :%iExecStop=/usr/bin/vncserver -kill :%i[Install]WantedBy=multi-user.target

检查 /etc/vnc.conf 并确保不仅从本地主机启用 VNC 服务器访问:

$ sudo vi /etc/vnc.conf

在 vnc.conf 文件中,确保取消注释以下行:

$localhost = “no”;

使用 GDM3 配置自动登录(如果尚未配置,则您创建了 vi 安装:

$ sudo vi /etc/gdm3/custom.conf

在 custom.conf 文件中,取消注释或添加以下行:

AutomaticLoginEnable=true
AutomaticLogin= nvidia

通过运行以下两个命令添加 vnc 以在重新启动时启动。 一个重新启动守护进程,另一个创建指向您之前创建的 vncserver@.service 的符号链接。

sudo systemctl daemon-reload
sudo systemctl enable vncserver@1
Created symlink /etc/systemd/system/multi-user.target.wants/vncserver@1.service → /etc/systemd/system/vncserver@.service.

测试 VNC 服务是否启动并在重新启动前查看其状态

sudo systemctl start vncserver@1 sudo systemctl enable vncserver@1

检查此处显示的任何错误。

报错的话会显示如下,你的配置文件有问题

sudo systemctl start vncserver@1
Job for vncserver@1.service failed because the control process exited with error code.
See "systemctl status vncserver@1.service" and "journalctl -xe" for details.
nvidia@nvidia-desktop:/etc/systemd/system$ sudo systemctl daemon-reload
nvidia@nvidia-desktop:/etc/systemd/system$ sudo systemctl enable vncserver@1
nvidia@nvidia-desktop:/etc/systemd/system$ sudo systemctl start vncserver@1
Job for vncserver@1.service failed because the control process exited with error code.
See "systemctl status vncserver@1.service" and "journalctl -xe" for details.
nvidia@nvidia-desktop:/etc/systemd/system$ systemctl status vncserver@1.service
● vncserver@1.service - Start TigerVNC Server at startupLoaded: loaded (/etc/systemd/system/vncserver@.service; indirect; vendor preset: enabled)Active: failed (Result: exit-code) since Wed 2022-06-15 17:28:43 CST; 13s agoProcess: 9629 ExecStartPre=/usr/bin/vncserver -kill :1 > /dev/null 2>&1 (code=exited, status=1/FAILURE)Jun 15 17:28:42 nvidia-desktop systemd[1]: Starting Start TigerVNC Server at startup...
Jun 15 17:28:43 nvidia-desktop vncserver[9629]: vncserver: The HOME environment variable is not set.
Jun 15 17:28:43 nvidia-desktop systemd[1]: vncserver@1.service: Control process exited, code=exited status=1
Jun 15 17:28:43 nvidia-desktop systemd[1]: vncserver@1.service: Failed with result 'exit-code'.
Jun 15 17:28:43 nvidia-desktop systemd[1]: Failed to start Start TigerVNC Server at startup.

不过按照我的配置文件写完那就基本没啥事!替你们实验过了。

重新启动设备不启动也没啥我觉得。 您现在应该能够使用如下所示的连接字符串通过 VNC 客户端连接到 Jetson:192.168.8.666:在这里,我的 Jetson具有 IP 地址 192.168.8.666 并连接到 VNC 的 实例。 如果无法连接,请通过 SSH 登录 Nano 并开始故障排除: 检查 VNC 进程是否实际正在运行:

ps -ax |grep vnc
10832 ?        Sl     1:51 /usr/bin/Xtigervnc :1 -desktop nvidia-desktop:1 (nvidia) -auth /home/nvidia/.Xauthority -geometry 1280x800 -depth 24 -rfbwait 30000 -rfbauth /home/nvidia/.vn /passwd -rfbport 5901 -pn -SecurityTypes VncAuth,TLSVnc
11223 pts/0    S+     0:00 systemctl status vncserver@1
17118 pts/3    S+     0:00 grep --color=auto vnc

检查 VNC 服务器是否正在侦听所有端口,这些端口由 0.0.0.0 IP 地址指定,端口 5901 处于活动状态。 它应该看起来像这样:

nvidia@nvidia-desktop:/etc/systemd/system$ netstat -pantl | grep LISTEN
(Not all processes could be identified, non-owned process infowill not be shown, you would have to be root to see it all.)
tcp        0      0 127.0.0.1:6010          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:6011          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:2947          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:34983         0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:5900            0.0.0.0:*               LISTEN      10965/vino-server
tcp        0      0 0.0.0.0:5901            0.0.0.0:*               LISTEN      10832/Xtigervnc
tcp        0      0 0.0.0.0:111             0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -
tcp6       0      0 ::1:6010                :::*                    LISTEN      -
tcp6       0      0 ::1:6011                :::*                    LISTEN      -
tcp6       0      0 :::3389                 :::*                    LISTEN      -
tcp6       0      0 :::9090                 :::*                    LISTEN      -
tcp6       0      0 ::1:2947                :::*                    LISTEN      -
tcp6       0      0 :::5900                 :::*                    LISTEN      10965/vino-server
tcp6       0      0 :::5901                 :::*                    LISTEN      10832/Xtigervnc
tcp6       0      0 :::111                  :::*                    LISTEN      -
tcp6       0      0 :::7890                 :::*                    LISTEN      -
tcp6       0      0 :::22                   :::*                    LISTEN      -
tcp6       0      0 ::1:3350                :::*                    LISTEN      -
tcp6       0      0 ::1:631                 :::*                    LISTEN      -

检查 TigerVNC 为任何特定错误写入的实际日志文件。 成功的操作将类似于下面的日志文件:

nvidia@nvidia-desktop:/etc/systemd/system$ cat ~/.vnc/nvidia-desktop:1.log
15/06/22 17:20:50 Xvnc version TightVNC-1.3.10
15/06/22 17:20:50 Copyright (C) 2000-2009 TightVNC Group
15/06/22 17:20:50 Copyright (C) 1999 AT&T Laboratories Cambridge
15/06/22 17:20:50 All Rights Reserved.
15/06/22 17:20:50 See http://www.tightvnc.com/ for information on TightVNC
15/06/22 17:20:50 Desktop name 'X' (nvidia-desktop:1)
15/06/22 17:20:50 Protocol versions supported: 3.3, 3.7, 3.8, 3.7t, 3.8t
15/06/22 17:20:50 Listening for VNC connections on TCP port 5901
No VNC extension on display :1
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Xlib:  extension "GLX" missing on display ":1".
Killing Xtigervnc process ID 6828... success!Xvnc TigerVNC 1.7.0 - built Dec  5 2017 09:25:01
Copyright (C) 1999-2016 TigerVNC Team and many others (see README.txt)
See http://www.tigervnc.org for information on TigerVNC.
Underlying X server release 11905000, The X.Org FoundationWed Jun 15 18:00:36 2022vncext:      VNC extension running!vncext:      Listening for VNC connections on all interface(s), port 5901vncext:      created VNC server for screen 0
Unable to create /home/nvidia/.dbus/session-bus
** Message: 18:00:37.825: main.vala:102: Session is LXDE
** Message: 18:00:37.826: main.vala:103: DE is LXDE
** Message: 18:00:37.905: main.vala:134: log directory: /home/nvidia/.cache/lxsession/LXDE
** Message: 18:00:37.905: main.vala:135: log path: /home/nvidia/.cache/lxsession/LXDE/run.log

当然还有一个方法

那就叫方法三把

安装xrdp
Xrdp是一个开源工具,允许用户通过Windows RDP访问Linux远程桌面。 除了Windows RDP之外,xrdp工具还接受来自其他RDP客户端的连接,如FreeRDP,rdesktop和NeutrinoRDP。 Xrdp现在支持TLS安全层。

sudo apt-get install xrdp

windows自带的 mstsc

分辨率设置命令

xrandr --fb 1920x1080

至此,您已经在Ubuntu 18.04的Jetson成功安装并配置VNC服务器了。

这些方法包还有几种未写的方法小编都尝试过了,虽然有些效果不是很好但是在忘带显示器的情况下也是不错的选择了。

我的NVIDIA开发者之旅-Jetson在没有显示器的状态下使用Vnc操控GUI界面开发的三种实用技巧相关推荐

  1. 我的NVIDIA开发者之旅-Jetson Nano 2gb教你怎么训练模型(完整的模型训练套路)

    我的NVIDIA开发者之旅" | 征文活动进行中....... 模型的保存和加载 pytorch的安装方法这里就不写了,之前的文章有记录,nvidia官网的资料已经很详细了附上连接(注意你的 ...

  2. 我的NVIDIA开发者之旅——作为一名初学者,我是如何开启 NVIDIA Jetson Nano 开发的

    "我的NVIDIA开发者之旅" | 征文活动进行中- ⭐️ 作者:前端修罗场 ⭐️ 本文名称:我的NVIDIA开发者之旅--作为一名初学者,我是如何开启 NVIDIA Jetson ...

  3. 我的NVIDIA开发者之旅——利用NVIDIA TAO工具包3.0和Deepstream快速搭建车辆信息识别系统

    利用NVIDIA TAO工具包3.0和Deepstream快速搭建车辆信息识别系统 实现目标 部署工具:NVIDIA DeepStream SDK 简单设置参数 工作流程 注意事项 GPU深度学习推理 ...

  4. 我的NVIDIA开发者之旅——NVIDIA云原生技术

    NVIDIA云原生技术:耐心看完受益匪浅 第一篇->NVIDIA云原生技术 [1]NVIDIA容器工具包 [2]GPU操作员 [3]带GPU的Kubernetes [3.1]安装Kubernet ...

  5. 我的NVIDIA开发者之旅--从CUDA种草AI梦

    我的NVIDIA开发者之旅" | 征文活动进行中....... 一.什么是CUDA? CUDA(Compute Unified Device Architecture),是显卡厂商NVIDI ...

  6. NVIDIA英伟达jetson xavier nx核心板模块如何组装散热组件

    NVIDIA英伟达jetson xavier nx核心板模块 XAVIER 的性能.NANO 的大小. Jetson Xavier NX 只有 70 毫米 x 45 毫米,可以将 NVIDIA Xav ...

  7. 音视频开发之旅(一)三种方式绘制图片

    在android开发中我们最常使用的绘制图片的方式就是ImageView,设置src.那么有没有其他方案可以实现图片的绘制呐? 三种方案 通过Imageview设置setImageBitmap fin ...

  8. 笔记本电脑远程控制jetson nano/nx桌面的三种方法

    jetson nano/nx实现远程桌面控制 一.向日葵远程控制 二.VNC Viewer远程连接 三.Window10的远程桌面连接 带Jetson nano/nx外出调试,还得配上显示器.键盘鼠标 ...

  9. CUDA是Nvidia开发的一种并行计算平台和编程模型,用于在其自己的GPU(图形处理单元)上进行常规计算

    https://baike.baidu.com/item/CUDA/1186262?fr=aladdin CUDA是Nvidia开发的一种并行计算平台和编程模型,用于在其自己的GPU(图形处理单元)上 ...

最新文章

  1. CVPR2021深度框架训练:不是所有数据增强都可以提升最终精度
  2. 安装hbas_非常详细的HBase的安装与配置
  3. Win32 多线程学习总结
  4. Python每日一练(1):计算文件夹内各个文章中出现次数最多的单词
  5. python调用数据库数据类型_Python使用Mysql官方驱动(取出dict类型的数据)
  6. 蛋糕是叫胚子还是坯子_教你做巧克力淋面蛋糕,掌握这个配比,好看又好吃,10分钟做一个...
  7. 自己动手清除电脑中的***程序
  8. 【Flink】FLink 反序列化空指针 java.lang.String.<init> SimpleStringSchema
  9. Midi 乐器set
  10. java中div的用法,Java Math floorDiv()用法及代码示例
  11. 论文阅读笔记(十一)——Mobilenet-SSDv2: An Improved Object Detection Model for Embedded Systems
  12. 小甲鱼Python第二十八讲(文件)
  13. 十、基于FPGA的PCIE协议介绍(二)
  14. html打开ppt自动播放,PPT怎么自动播放
  15. 【书影观后感 四】《围城》十年
  16. 为知笔记保存为html,为知笔记 | 如何保存微信内容到为知笔记?
  17. 管理分区表:拆分、添加与交换分区
  18. Android中相册的实现
  19. 银河战舰的最后一门重炮──C罗
  20. 网页中嵌入QQ和邮箱

热门文章

  1. 如何让checkbox复选框只能单选
  2. 网络最重要的学习工具--网络模拟器GNS3、EVE-NG
  3. CSS3(盒子模型、ps基本操作)
  4. excel填充空格技巧
  5. 工业机器人中使用了哪些传感器?
  6. Revit二次开发高级应用(1)——利用wcf做简单的族库管理
  7. BIM家装族库丨柜子族
  8. Win10我的电脑怎么放到桌面
  9. 台达DVP系列PLC与台达DTA温控器modbus通讯
  10. 常见的无参考图像质量评价指标汇总