本文共分五个部分,分别是配置云服务器安全组放开所有端口、为云服务器安装虚拟桌面、为云服务器安装vnc_server、为本地电脑安装vnc_client、分析vnc交互报文。

首先更新系统

sudo apt update
sudo apt upgrade

一、配置云服务器安全组放开所有端口

【腾讯云】登录官网->【控制台】->【我的资源】->【云服务器】->【网络与安全】->【安全组】

【安全组】->【修改云服务器绑定的规则】

【添加规则】

【添加入站规则】

类型:自定义

来源:0.0.0.0/0,表示所有IPv4源地址

协议端口:ALL,表示所有端口

策略:允许

【完成】

二、为云服务器安装虚拟桌面

安装轻量级桌面环境Xfce

安装Xfce过程中会提示配置“lightdm”,选择“gdm3”即可

sudo apt install xfce4 xfce4-goodies xorg dbus-x11 x11-xserver-utils

三、为云服务器安装vnc_server

本次选择“TigerVNC”作为vnc_server

sudo apt install tigervnc-standalone-server tigervnc-common

安装TigerVNC完成,配置vnc访问密码,注意最下方选择n,选择y则vnc_client拨入后仅能观看,无法操作。

ubuntu@VM-0-8-ubuntu:/etc$ vncpasswd
Password:
Verify:
Would you like to enter a view-only password (y/n)? n

配置TigerVNC(远程软件)关联Xfce(桌面环境)

#首先find找到.vnc的路径
root@VM-0-8-ubuntu:~# find / -name .vnc
/root/.vnc
/home/ubuntu/.vnc
root@VM-0-8-ubuntu:~# #其次切换工作目录
root@VM-0-8-ubuntu:/# cd /root/.vnc/#之后touch新建一个文件,文件名xstartup
root@VM-0-8-ubuntu:~/.vnc# touch xstartup#修改新建的xstartup
root@VM-0-8-ubuntu:~/.vnc# vim xstartup #增加以下内容,保存并关闭文件。这样每次启动TigerVNC_server时,以下命令均会自动执行。
#!/bin/sh
unset SESSION_MANAGER
unset DBUS_SESSION_BUS_ADDRESS
exec startxfce4#给xstartup授权
root@VM-0-8-ubuntu:~/.vnc# chmod 777 xstartup
root@VM-0-8-ubuntu:~/.vnc# ls -l
-rw-r--r-- 1 root root 1782 Oct 15 22:41 localhost.localdomain:1.log
-rw-r--r-- 1 root root    7 Oct 15 22:41 localhost.localdomain:1.pid
-rw-r--r-- 1 root root 1091 Oct 15 22:44 localhost.localdomain:2.log
-rw-r--r-- 1 root root    7 Oct 15 22:44 localhost.localdomain:2.pid
-rw-r--r-- 1 root root 1117 Oct 15 22:48 localhost.localdomain:3.log
-rw-r--r-- 1 root root    7 Oct 15 22:48 localhost.localdomain:3.pid
-rw------- 1 root root    8 Oct 15 22:33 passwd
-rwxrwxrwx 1 root root   79 Oct 15 23:02 xstartup

启动TigerVNC_server

注意下方的localhost.localdomain:2,则vnc_client连接此vnc_server时候,所用端口号为5900+2=5902,即vnc_sever启动时候加载的是端口号x,则vnc_client连接该vnc_server时所有端口号就是5900+x。

root@VM-0-8-ubuntu:~/.vnc# vncserver
New 'localhost.localdomain:2 (root)' desktop at :2 on machine localhost.localdomain
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:2.log
Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :2 to connect to the VNC server.
root@VM-0-8-ubuntu:~/.vnc# #配置某些参数的启动
#-geometry 1920x1080,设定远程桌面分辨率
root@VM-0-8-ubuntu:~/.vnc# vncserver -localhost no -geometry 1920x1080 -depth 24
New 'localhost.localdomain:1 (root)' desktop at :1 on machine localhost.localdomain
Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/localhost.localdomain:1.log
Use xtigervncviewer -SecurityTypes VncAuth,TLSVnc -passwd /root/.vnc/passwd localhost.localdomain:1 to connect to the VNC server.

常用TigerVNC_server命令

#查看当前存在几个vnc_server进程及各占用哪个端口号
root@VM-0-8-ubuntu:~/.vnc# vncserver -list
TigerVNC server sessions:
X DISPLAY #     RFB PORT #      PROCESS ID
:1              5901            158188
:2              5902            166676
:5              5905            157490#杀掉vnc_server进程
root@VM-0-8-ubuntu:~/.vnc# vncserver -kill :2
Killing Xtigervnc process ID 166676... success!
root@VM-0-8-ubuntu:~/.vnc# vncserver -kill :5
Killing Xtigervnc process ID 157490... success!#查看当前存在几个vnc_server进程及各占用哪个端口号
root@VM-0-8-ubuntu:~/.vnc# vncserver -list
TigerVNC server sessions:
X DISPLAY #     RFB PORT #      PROCESS ID
:1              5901            158188
root@VM-0-8-ubuntu:~/.vnc# 

执行vncserver报错

#报错
root@VM-0-8-ubuntu:/# vncserver
/usr/bin/xauth:  file /root/.Xauthority does not exist
New 'localhost.localdomain:1 (root)' desktop at :1 on machine localhost.localdomain
Starting applications specified in /etc/X11/Xvnc-session
Log file is /root/.vnc/localhost.localdomain:1.log
Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :1 to connect to the VNC server.
vncserver: Failed command '/etc/X11/Xvnc-session': 256!
=================== tail -15 /root/.vnc/localhost.localdomain:1.log ===================
Copyright (C) 1999-2019 TigerVNC Team and many others (see README.rst)
See https://www.tigervnc.org for information on TigerVNC.
Underlying X server release 12008000, The X.Org Foundation
Sat Oct 15 22:33:59 2022vncext:      VNC extension running!vncext:      Listening for VNC connections on local interface(s), port 5901vncext:      created VNC server for screen 0
X connection to :1 broken (explicit kill or server shutdown).
Sat Oct 15 22:34:00 2022ComparingUpdateTracker: 0 pixels in / 0 pixels outComparingUpdateTracker: (1:-nan ratio)
Killing Xtigervnc process ID 152341... which seems to be deadlocked. Using SIGKILL!
=======================================================================================
Starting applications specified in /etc/X11/Xvnc-session has failed.
Maybe try something simple first, e.g.,tigervncserver -xstartup /usr/bin/xterm
root@VM-0-8-ubuntu:/# #执行tigervncserver -xstartup /usr/bin/xterm
New 'localhost.localdomain:1 (root)' desktop at :1 on machine localhost.localdomain
Starting applications specified in /usr/bin/xterm
Log file is /root/.vnc/localhost.localdomain:1.log
Use xtigervncviewer -SecurityTypes VncAuth -passwd /root/.vnc/passwd :1 to connect to the VNC server.

四、为本地电脑安装vnc_client

TightVNC: VNC-Compatible Free Remote Control / Remote Desktop Software

【Download Now!】->【根据本地电脑操作系统选择下载版本】

【下载完成】

【双击安装】->【安装过程中会提示输入密码】

【安装完成】->【在本地电脑桌面看不到】->【在开始菜单/搜索可以找到】->【右键打开】

【键入远程vnc_server的IP和端口号】->【注意格式remoteIP::port】->【connect】

【键入vnc_server密码】->【OK】

【远程桌面登录成功】

五、分析vnc交互报文

【键入远程vnc_server的IP和端口号】->【注意格式remoteIP::port】->【connect】

【键入vnc_server密码】->【OK】

六、感谢

https://wiki.archlinux.org/title/TigerVNC_(%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87)
https://blog.csdn.net/level_code/article/details/125534100
https://www.51cto.com/article/635182.html
https://xie.infoq.cn/article/cf473dc0dea917b0b2a546ecd
https://www.cnblogs.com/liyuanhong/articles/15487147.html
https://blog.csdn.net/shuirenbushijun/article/details/107765654

CLO-为云服务器配置vnc远程桌面相关推荐

  1. Jetson TX2 重装系统(刷机)+后续设置(安装Fcitx、解决拼音候选词不显示、换国内源、局域网实现VNC远程桌面)

    (珍爱生命,远离TX2!!!) 一.Jetson tx2刷机过程及注意事项 二.安装Fcitx+Googlepinyin 三.解决拼音模式下不显示候选词bug 四.Ubuntu18.04换国内源 五. ...

  2. 搭建VNC远程桌面服务

    参考:腾讯云手动实验 https://cloud.tencent.com/developer/labs/lab/10282 都说 Windows 的好处,就是可以运行图形界面程序.其实 Linux 不 ...

  3. Centos8.2安装配置 VNC 远程桌面Xfce、解决输入法VNC无法使用的问题、解决浏览器无法播放视频的问题

    本文使用MobaXterm(Xshell).Xfce.TightVNC来搭建百度智能云Centos8.2.同时解决解决输入法VNC无法使用的问题.解决浏览器无法播放视频的问题. 目录 一.Window ...

  4. macOS 开启 VNC 远程桌面和 SSH 服务

    macOS 开启 VNC 远程桌面和 SSH 服务 准备用 macOS 来做为服务器,既然是服务器,那不可缺少的是远程管理,实际上 macOS 自带 VNC 远程桌面和 SSH 服务,只是默认没有开启 ...

  5. 在VNC远程桌面环境Xfce4中Tab键失效的解决方法

    配置vnc远程桌面环境xfce4见下文 windows vnc 远程登录 ubuntu Linux 系统 在成功登陆xfce4远程桌面环境之后发现在终端中Tab键不能自动补齐.问题的原因是由于Tab键 ...

  6. 快速解决:阿里云ECS实例远程桌面连接 发生身份验证错误。要求的函数不受支持 !

    三步解决问题: 本地PC 远程桌面连接 阿里云ECS实例 失败 ? 报错: "发生身份验证错误.要求的函数不受支持" ? 一.问题截图描述: 二.3步解决问题: 1. 网页版 · ...

  7. vnc远程桌面_手机vnc远程桌面,手机vnc远程桌面,使用配置详解

    手机vnc远程桌面,手机vnc远程桌面除了可以应用于在Windows 操作系统下面可视化地远程Linux操作系统,还可以在安卓操作系统下面可视化地远程连接windows的操作系统,两者都需要在需要被远 ...

  8. 树莓派入门教程 - 0 - 准备篇 - 0.2 树莓派SSH远程登陆,VNC远程桌面

    电脑需要提前安装的工具: SSH.串口 - 终端神器 MobaXterm,官网下载链接:https://mobaxterm.mobatek.net/download.html VNC远程桌面工具 VN ...

  9. 手机vnc远程桌面,手机vnc远程桌面教程,配置详解

    手机vnc远程桌面,手机vnc远程桌面除了可以应用于在Windows 操作系统下面可视化地远程Linux操作系统,还可以在安卓操作系统下面可视化地远程连接windows的操作系统,两者都需要在需要被远 ...

最新文章

  1. python读取excel一列-Python从Excel中读取日期一列的方法
  2. 集群批量管理工具parallel ssh的安装及使用
  3. Android 图文混排 通过webview实现并实现点击图片
  4. 算法精讲:分享一道值得分享的算法题
  5. windows程序消息机制(Winform界面更新有关)
  6. TQ210——TFTP裸板程序下载
  7. airpassengers数据集_12个Pandas amp;amp; Numpy函数:数据分析提速50%不是问题!
  8. 异质图神经网络及其在电商领域中的应用
  9. IDEA和VS code设置默认换行符为LF
  10. 如何学习ReactJS:初学者完整指南
  11. Idea 添加lib文件夹,并添加至项目Libary
  12. delphi调用https
  13. win7安装iis及web配置教程
  14. vue实现 可拖拽的div
  15. 隐匿函数,二分法 冒泡排序
  16. 同构网络vs异构网络
  17. deepin 服务器_深度官方并没有提供Deepin服务器版下载,也没有开发计划
  18. 单道批-多道批-分时-实时
  19. Graph Attention Network (GAT) 的Tensorflow版代码解析
  20. C语言编程编制职工档案管理程序,C语言课程设计--职工档案及简明信息生成.doc...

热门文章

  1. 制作一个月球车底盘【内附资料下载链接】
  2. Android学习——Fragments
  3. MAC M1 安装ViennaRNA Python模块
  4. 2022 余生得而不喜,失而不忧
  5. Verdi 使用教程(持续更新中)
  6. 教妹学Java:什么是 Java?
  7. 项目9——搭建数据库服务器
  8. VI下删除文本中的^M
  9. 计算机中找不到u盘怎么办,电脑无法找到u盘如何解决
  10. 业主委员会如何成立?让捷径智慧物业改变美好生活