网站首页 > 开源技术 正文
1. 创建虚拟显示器---必须是Intel集成显卡。包含VirtualHeads功能。AMD不用考虑。如果是独显,请关闭独显使用集成显卡。另外需要安装intel开源驱动。
2. 创建虚拟显示器的配置文件
root@srv1:~# vim /usr/share/X11/xorg.conf.d/20-intel.conf
Section "Device"
Identifier "intelgpu0"
Driver "intel"
Option "VirtualHeads" "1"
EndSection
3. 打开终端,输入xrandr命令,查看是否存在VIRTUAL开头的显示器
root@srv1:~# xrandr
Screen 0: minimum 8 x 8, current 3520 x 1200, maximum 32767 x 32767
LVDS1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
1600x900 59.97*+ 59.82
1440x900 59.89
1400x900 59.96 59.88
1368x768 60.00 59.88 59.85
1360x768 59.80 59.96
1280x800 59.81 59.91
1152x864 60.00
1280x720 59.86 60.00 59.74
1024x768 60.00
1024x576 60.00 59.90 59.82
960x540 60.00 59.63 59.82
800x600 60.32 56.25
864x486 60.00 59.92 59.57
800x450 60.00
640x480 59.94
720x405 59.51 60.00 58.99
640x360 59.84 59.32 60.00
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
4. 获取平板显示器所需分辨率----请查询自家平板的最高支持分辨率
root@srv1:~# cvt 1920 1200
# 1920x1200 59.88 Hz (CVT 2.30MA) hsync: 74.56 kHz; pclk: 193.25 MHz
Modeline "1920x1200_60.00" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync
5. 为VIRTUAL1生成新的分辨率模式---将第4步的Modeline后面的内容复制
root@srv1:~# xrandr --newmode "1920x1200_60.00" 193.25 1920 2056 2256 2592 1200 1203 1209 1245 -hsync +vsync
6. 向虚拟显示器添加分辨率
root@srv1:~# xrandr --addmode VIRTUAL1 "1920x1200_60.00"
```
7. 调整虚拟显示器与笔记本显示器-LVDS1的位置---笔记本显示器请按实际名称对应
# 笔记本在左侧,虚拟显示器在右侧
root@srv1:~# xrandr --output LVDS1 --left-of VIRTUAL1 --auto
# 笔记本在右侧,虚拟显示器在左侧侧
root@srv1:~# xrandr --output LVDS1 --right-of VIRTUAL1 --auto
8. 检查虚拟显示器是否开启
root@srv1:~# xrandr
Screen 0: minimum 8 x 8, current 3520 x 1200, maximum 32767 x 32767
LVDS1 connected primary 1600x900+0+0 (normal left inverted right x axis y axis) 310mm x 170mm
1600x900 59.97*+ 59.82
1440x900 59.89
1400x900 59.96 59.88
1368x768 60.00 59.88 59.85
1360x768 59.80 59.96
1280x800 59.81 59.91
1152x864 60.00
1280x720 59.86 60.00 59.74
1024x768 60.00
1024x576 60.00 59.90 59.82
960x540 60.00 59.63 59.82
800x600 60.32 56.25
864x486 60.00 59.92 59.57
800x450 60.00
640x480 59.94
720x405 59.51 60.00 58.99
640x360 59.84 59.32 60.00
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 connected 1920x1200+1600+0 (normal left inverted right x axis y axis) 0mm x 0mm
1920x1200_60.00 59.88*
VIRTUAL2 disconnected (normal left inverted right x axis y axis)
9. 安装x11vnc
root@srv1:~# apt install x11vnc
10. 配置并启动x11vnc
# 如果想设置密码--不想设置可忽略
root@srv1:~# x11vnc -storepasswd
#x11vnc所用的参数说明
-rfbport:指定了连接所用的端口,默认为5900也可以自行设置。
-clip:该命令设置x11vnc映射屏幕的范围,可以使用-clip WxH+X+Y来手动设置映射范围,也可以使用-clip xinerama0来自动映射显示器,其中xinerama0为屏幕设置中从左往右数第一个显示器,以此类推xinerama1为第二个,如果你的主屏幕在左边虚拟屏幕在右边,那如果设置为xinerama0就会将主屏幕的显示内容复制到虚拟屏幕上,也就是两个屏幕的内容一样了,这时就应该设置为xinerama1。
-wait:是两次屏幕抓取的时间间隔,默认为 20 ms 效果比较卡顿,设置为 1 的话会尽可能降低抓取时间减少延迟。
-defer:向vnc客户端发送更新的间隔,默认也为 20 ms,设置为 1 可以尽可能提高发送频率(但对网速的要求就高了)。
-nowf:在移动窗口到虚拟屏幕时显示内容,否则会显示为一个框。
-sb:设置休眠时间,默认为 60s 也就是如果屏幕 60s 内没有活动的话就停止数据传送,这样会导致有时鼠标从主屏移动到虚拟屏幕时会卡顿,设置为 0 后就不会休眠了。
# 启动x11vnc---虚拟化显示器在左侧输出
root@srv1:~# x11vnc -rfbport 5900 -clip xinerama0 -wait 1 -defer 1 -nowf -sb 0 &
# 启动x11vnc---虚拟化显示器在右侧输出
root@srv1:~# x11vnc -rfbport 5900 -clip xinerama1 -wait 1 -defer 1 -nowf -sb 0 &
11. 在Android平板上安装并使用bvnc或其他vnc连接Linux的5900端口
12. 无网络情况下使用USB连接Linux
root@srv1:~# apt install adb android-tools-adb android-tools-fastboot
# 通过adb反向代理,使平板通过USB连接
root@srv1:~# adb reverse tcp:5900 tcp:5900
13. 在Android平板上安装并使用bvnc或其他vnc,通过USB连接localhost:5900端口
- 上一篇: pingtools pro安卓版
- 下一篇: Android Studio中使用AIDL
猜你喜欢
- 2025-03-06 ADB 下载、安装及使用教程:让你更好地管理 Android 设备
- 2025-03-06 优化细节表现 Nexus 5体验Android M
- 2025-03-06 Android Studio中使用AIDL
- 2025-03-06 pingtools pro安卓版
- 2025-03-06 Android ANR:原理分析及解决办法
- 2025-03-06 编译适用于Android-ARM架构的tcpdump工具
- 2025-03-06 使用Xamarin和Visual Studio开发Android可穿戴设备应用
- 2025-03-06 达内安卓培训专家:Android应用开发必备
- 2025-03-06 为什么嵌入式开发不用安卓
- 2025-03-06 app自动化测试(Android)–App 控件定位
你 发表评论:
欢迎- 最近发表
- 标签列表
-
- jdk (81)
- putty (66)
- rufus (78)
- 内网穿透 (89)
- okhttp (70)
- powertoys (74)
- windowsterminal (81)
- netcat (65)
- ghostscript (65)
- veracrypt (65)
- asp.netcore (70)
- wrk (67)
- aspose.words (80)
- itk (80)
- ajaxfileupload.js (66)
- sqlhelper (67)
- express.js (67)
- phpmailer (67)
- xjar (70)
- redisclient (78)
- wakeonlan (66)
- tinygo (85)
- startbbs (72)
- webftp (82)
- vsvim (79)
本文暂时没有评论,来添加一个吧(●'◡'●)