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 / 问题 / 1532894
Accepted
Shobhit Verma
Shobhit Verma
Asked: 2024-11-14 14:03:48 +0800 CST2024-11-14 14:03:48 +0800 CST 2024-11-14 14:03:48 +0800 CST

GDK 后端:wayland(HelloWorldGuiApp:91366):Gtk-WARNING **:22:44:58.503:无法打开显示::0

  • 772

我正在使用 .net 和 sdk 创建一个简单的 hello world GUI 应用程序,当我将它转换为 snap 并运行它时,我首先收到此错误,我确实添加了 x11 包,但我希望我的应用程序仅使用 wayland 服务器进行显示,因为我正在为 ubuntu 核心构建此应用程序。

GDK Backend: wayland (HelloWorldGuiApp:91366):Gtk-WARNING **: 22:44:58.503: cannot open display: :0

这是我的 .net apk 的 snapcraft.yaml。

{
name: helloworldguiapp

base: core22

version: ‘1.0’

summary: A simple Hello World GUI app

description: | This is a simple .NET Gtk# Hello World GUI application designed to run in kiosk mode using ubuntu-frame.

grade: stable

confinement: strict

architectures:

build-on: amd64
build-on: arm64
apps:

helloworldguiapp:

command: HelloWorldGuiApp
daemon: simple
restart-condition: always
plugs:
  - wayland
  - opengl
  - network
  - content[graphics-core22]  # Added the missing graphics-core22 plug
environment:
  WAYLAND_DISPLAY: wayland-0
parts:

helloworldguiapp:

plugin: dotnet
dotnet-build-configuration: Release
dotnet-self-contained-runtime-identifier: linux-x64
source: .
build-packages:
  - dotnet-sdk-8.0
stage-packages:
  - libgtk-3-0
  - libglib2.0-0
  - libwayland-client
}

我应该对我的 yaml 文件做哪些更改?

我尝试在 ubuntu core 上运行 .net snap,并期望它在 ubuntu core 上打开 hello world gui,但却出现了这个警告=>

GDK Backend: wayland (HelloWorldGuiApp:91366):Gtk-WARNING **: 22:44:58.503: cannot open display: :0
xorg
  • 2 2 个回答
  • 70 Views

2 个回答

  • Voted
  1. Alan Griffiths
    2024-11-15T20:03:15+08:002024-11-15T20:03:15+08:00

    我不知道.net 部分,但是因为它似乎是基于 gtk,所以这应该是一个很好的开始:

    https://mir-server.io/docs/packaging-a-gtk3-application-as-an-iot-gui

    • 0
  2. Best Answer
    Alan Griffiths Canonical
    2024-12-06T01:15:48+08:002024-12-06T01:15:48+08:00

    2024-11-22T13:05:06Z -[29742]:未找到设置门户:没有 X11 $DISPLAY 无法自动启动 D-Bus

    这看起来好像您的应用正在尝试使用桌面门户。但没有桌面会话。如果您的应用在没有 dbus 的情况下无法运行,请查看 Qt 示例。

    2024-11-22T13:05:06Z helloworld-gui-app.daemon[29742]: xkbcommon: 错误:无法添加默认包含路径 /usr/share/X11/xkb

    这看起来像是尝试访问XKB_CONFIG_ROOTsnap 之外的内容,但在核心系统上无法实现,因为预期的文件不存在。尝试将其添加到您的 app.environment 中:

    XKB_CONFIG_ROOT: $SNAP/usr/share/X11/xkb
    

    xkb-data如果尚未实施,您可能还需要进行分阶段。

    2024-11-22T13:05:09Z systemd[1]: snap.helloworld-gui-app.daemon.service: 主进程已退出,代码=dumped,状态=11/SEGV

    嗯,可能由于上述原因,您的应用程序出现段错误。

    .net 是否不支持仅使用 wayland?.net 是否不支持 ubuntu-core 的 GUI 应用程序?

    没有明显的理由说明这行不通。但应用程序可能需要进行一些配置才能与 snap confinement 配合使用。

    • 0

相关问题

  • 如何从命令行重新启动 X Window Server?

  • xorg 中是否有用于更改视频驱动程序的 GUI?

  • 类似于 Eyefinity 的东西?

  • 如何重置我的键盘布局?

  • 帮助让 Flash 播放器在第二个屏幕上工作?

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