[problem help] hyperv下xrdp黑屏?
Tofloor
poster avatar
136******23
deepin
2024-08-28 09:10
Author

win10 ltsc 2021 hyperv 下全新安装 deepin 23 正式版,默认源安装 xrdp,远程桌面连接一直黑屏。

hyperv下没有本地登录,之前20.9远程桌面是正常的。

另:hyperv下分辨率只有1024x768,是这个版本的显卡驱动有问题吗?20.9最高可到1920x1080

Reply Favorite View the author
All Replies
xiongweixp
deepin
2024-08-28 15:25
#1

V23你试试在用户目录建一个.xinitrc文件,内容是

startdde

然后重新启动xrdp服务

Reply View the author
倒吸一口凉屁
deepin
2024-08-28 15:57
#2

V23可能不支持,这两天我也在弄,没成功。启动脚本改成以下都不行:

export DESKTOP_SESSION=deepin
export XDG_CURRENT_DESKTOP=Deepin
export GDMSESSION=deepin
startdde

V20正常。

Reply View the author
136******23
deepin
2024-08-28 23:11
#3
xiongweixp

V23你试试在用户目录建一个.xinitrc文件,内容是

startdde

然后重新启动xrdp服务

谢谢,试了没变化,还是黑屏

Reply View the author
136******23
deepin
2024-08-28 23:35
#4
倒吸一口凉屁

V23可能不支持,这两天我也在弄,没成功。启动脚本改成以下都不行:

export DESKTOP_SESSION=deepin
export XDG_CURRENT_DESKTOP=Deepin
export GDMSESSION=deepin
startdde

V20正常。

暂时放弃 xrdp,改用 x11vnc 能连上,但是需要在本地登录后重启一次 x11vnc 服务才行,开机启动 x11vnc 服务用 sudo systemctl status x11vnc 查看是报错的

x11vnc.service - Remote desktop service(VNC)
     Loaded: loaded (/etc/systemd/system/x11vnc.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-08-28 23:21:51 CST; 35s ago
   Duration: 178ms
   Main PID: 431 (code=exited, status=1/FAILURE)
        CPU: 148ms

8? 28 23:21:51 liutao-Deepin23 x11vnc[431]: 28/08/2024 23:21:51 passing arg to libvncserver: 5900
8? 28 23:21:51 liutao-Deepin23 x11vnc[431]: 28/08/2024 23:21:51 x11vnc version: 0.9.16 lastmod: 2019-01-05  pid: 431
8? 28 23:21:51 liutao-Deepin23 x11vnc[518]: xauth:  unable to generate an authority file name
8? 28 23:21:51 liutao-Deepin23 x11vnc[431]: 28/08/2024 23:21:51 -auth guess: failed for display='unset'
8? 28 23:21:51 liutao-Deepin23 x11vnc[431]: 28/08/2024 23:21:51 -auth guess: since we are root, retrying with FD_XDM=1
8? 28 23:21:51 liutao-Deepin23 x11vnc[431]: 28/08/2024 23:21:51 -auth guess: failed for display='unset'
8? 28 23:21:51 liutao-Deepin23 systemd[1]: x11vnc.service: Main process exited, code=exited, status=1/FAILURE
8? 28 23:21:51 liutao-Deepin23 systemd[1]: x11vnc.service: Failed with result 'exit-code'.
8? 28 23:22:01 liutao-Deepin23 systemd[1]: /etc/systemd/system/x11vnc.service:3: Unknown key name 'Require' in section 'Unit', ignoring.
8? 28 23:22:01 liutao-Deepin23 systemd[1]: /etc/systemd/system/x11vnc.service:4: Failed to add depend

我是参照 https://www.cnblogs.com/jiftle/p/12928697.html 安装的 x11vnc, 不知道是不是这种方式在 deepin 23 下存在问题,手动重启服务后再查看,此时的VNC才能远程连接成功。

x11vnc.service - Remote desktop service(VNC)
     Loaded: loaded (/etc/systemd/system/x11vnc.service; enabled; preset: enabled)
     Active: active (running) since Wed 2024-08-28 23:07:33 CST; 12min ago
   Main PID: 4018 (x11vnc)
      Tasks: 1 (limit: 4563)
     Memory: 17.1M (peak: 19.1M)
        CPU: 20.933s
     CGroup: /system.slice/x11vnc.service
             ??4018 /usr/bin/x11vnc -auth guess -forever -rfbauth /etc/x11vnc.pwd -rfbport 5900 -shared

另外,hyperv 下 deepin 23 正式版改分辨率,需要在 /etc/default/grub 文件中,删除 GRUB_CMDLINE_LINUX_DEFAULT 那一行中的 nomodeset,光添加 video=hyperv_fb:1920x1080 不去掉 nomodeset 的话,分辨率修改是不生效的。

Reply View the author
136******23
deepin
2024-08-28 23:52
#5

还有,网上所谓xrdp黑屏去修改 /etc/xrdp/startws.sh 添加

unset DBUS\_SESSION\_BUS\_ADDRESS
unset XDG\_RUNTIME\_DIR

建议慎用,最好是做份快照之后尝试

反正我加了之后重启就进不了桌面了,grub 改成 init 3 进控制台删了这两行才恢复回来

Reply View the author
136******23
deepin
2024-08-30 18:05
#6

今天不死心,又在vmware 16下安装了一遍 deepin 23 正式版,启动比hyperv 下慢一点,但是分辨率可调整,默认源安装了 xrdp,结果远程桌面登录后还是黑屏。

Reply View the author
bingoct
deepin
2024-09-11 12:30
#7
136******23

今天不死心,又在vmware 16下安装了一遍 deepin 23 正式版,启动比hyperv 下慢一点,但是分辨率可调整,默认源安装了 xrdp,结果远程桌面登录后还是黑屏。

cat /etc/os-version 
[Version] 
SystemName=Deepin
SystemName[zh_CN]=深度操作系统
ProductType=Desktop
ProductType[zh_CN]=桌面
EditionName=Community
EditionName[en_US]=Community
EditionName[zh_CN]=社区版
MajorVersion=23
MinorVersion=23
OsBuild=31038.101

我这两天在物理主机上尝试 xrdp,遇到了类似的问题。这个帖子的相关操作我都尝试了一次,结果都是黑屏。

但是我试了一个很离谱的操作,你看下能否复现:

  1. 服务端启动 xrdp 服务后,并注销用户。
  2. 客户端(mstsc)尝试连接,进入黑屏。
  3. 服务端登录同一个用户,会卡在进入桌面的待机界面。
  4. 客户端此时不再黑屏,成功进入桌面。
  5. 客户端注销退出用户,服务端用户登录成功。

我对 xrdp 相关的操作、配置不是很懂,不知道这些信息能否提供。

Reply View the author