linux xwininfo -树始终在lambda容器上显示0个子项

envsm3lx  于 2022-12-18  发布在  Linux
关注(0)|答案(1)|浏览(150)

正如标题所述,我发现每当我在lambda中运行Ubuntu的容器上执行xwininfo -tree时,从来没有子屏幕,尽管当我在本地运行同一个容器时,它工作得很好(列出所说应用程序使用的所有窗口)。问题一定出在应用程序启动和它注册到X服务器的某个地方。这里有没有人对可能发生的事情有什么见解,或者我怎么才能让它起作用
为了给这个问题附加一些代码,要点基本上是:

# Start Xvfb
Xvfb $DISPLAY -screen 0 1920x1080x24 -nolisten tcp -nolisten unix & 

# Open Visual Studio Code (just as an example application)
code .

# List all windows
xwininfo -root -tree

如前所述,xwininfo在本地生成如下内容:

Root window id: 0x50d (the root window) (has no name)
Parent window id: 0x0 (none)
   6 children:
   0x600006 "Code": ("code" "Code")  800x600+560+240  +560+240
   0x600002 "Get Started - src - Visual Studio Code": ("code" "Code")  1024x768+448+156  +448+156
   0x600003 (has no name): ()  1x1+0+0  +0+0
   0x800003 "code": ("code" "Code")  200x200+0+0  +0+0
      1 child:
      0x800004 (has no name): ()  1x1+-1+-1  +-1+-1
   0x800001 "code": ("code" "Code")  10x10+10+10  +10+10
   0x600000 "Chromium clipboard": ()  10x10+-100+-100  +-100+-100

但是在lambda中,输出只显示根窗口,没有子窗口:

Root window id: 0x50d (the root window) (has no name)
Parent window id: 0x0 (none)
   0 children.

这里可能发生了什么?为什么我的应用程序窗口没有出现在xwininfo -tree的输出中?

bnlyeluc

bnlyeluc1#

这是一个半吊子的答案,因为我无法明确解决原始问题的根本原因,但它解释了为什么Visual Studio代码无法启动(并且没有出现在xwininfo中)。如果在Lambda环境中,在Visual Studio代码启动时将--verbose标志传递给它,则会得到如下输出:

prctl(PR_SET_NO_NEW_PRIVS) failed

prctl(PR_SET_NO_NEW_PRIVS) failed

Unable to create argv.json configuration file in /home/sbx_user1051/.vscode/argv.json, falling back to defaults (Error: ENOENT: no such file or directory, mkdir \'/home/sbx_user1051/.vscode\')
[94:1213/213845.593392:ERROR:bus.cc(398)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[94:1213/213845.593463:ERROR:bus.cc(398)] Failed to connect to the bus: Could not parse server address: Unknown address type (examples of valid types are "tcp" and on UNIX "unix")
[94:1213/213845.626853:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[94:1213/213845.626936:ERROR:bus.cc(398)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[94:1213/213845.671433:WARNING:bluez_dbus_manager.cc(248)] Floss manager not present, cannot set Floss enable/disable.
[94:1213/213845.671514:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.671522:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 1 time(s)
[94:1213/213845.672685:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.672708:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 2 time(s)
[94:1213/213845.688115:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.688143:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 3 time(s)
[94:1213/213845.689768:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.689790:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 4 time(s)
[94:1213/213845.690646:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213845.690662:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 5 time(s)
[94:1213/213846.470027:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213846.470054:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 6 time(s)
[94:1213/213846.471084:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213846.471101:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 7 time(s)
[94:1213/213846.471742:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213846.471761:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 8 time(s)
[94:1213/213846.472344:ERROR:gpu_process_host.cc(974)] GPU process launch failed: error_code=1002
[94:1213/213846.472357:WARNING:gpu_process_host.cc(1282)] The GPU process has crashed 9 time(s)
[94:1213/213846.472371:FATAL:gpu_data_manager_impl_private.cc(450)] GPU process isn\'t usable. Goodbye.

问题是,即使VisualStudioCode是基于Electron / Chromium构建的,它似乎还不支持--headless选项(与Chrome相反,经过一些精心的修改,Chrome * 是 * 有可能在Lambda函数中启动的)因此,由于Lambda环境的限制,目前,似乎不可能在lambda环境中启动Visual Studio代码。(我知道有网络版,但我不想这样)。如果每个调用有一个示例就很好了,这对我想完成的事情来说是完美的。我“我将转向其他一些后端基础架构来完成我想做的事情...

相关问题