AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[x11-forwarding](ubuntu)

Martin Hope
Terranees
Asked: 2020-04-03 03:18:24 +0800 CST

WSL:无法从远程服务器 X 转发 GUI

  • 1

我正在尝试使用适用于 Linux 的 Windows 子系统在工作中访问我的 Linux 工作站。我是一个非常新手的用户,无法让 GUI X 转发工作。我可以使用 -X SSH 连接到机器,但是当我调用像 xclock 这样的 GUI 时,连接被拒绝。

user@localmachine: export DISPLAY=localhost:0.0
user@localmachine: ssh -X username@remoteserver
username@remoteserver password:
Warning: No xauth data; using fake authentication data for X11 forwarding.
remoteserver: echo $DISPLAY
localhost:11.0
xclock
connect localhost port 6000: Connection refused
Error: Can't open display: localhost:11.0

以下设置/检查

  • 在 sshd_config X11Forwarding 设置为 yes
  • 我曾尝试在 Windows 防火墙中打开端口 6000,但没有区别。

PS 我可以使用 SSH -X 从我的 Fedora 笔记本电脑到远程服务器打开 xclock 或任何其他 GUI。由此我推断服务器端已按应有的方式设置。

gui ssh x11-forwarding windows-subsystem-for-linux
  • 1 个回答
  • 1610 Views
Martin Hope
Mate de Vita
Asked: 2020-03-18 08:10:45 +0800 CST

通过 WSL 连接进行 X11 转发

  • 5

我有以下设置:

我的工作计算机正在运行 Ubuntu 18.04,具有以下内容/etc/ssh/sshd_config:

#       $OpenBSD: sshd_config,v 1.101 2017/03/14 07:19:07 djm Exp $

# This is the sshd server system-wide configuration file.  See
# sshd_config(5) for more information.

# This sshd was compiled with PATH=/usr/bin:/bin:/usr/sbin:/sbin

# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented.  Uncommented options override the
# default value.

Port 3022
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::

#HostKey /etc/ssh/ssh_host_rsa_key
#HostKey /etc/ssh/ssh_host_ecdsa_key
#HostKey /etc/ssh/ssh_host_ed25519_key

# Ciphers and keying
#RekeyLimit default none

# Logging
#SyslogFacility AUTH
#LogLevel INFO

# Authentication:

#LoginGraceTime 2m
PermitRootLogin no
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10

PubkeyAuthentication yes

# Expect .ssh/authorized_keys2 to be disregarded by default in future.
#AuthorizedKeysFile     .ssh/authorized_keys .ssh/authorized_keys2

#AuthorizedPrincipalsFile none

#AuthorizedKeysCommand none
#AuthorizedKeysCommandUser nobody

# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no

# Change to yes to enable challenge-response passwords (beware issues with
# some PAM modules and threads)
ChallengeResponseAuthentication no

# Kerberos options
#KerberosAuthentication no
#KerberosOrLocalPasswd yes
#KerberosTicketCleanup yes
#KerberosGetAFSToken no

# GSSAPI options
#GSSAPIAuthentication no
#GSSAPICleanupCredentials yes
#GSSAPIStrictAcceptorCheck yes
#GSSAPIKeyExchange no

# Set this to 'yes' to enable PAM authentication, account processing,
# and session processing. If this is enabled, PAM authentication will
# be allowed through the ChallengeResponseAuthentication and
# PasswordAuthentication.  Depending on your PAM configuration,
# PAM authentication via ChallengeResponseAuthentication may bypass
# the setting of "PermitRootLogin without-password".
# If you just want the PAM account and session checks to run without
# PAM authentication, then enable this but set PasswordAuthentication
# and ChallengeResponseAuthentication to 'no'.
UsePAM no

AllowAgentForwarding no
AllowTcpForwarding no
#GatewayPorts no
X11Forwarding yes
X11DisplayOffset 10
#X11UseLocalhost yes
#PermitTTY yes
#PrintLastLog yes
TCPKeepAlive no
#UseLogin no
#PermitUserEnvironment no
#Compression delayed
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
PermitTunnel no
#ChrootDirectory none
#VersionAddendum none

# no default banner path
Banner /etc/issue.net
PrintMotd yes

# Allow client to pass locale environment variables
AcceptEnv LANG LC_*

# override default of no subsystems
Subsystem       sftp    /usr/lib/openssh/sftp-server

# Example of overriding settings on a per-user basis
Match User me
        AllowAgentForwarding yes
        AllowTcpForwarding yes
        X11Forwarding yes
        X11UseLocalhost no
        PermitTunnel yes

我目前没有物理访问工作计算机的权限。所以我从家里连接到它。我的家用 PC 运行的是 Windows 10,其 Windows Subshel​​l for Linux 运行 Ubuntu 18.04。其中~/.ssh/config包含以下内容:

# Defaults
Host *
        ForwardAgent no
        ForwardX11 no
        ForwardX11Trusted no
        User me
        Protocol 2
        ServerAliveInterval 0
        TcpKeepAlive no

# Workstation
Host workcomputer
        HostName machine.domain.com
        Port 3022
        ForwardX11 Yes
        ForwardX11Trusted Yes

并~/.profile包含该行

DISPLAY=:0

家用计算机还安装并运行了 VcXsrv。

我能够像xeyes本地一样运行应用程序,并且它们在 VcXsrv 窗口中打开得很好(尽管我需要运行它,xeyes -display :0因为xeyes似乎没有使用 $DISPLAY 变量)。但是,我无法显示任何远程 GUI 应用程序。

me@Home:~$ ssh workcomputer
me@Work:~$ echo $DISPLAY

me@Work:~$ gedit
Unable to init server: Could not connect: Connection refused

(gedit:20107): Gtk-WARNING **: 16:58:42.096: cannot open display:

我试过export DISPLAY=:0在远程机器gedit上运行,之后确实运行了,但没有出现在我的本地机器上的 VcXsrv 窗口中。我也尝试过export DISPLAY=:10,但这再次导致Connection refused. 我也尝试过连接,ssh -X但也没有用。

我还能尝试在本地 X 服务器上打开远程 GUI 应用程序吗?

xorg ssh x11-forwarding windows-subsystem-for-linux
  • 1 个回答
  • 4340 Views
Martin Hope
Leon Avery
Asked: 2020-02-14 05:34:09 +0800 CST

如何停止 emacs 调整其初始帧的大小?

  • 3

这是我多年来一直遇到的一个烦人的问题。我在英特尔 PC 上安装了 ubuntu 16.04,在 WSL 1 下的 Windows 机器上安装了 18.04。在这两种情况下,我都使用 SSH(实际上是 PuTTY)隧道 X11 连接到 ubuntu 系统,并使用 Xming 作为 X 服务器。我使用 apt-get 安装 emacs25 发行版。除了一个烦人的问题外,它工作正常。当我运行 emacs 时,例如使用

emacs ex1.c &

我可以看到窗口最初以合理的大小弹出,但随后立即调整自身大小,使其仅显示 3 行文本。我可以手动调整它的大小(即用鼠标),然后它的行为就合理了。我得到基本上相同的结果

emacs -geometry 80x51 ex1.c &

初始窗口现在是 80x51,但和以前一样,它会立即将自身调整为下蹲 80x3 窗口。我没有 ~/.emacs,也没有 .Xresources。如果我使用emacs -qor ,行为是相同的emacs -Q。

为什么 emacs 框架会自行调整大小?我该如何阻止它这样做?

xorg emacs x11-forwarding
  • 1 个回答
  • 519 Views
Martin Hope
Tmanok
Asked: 2020-02-04 14:26:37 +0800 CST

x11 转发:Google Chrome 和 Chromium 浏览器灰显,其他应用显示正常

  • 3

在我使用 X11 服务器和实验室环境的工作中,Google Chrome 和 Chromium 浏览器在通过 SSH X11 转发时显示为灰色面板。

这发生在 Ubuntu 16.04 和 18.04 以及 LinuxMint 19.2 和 19.3 上。基本上我像其他任何一样启动 X11 会话:

ssh -X username@xserver##.domain.com 

我看到了这该死的东西: 谷歌 Chrome 灰色面板

仅供参考:似乎没有其他应用程序可以做到这一点。Firefox、LibreOffice 等工作正常。

在启动应用程序的终端中,唯一明显的错误与 Google 政策和 FontService 有关。如果有人对如何解决此灰色面板问题有任何建议,请告诉我。我愿意附上日志,但请注意,出于隐私原因,它们可能会受到一点审查。

ssh google-chrome chromium x11-forwarding
  • 2 个回答
  • 9530 Views
Martin Hope
01AutoMonkey
Asked: 2019-11-30 12:29:59 +0800 CST

如何通过本地网络从另一台计算机远程使用计算机?

  • 3

我在同一个网络上有两台显示器和两台计算机,其中一台计算机不如另一台那么强大,显示器是相同的。

我想知道的是,如何将功能强大的计算机的 X11 Ubuntu GNOME 桌面环境显示到功能较弱的显示器上(通过本地网络),然后从那里控制它?

体验越接近直接使用功能强大的计算机越好。例如在滞后、延迟、帧率、图像质量等方面。

一种解决方案是TeamViewer,我还没有在本地网络上尝试过,但是当我在互联网上使用它时,体验并不理想。

因此,鉴于此:

  • 什么是最好的 FOSS 解决方案?
  • 什么是最好的专有解决方案?

我想这应该是可能的,因为Google Stadia应该能够做到这一点,即使在互联网上以 1080p 60 FPS(但考虑到视频游戏)。

奖金问题

  • 这也可以在 Raspberry Pi 4 上完成吗?
  • 正确的术语是“瘦客户端”吗?
  • 如何做同样的事情,但在 Wayland 上?
networking xorg monitor x11-forwarding
  • 2 个回答
  • 348 Views
Martin Hope
N0rbert
Asked: 2019-07-29 03:57:52 +0800 CST

是否可以运行 Docker 容器并在主机上显示其图形应用程序窗口?

  • 6

我创建了最简单(最小的工作示例)Dockerfile来在带有 19.10 内部容器的 Ubuntu 16.04 LTS 主机系统上运行图形应用程序:

mkdir ~/docker-xclock

cat > ~/docker-xclock/Dockerfile << EOF
FROM ubuntu:19.10
RUN apt-get update
RUN apt-get install -y x11-apps
CMD xclock
EOF

然后创建容器

docker build -t ubuntu:xclock ~/docker-xclock

当我尝试运行此容器时,它显示有关显示的错误:

$ docker run ubuntu:xclock 
Error: Can't open display: 

怎么了?

xorg x11-forwarding container docker
  • 3 个回答
  • 10763 Views
Martin Hope
xirururu
Asked: 2019-05-22 10:57:34 +0800 CST

X11 通过 ssh 转发 - 在 DISPLAY 中找不到“:”:需要定义

  • 0

我的电脑是windows 10 ,我通过virtualbox安装了ubuntu 18.04。

我想从我的窗口和图形输出在 ubuntu 中运行一个python 程序。

但是运行程序后,它总是报告:

Could not find ':' in DISPLAY: needs-to-be-defined  
Unable to init server: Could not connect: Connection refused

(Original:2079): Gtk-WARNING **: 14:39:33.441: cannot open display: 127.0.0.1:10.0

我做了什么:

1:我在/etc/ssh/sshd_config开启时做了设置:

ForwardX11 yes
ForwardX11Trusted yes

2:登录:ssh username@pc-name -X

3:更改IP地址:

$ export DISPLAY=127.0.0.1:10.0 # original was localhost:10.0

你知道,怎么了?为什么我看不到图片?

virtualbox ssh x11-forwarding
  • 1 个回答
  • 2884 Views
Martin Hope
Alice
Asked: 2019-01-14 21:50:49 +0800 CST

ssh -X 打开文件管理器

  • 7

我必须使用运行 Ubuntu 18.10 的机器

当 ssh -X 到另一台计算机时

  ssh -X assistant@pc.local

firefox 和 google-chrome 可以在当前机器上用 firefox 打开

firefox  
google-chrome

但是,如果尝试打开文件管理器

xdg-open .
#or
nautilus .

文件管理器是从远程计算机的桌面启动的,而不是当前启动的。

ssh x11-forwarding
  • 2 个回答
  • 7923 Views
Martin Hope
linux64kb
Asked: 2018-02-13 15:37:07 +0800 CST

LIBDBUSMENU-GLIB-WARNING **:无法获取会话总线:x-forwarding 时无法执行子进程“dbus-launch”(没有这样的文件或目录)

  • 12

我在Ubuntu 16.04.3 服务器上设置了x-forwarding,虽然转发工作正常,但每次我启动 GUI 应用程序时,它都会在终端中报告以下错误。

(<app-name>:<pid>) LIBDBUSMENU-GLIB-WARNING **: Unable to get session bus: Failed to execute child process "dbus-launch" (No such file or directory)

这显然不是关键,但它没有按应有的方式工作。

我该如何修复这个?

编辑我主要是尝试启动 Firefox。

server x11-forwarding 16.04
  • 1 个回答
  • 34259 Views
Martin Hope
Oli
Asked: 2010-11-05 01:54:51 +0800 CST

反向 X11 转发

  • 3

昨晚我在玩我的手机(运行 Linux/X 堆栈),我设法通过 ssh 进入我的桌面并运行一个应用程序并让它显示在我的手机上。太棒了。

今天我想做相反的事情。我想在 PC 上查看手机上运行的应用程序。我可以在我的手机上安装一个 SSH 服务器,但坦率地说,出于安全原因,我不喜欢那样做。我希望从我的手机启动此操作。

有没有办法从我的手机连接并将 PC 的 X 连接隧道回手机,然后在手机上运行显示在 PC 上的应用程序?

ssh x11-forwarding
  • 3 个回答
  • 7485 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve