ubuntu 16.04 tightvncserver VNC 安装配置,安装xrdp,x11vnc、Ubuntu 18.04
2023-09-14 09:09:52 时间
ubuntu 安装 VNC
1,ubuntu 安装 VNC
- ubuntu系统版本
# cat /etc/issue
Ubuntu 16.04 LTS \n \l
- tightvncserver安装
# apt-cache search tightvncserver
tightvncserver - virtual network computing server software
tightvnc-java - TightVNC java applet and command line program
# apt-get install -y tightvnserver
# apt-get install -y xfce4 xfce4-goodies
2,VNC配置
- VNC设置密码
# vncserver
You will require a password to access your desktops.
Password:
- 选择N
Would you like to enter a view-only password (y/n)? n
- 关闭VNC服务
# ps aux | grep vnc
root 14031 0.0 0.3 14904 6448 ? S 12月12 0:00 Xtightvnc :1
root 16565 0.0 0.2 8164 4952 ? S 12月12 0:00 Xtightvnc :2
# vncserver -kill :1
Killing Xtightvnc process ID 14031
# vncserver -kill :2
Killing Xtightvnc process ID 16565
- 修改VNC配置文件添加
startxfce4 &
# vim .vnc/xstartup
#!/bin/sh
#/etc/X11/Xresources/x11-common
xrdb $HOME/.Xresources
startxfce4 &
- 运行VNC
# vncserver
New 'X' desktop is ubuntu:1
3,macOS VNC Viewer 安装
- VNC连接
- 连接成功,但不是实时画面
4,安装xrdp
# apt-get install -y xrdp
# apt-cache search vnc4server
vnc4server - Virtual network computing server software
# apt-get install -y vnc4server
# /etc/init.d/xrdp restart
[ ok ] Restarting xrdp (via systemctl): xrdp.service.
5,macOS 使用Microsoft Remote Desktop 连接ubuntu
- Microsoft Remote Desktop百度网盘地址
链接:https://pan.baidu.com/s/1pUrgIL1i8MC1Ax2cL_1BcQ 密码:5lib
- 连接成功 没有背景
# apt-get install -y xubuntu-desktop
# reboot
# pwd
/root
# touch .xsession
# chmod 775 .xsession
# echo xfce4-session > .xsession
# cat .xsession
xfce4-session
# vim /etc/xrdp/startwm.sh
#!/bin/sh
if [ -r /etc/default/locale ]; then
. /etc/default/locale
export LANG LANGUAGE
fi
xfce4-session
. /etc/X11/Xsession
# /etc/init.d/xrdp restart
[ ok ] Restarting xrdp (via systemctl): xrdp.service.
6,安装teamviewer实时控制桌面
# apt-cache search teamviewer
teamviewer - Remote control and meeting solution
# apt-get install -y teamviewer
7,x11vnc 安装,实时远程桌面
- 安装 x11vnc
# apt-cache search x11vnc
# apt-get install -y x11vnc
# x11vnc -storepasswd
# cd /lib//systemd/system
# touch x11vnc.service
# chmod 775 x11vnc.service
# vim /lib/systemd/system/x11vnc.service
[Unit]
Description=Start x11vnc at startup.
After=multi-user.target
[Service]
Type=simple
ExecStart=/usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /root/.vnc/passwd -rfbport 5901 -shared
[Install]
WantedBy=multi-user.target
- 运行 x11vnc
# systemctl daemon-reload
# systemctl start x11vnc.service
# systemctl status x11vnc.service
# systemctl enable x11vnc.service
- x11vnc 运行报错
# x11vnc
XOpenDisplay("") failed.
- 更新软件和系统
# apt-get update && apt-get upgrade && apt-get dist-upgrade
- 升级gnome
# apt-get install -y gnome-shell ubuntu-gnome-desktop
# gnome-shell --version
GNOME Shell 3.18.5
- 在本机运行x11vnc,使用其它主机ssh远程访问运行x11vnc会报错
XOpenDisplay("") failed.
- 使用vnc viewer 连接 X11vnc
# systemctl status x11vnc
● x11vnc.service - Start x11vnc at startup.
Loaded: loaded (/lib/systemd/system/x11vnc.service; enabled; vendor preset: enabled)
Active: active (running) since 日 2018-12-16 11:44:45 CST; 1min 28s ago
Main PID: 5244 (x11vnc)
CGroup: /system.slice/x11vnc.service
├─5244 /usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /root/.vnc/passwd -rfbport 5901 -shared
└─5249 /usr/bin/x11vnc -auth guess -forever -loop -noxdamage -repeat -rfbauth /root/.vnc/passwd -rfbport 5901 -shared
-
使用 frp + x11vnc 替代 teamviewer
-
frp 安装
内网穿透 frp,ssh远程访问内网 -
修改frpc.ini 转发5901端口到VPS服务器
# vim frpc.ini
[x11vnc]
type = tcp
local_ip = 127.0.0.1
local_port = 5901
remote_port = 5901
- 远程连接X11vnc ,服务器ip:5901
问题:有2个画面,分辨率不对
- 设置ubuntu分辨率,关闭unknow display
8,Ubuntu 18.04安装 x11vnc
- 测试x11vnc
# x11vnc
The VNC desktop is: R:0
PORT=5900
- x11vnc 使用密码连接
# x11vnc -storepasswd
# x11vnc -rfbauth /root/.vnc/passwd
# x11vnc -forever -loop -noxdamage -repeat -rfbauth /root/.vnc/passwd -rfbport 5900 -shared -o /var/log/x11vnc.log
- 使用服务器代理端口5900
[common]
server_addr = 服务器IP地址
server_port = 7000
[x11vnc]
type = tcp
local_ip = 127.0.0.1
local_port = 5900
remote_port = 5900
参考:
相关文章
- Ubuntu下安装yum和配置yum源
- TomCat安装和配置
- Windows 系统 PostgreSQL 手工安装配置方法
- Ubuntu 14.04 安装 Composer+Laravel 配置
- linux搭建apache_plsql安装教程及配置
- 【Linux 内核】编译 Linux 内核 ⑥ ( 安装 OpenSSL | 安装其它依赖库 | 内核编译完成 )
- centos 安装Rclone并配置onedrive做本地存储
- Ubuntu系统下mongodb安装配置详细步骤
- Redis 5.05 单独模式安装及配置方法
- Ubuntu 12.04 安装配置 Apache2详解程序员
- Ubuntu 14.04安装配置NFS服务器详解程序员
- 展现技术自由:简单快捷的在线Linux安装(在线安装linux系统)
- 如何在Ubuntu 18.04 LTS上安装和配置Mantis Bug Tracker
- 使用Nginx安装和配置Drupal 8,并在CentOS 8上进行加密
- 配置Linux未安装SSH配置的后果(linux没有ssh)
- MongoDB安装及配置要求(mongodb配置要求)
- Ubuntu系统下安装MySQL数据库(ubuntu下安装mysql)
- Ubuntu上安装MongoDB的快速指南(ubuntu安装mongodb)
- ELK6.3+head插件安装配置
- 安装Ubuntu系统,轻松使用Oracle(ubuntu安装oracle)
- Oracle安装与配置指南(oracle的安装和配置)
- 安装703n系统并配置mysql数据库(703n 安装mysql)
- Oracle 11安装及配置启动指南(oracle11安装启动)
- redhatServerrelease5.2安装配置简明教程
- 无法在发生错误时创建会话,请检查PHP或网站服务器日志,并正确配置PHP安装(win+linux)
- nginx安装及配置支持php的教程(全)
- Eclipse+Python的安装与配置流程
- 深入phpMyAdmin的安装与配置的详细步骤
- MySQLHandlerSocket插件安装配置教程
- linuxproftpd-1.3.4c安装配置实例