$ x11vnc -storepasswd
Enter VNC password:
Verify password:
Write password to /root/.vnc/passwd? [y]/n y #此处键入 y 回车
Password written to: /root/.vnc/passwd
root@ykla:~ # vncserver :0
Warning: ykla:0 is taken because of /tmp/.X11-unix/X0
Remove this file if there is no X server ykla:0
A VNC server is already running as :0
如果启动服务时未通信端口,则系统根据使用情况自动指定。
关闭服务请用命令 # vncserver -kill :1,这里必须指定通信端口。
如果启用了防火墙,以 ipfw 为例,在终端输入命令:
# ipfw add allow tcp from any to me 5900-5910 in keep-state
# pkg install xorg kde xrdp wqy-fonts xdg-user-dirs pulseaudio-module-xrdp
或者:
# cd /usr/ports/x11/xorg/ && make install clean
# cd /usr/ports/x11/kde/ && make install clean
# cd /usr/ports/net/xrdp/ && make install clean
# cd /usr/ports/x11-fonts/wqy/ && make install clean
# cd /usr/ports/devel/xdg-user-dirs/ && make install clean
# cd /usr/ports/audio/pulseaudio-module-xrdp && make install clean
查看配置文件:
root@ykla:/usr/ports/net/xrdp # pkg info -D xrdp
xrdp-0.10.2_2,1:
On install:
xrdp has been installed.
There is an rc.d script, so the service can be enabled by adding this line
in /etc/rc.conf:
xrdp_enable="YES"
xrdp_sesman_enable="YES"
Do not forget to edit the configuration files in "/usr/local/etc/xrdp"
and the "/usr/local/etc/xrdp/startwm.sh" script.
To enable audio redirection, install the following ports/packages to meet
your environment.
- audio/pipewire-module-xrdp
- audio/pulseaudio-module-xrdp
配置
# service xrdp enable
# service xrdp-sesman enable
# service dbus enable
# cd /usr/ports/net/freerdp3/
# make install clean
使用 FreeBSD 通过 freerdp3 远程链接到 Windows 11 24H2:
ykla@ykla:~ $ xfreerdp3 /u:ykla /p:z /v:192.168.31.213
……省略一部分……
441] [19244:dca12700] [ERROR][com.freerdp.crypto] - [tls_print_new_certificate_warn]: Host key verification failed.
Certificate details for 192.168.31.213:3389 (RDP-Server):
Common Name: DESKTOP-U72I6SS
Subject: CN = DESKTOP-U72I6SS
Issuer: CN = DESKTOP-U72I6SS
Valid from: Mar 4 12:39:28 2025 GMT
Valid to: Sep 3 12:39:28 2025 GMT
Thumbprint: 36:b9:be:66:ab:2b:54:32:28:46:b6:98:68:8d:6f:20:a5:d1:58:8c:09:de:cc:3d:30:e1:06:6f:4f:62:54:de
The above X.509 certificate could not be verified, possibly because you do not have
the CA certificate in your certificate store, or the certificate has expired.
Please look at the OpenSSL documentation on how to add a private CA to the store.
Do you trust the above certificate? (Y/T/N) y # 输入 y 按回车键以确认链接
ykla@ykla:~ $ xfreerdp 192.168.31.213 # 注意是 xfreerdp。
[20:35:20:041] [1105:7c412000] [WARN][com.freerdp.client.common.cmdline] - ----------------------------------------
[20:35:20:043] [1105:7c412000] [WARN][com.freerdp.client.common.cmdline] - Using deprecated command-line interface!
[20:35:20:043] [1105:7c412000] [WARN][com.freerdp.client.common.cmdline] - This will be removed with FreeRDP 3!
[20:35:20:043] [1105:7c412000] [WARN][com.freerdp.client.common.cmdline] - ----------------------------------------
[20:35:20:043] [1105:7c412000] [WARN][com.freerdp.client.common.compatibility] - 192.168.31.213 -> /v:192.168.31.213
[20:35:20:043] [1105:7c412000] [WARN][com.freerdp.client.common.compatibility] -
[20:35:20:045] [1105:7c412700] [INFO][com.freerdp.client.x11] - No user name set. - Using login name: ykla
[20:35:21:445] [1105:7c412700] [INFO][com.freerdp.crypto] - creating directory /home/ykla/.config/freerdp
[20:35:21:445] [1105:7c412700] [INFO][com.freerdp.crypto] - creating directory [/home/ykla/.config/freerdp/certs]
[20:35:21:445] [1105:7c412700] [INFO][com.freerdp.crypto] - created directory [/home/ykla/.config/freerdp/server]
[20:35:21:485] [1105:7c412700] [WARN][com.freerdp.crypto] - Certificate verification failure 'self-signed certificate (18)' at stack position 0
[20:35:21:485] [1105:7c412700] [WARN][com.freerdp.crypto] - CN = DESKTOP-U72I6SS
[20:35:21:485] [1105:7c412700] [ERROR][com.freerdp.crypto] - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[20:35:21:485] [1105:7c412700] [ERROR][com.freerdp.crypto] - @ WARNING: CERTIFICATE NAME MISMATCH! @
[20:35:21:485] [1105:7c412700] [ERROR][com.freerdp.crypto] - @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
[20:35:21:485] [1105:7c412700] [ERROR][com.freerdp.crypto] - The hostname used for this connection (192.168.31.213:3389)
[20:35:21:485] [1105:7c412700] [ERROR][com.freerdp.crypto] - does not match the name given in the certificate:
[20:35:21:485] [1105:7c412700] [ERROR][com.freerdp.crypto] - Common Name (CN):
[20:35:21:485] [1105:7c412700] [ERROR][com.freerdp.crypto] - DESKTOP-U72I6SS
[20:35:21:485] [1105:7c412700] [ERROR][com.freerdp.crypto] - A valid certificate for the wrong name should NOT be trusted!
Certificate details for 192.168.31.213:3389 (RDP-Server):
Common Name: DESKTOP-U72I6SS
Subject: CN = DESKTOP-U72I6SS
Issuer: CN = DESKTOP-U72I6SS
Thumbprint: 36:b9:be:66:ab:2b:54:32:28:46:b6:98:68:8d:6f:20:a5:d1:58:8c:09:de:cc:3d:30:e1:06:6f:4f:62:54:de
The above X.509 certificate could not be verified, possibly because you do not have
the CA certificate in your certificate store, or the certificate has expired.
Please look at the OpenSSL documentation on how to add a private CA to the store.
Do you trust the above certificate? (Y/T/N) y # 输入 y 回车
Domain: # 留空
Password: # 输入密码,密码不会显示出来 ***。
……省略一部分……
故障排除
但是我没有输入用户名就连上了?
不知道。难道是因为我的 FreeBSD 用户名和 Windows 是一样的?
rdesktop(不支持 NLA)
net/xrdesktop2 是 rdesktop 的图形化前端,但我打开里面的键盘设置就卡死了。
使用 pkg 安装 rdesktop:
# pkg install rdesktop
或者用 Ports:
# cd /usr/ports/net/rdesktop/
# make install clean
rdesktop 无前端 GUI,故要在终端输入命令:
# rdesktop ip:端口 # 比如 192.168.31.155:3389
如果没有特意更改 Windows 配置,无须加 :端口。
对于我测试的 Windows 11 24H2 会报错:
ykla@ykla:~ $ rdesktop 192.168.31.213
Failed to connect, CredSSP required by server (check if server has disabled old TLS versions, if yes use -V option).
ykla@ykla:~ $ rdesktop 192.168.31.213
ATTENTION! The server uses and invalid security certificate which can not be trusted for
the following identified reasons(s);
1. Certificate issuer is not trusted by this system.
Issuer: CN=DESKTOP-U72I6SS
Review the following certificate info before you trust it to be added as an exception.
If you do not trust the certificate the connection atempt will be aborted:
Subject: CN=DESKTOP-U72I6SS
Issuer: CN=DESKTOP-U72I6SS
Valid From: Tue Mar 4 20:39:28 2025
To: Wed Sep 3 20:39:28 2025
Certificate fingerprints:
sha1: 599c0e8bbc57c5ee8de8993d5241fb0f0d70e98d
sha256: 36b9be66ab2b54322846b698688d6f20a5d1588c09decc3d30e1066f4f6254de
Do you trust this certificate (yes/no)? # 输入 yes,按回车键
# cd /usr/ports/deskutils/anydesk/
# make install clean
不可使用 BATCH=yes参数,因为需要接受许可协议才能使用:
查看安装后说明:
root@ykla:/ # pkg info -D anydesk
anydesk-6.1.1_2:
On install:
1. Minimum OS version.
======================
Anydesk is a binary package for FreeBSD.
Minimal recommended is 1 GiB system memory
installed but performence will be reduced.
For good performance is recommended and 2 GiB
system memory.
2. Important settings
=====================
Since Version 2.9.1 the following prerequisites have to be met:
You need a mounted /proc directory. Either mount it manually or add it to your /etc/fstab file:
fstab: proc /proc procfs rw 0 0
manually: # mount -t procfs proc /proc
提示需要 /proc,经过测试没有的话的执行程序确没反应。
# mount -t procfs proc /proc # 临时用一下。持久化可以参照上面的说明做