[救救孩子]win10 想用 xrdp 连接上有 gnome 桌面的 Ubuntu

2019-11-11 17:34:16 +08:00
 amiwrong123

win10 是企业版,另一台电脑是 Ubuntu18.04.3 lts (完全安装,有 gnome 桌面),在一个局域网内,win 去 ping Ubuntu 的 ip 能 ping 通。

之前找教程的时候用的百度,发现完全被误导了。因为他们总让我再去装一个 xUbuntu 的新的桌面系统,然而我已经有了 gnome 的桌面系统了啊。 https://blog.csdn.net/qq_25556149/article/details/82216190 https://blog.csdn.net/avinswang/article/details/93601312

上面链接的 Std-Xrdp-Install-0.5.sh 我也试过了,没用。

后面我又把 xUbuntu 卸载了,然后按照 https://blog.csdn.net/qq_25556149/article/details/82216190 里面把所有的 xubuntu-desktop 替换为 gnome-desktop 所以来了一遍,还是不行。

后面我就开始谷歌: 找到这个教程: https://www.hiroom2.com/2018/04/29/ubuntu-1804-xrdp-gnome-en/ 虽然这个看起来很靠谱,但还是不行。

win10 通过 mstsc 的连接选项有这些:

连接失败的信息是这些:

各位大佬有没有好使的办法?我把 Ubuntu 重装了都可以,主要确实对这几个配置文件一知半解,但现在又有点着急。

/etc/xrdp/startwm.sh 配置如下:

#!/bin/sh
# xrdp X session start script (c) 2015, 2017 mirabilos
# published under The MirOS Licence

#fixGDM-by-Griffon
gnome-shell-extension-tool -e ubuntu-appindicators@ubuntu.com
gnome-shell-extension-tool -e ubuntu-dock@ubuntu.com

if [ -f ~/.xrdp-fix-theme.txt ]; then
echo 'no action required'
else
gsettings set org.gnome.desktop.interface gtk-theme 'Ambiance'
gsettings set org.gnome.desktop.interface icon-theme 'Humanity'
echo 'check file for xrdp theme fix' >~/.xrdp-fix-theme.txt
fi

if test -r /etc/profile; then
	. /etc/profile
fi

if test -r /etc/default/locale; then
	. /etc/default/locale
	test -z "${LANG+x}" || export LANG
	test -z "${LANGUAGE+x}" || export LANGUAGE
	test -z "${LC_ADDRESS+x}" || export LC_ADDRESS
	test -z "${LC_ALL+x}" || export LC_ALL
	test -z "${LC_COLLATE+x}" || export LC_COLLATE
	test -z "${LC_CTYPE+x}" || export LC_CTYPE
	test -z "${LC_IDENTIFICATION+x}" || export LC_IDENTIFICATION
	test -z "${LC_MEASUREMENT+x}" || export LC_MEASUREMENT
	test -z "${LC_MESSAGES+x}" || export LC_MESSAGES
	test -z "${LC_MONETARY+x}" || export LC_MONETARY
	test -z "${LC_NAME+x}" || export LC_NAME
	test -z "${LC_NUMERIC+x}" || export LC_NUMERIC
	test -z "${LC_PAPER+x}" || export LC_PAPER
	test -z "${LC_TELEPHONE+x}" || export LC_TELEPHONE
	test -z "${LC_TIME+x}" || export LC_TIME
	test -z "${LOCPATH+x}" || export LOCPATH
fi

if test -r /etc/profile; then
	. /etc/profile
fi

gnome-session
#test -x /etc/X11/Xsession && exec /etc/X11/Xsession
#exec /bin/sh /etc/X11/Xsession

/etc/X11/Xsession:

#!/bin/sh
#
# /etc/X11/Xsession
#
# global Xsession file -- used by display managers and xinit (startx)

# $Id: Xsession 967 2005-12-27 07:20:55Z dnusinow $
gnome-session
# 后面省略,就前面加了这一句

/var/log/xrdp.log:

[20191111-17:01:39] [DEBUG] Closed socket 17 (AF_UNIX)
[20191111-17:01:43] [DEBUG] Closed socket 17 (AF_UNIX)
[20191111-17:01:46] [DEBUG] xrdp_wm_log_msg: connection problem, giving up
[20191111-17:01:46] [DEBUG] Closed socket 17 (AF_UNIX)
[20191111-17:01:46] [DEBUG] xrdp_wm_log_msg: some problem
[20191111-17:01:46] [DEBUG] xrdp_mm_module_cleanup
[20191111-17:01:46] [DEBUG] Closed socket 16 (AF_INET6 ::1 port 55640)

/var/log/xrdp-sesman.log:

[20191111-16:58:23] [ERROR] X server for display 10 startup timeout
[20191111-16:58:23] [CORE ] waiting for window manager (pid 1621) to exit
[20191111-16:58:23] [ERROR] X server for display 10 startup timeout
[20191111-16:58:23] [ERROR] another Xserver might already be active on display 10 - see log
[20191111-16:58:23] [DEBUG] aborting connection...
[20191111-16:58:23] [CORE ] window manager (pid 1621) did exit, cleaning up session
[20191111-16:58:23] [INFO ] calling auth_stop_session and auth_end from pid 1620
[20191111-16:58:23] [DEBUG] cleanup_sockets:
[20191111-16:58:23] [DEBUG] cleanup_sockets: deleting /var/run/xrdp/sockdir/xrdp_chansrv_socket_10
[20191111-16:58:23] [DEBUG] cleanup_sockets: deleting /var/run/xrdp/sockdir/xrdpapi_10
[20191111-16:58:23] [DEBUG] cleanup_sockets: failed to delete /var/run/xrdp/sockdir/xrdpapi_10
[20191111-16:58:23] [INFO ] ++ terminated session:  username liu, display :10.0, session_pid 1620, ip ::ffff:192.168.68.148:58558 - socket: 12
11156 次点击
所在节点    程序员
50 条回复
genius2k
2019-11-12 03:14:47 +08:00
这坡完一折腾了半天一直弄不好。。
后来弃疗了直接改用 x11vnc 了,基本不用怎么配置,还可以硬件加速。缺点就是连接的是 DISPLAY:0,或许你可以用 anydesk,基本也不用怎么折腾
hryishengpa
2019-11-12 09:06:24 +08:00
试试 xrdp 降版本,降回 0.6.1-2
FLynnCPP
2019-11-12 09:29:47 +08:00
@amiwrong123 不用的,屏幕就是显示器,只是用于显示作用,你把屏幕拔了,只是你选择不看罢了,远程不受影响
lin07hui
2019-11-12 10:52:10 +08:00
如果只是读写文字文件的话可以用 vs code + 插件 Remote - SSH
如果非要接桌面可以用 teamview
amiwrong123
2019-11-12 11:40:18 +08:00
@MasterMonkey
@Yanni0507
求助啊,救命啊,大佬。看下附言 2 呗。

现在我用两个屏幕连着 win10 电脑,Ubuntu 电脑没有连屏幕。

不用 nomachine 连上 Ubuntu 的时候没事,但一旦我连上 Ubuntu 后,左边那个显示器就开始闪屏(是间歇性黑屏),右边屏幕会间歇性花屏。
amiwrong123
2019-11-12 12:06:17 +08:00
但是我在 display setting 里面禁用了一大推东西以后,居然就不黑屏了,哈哈哈哈。

也不知道哪个起到的作用。。。
renhua
2019-11-12 12:11:02 +08:00
不执着于 xrdp,仅仅是要远程 linux 上的 gnome 啊 lxde 啊 kde 啊之类桌面的话,十项全能 mobaxterm 了解一下。用了都说真 tm 好。

官网:
https://mobaxterm.mobatek.net
随手找的一篇介绍:
https://www.cnblogs.com/sjqlwy/p/mobaxterm.html
Yanni0507
2019-11-12 14:51:04 +08:00
@amiwrong123 不知道你具体怎么设置的,帮不到你额
amiwrong123
2019-11-12 15:56:48 +08:00
@Yanni0507

没事,弄了几下,黑屏的情况很少发生了,但还是偶尔有。但能用了。

跟 Ubuntu 的自动锁屏和屏保有关系,但我取消了以后还是有。

可能也跟我的两块屏幕比例不一样有关
cheng6563
2019-11-12 23:13:57 +08:00
x2go 也能用用

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/618519

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX