[WSL2 Ubuntu22.04] 尝试使用 WSLg 运行 Elixir Desktop,未完成

现状

启用 WSLg 后,Elixir Desktop 会不会像在 Ubuntu 上一样工作?

Elixir 桌面示例我试着跑步

窗口显示并似乎在移动,但 Todo 应用程序未显示在窗口中。这是一个空白的显示。

[WSL2 Ubuntu22.04] 尝试使用 WSLg 运行 Elixir Desktop,未完成

显示窗口和菜单。

Extra 的内容也可以单独使用。

如果您使用 Extra 的 Open Browser 打开浏览器,内容将显示在浏览器中。

有了 WSLg 和 systemd 的支持,它的工作方式似乎和原来的 Ubuntu 一样,但不幸的是它没有工作。

处理与 dbus 相关的错误

当 systemd 未运行时,我收到有关 dbus 的错误(默认情况下在 WSL2 中的 ubuntu 上不工作)。

尝试启用 systemd。

不支持旧版本。下面的版本没问题。

> wsl --version
WSL バージョン: 0.70.4.0
カーネル バージョン: 5.15.68.1
WSLg バージョン: 1.0.45
MSRDC バージョン: 1.2.3575
Direct3D バージョン: 1.606.4
DXCore バージョン: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windowsバージョン: 10.0.22621.675

修改 wsl.conf 并关闭 wsl。

/etc/wsl.conf

[boot]
systemd=true

执行结果

$ ./run
Erlang/OTP 25 [erts-13.1.1] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit:ns]


20:12:32.267 [info] Application eex started at :nonode@nohost

20:12:32.272 [info] Application mime started at :nonode@nohost

20:12:32.273 [info] Child Agent of Supervisor Plug.Crypto.Application started
Pid: #PID<0.281.0>
Start Call: Agent.start_link(#Function<0.131734154/0 in Plug.Crypto.Application.start_crypto_keys>)
Restart: :permanent
Shutdown: 5000
Type: :worker

20:12:32.276 [info] Application plug_crypto started at :nonode@nohost

20:12:32.277 [info] Child :telemetry_handler_table of Supervisor :telemetry_sup started
Pid: #PID<0.286.0>
Start Call: :telemetry_handler_table.start_link()
Restart: :permanent
Shutdown: 5000
Type: :worker

20:12:32.277 [info] Application telemetry started at :nonode@nohost

20:12:32.279 [info] Child Plug.Upload of Supervisor Plug.Application started
Pid: #PID<0.291.0>
Start Call: Plug.Upload.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker

20:12:32.279 [info] Application plug started at :nonode@nohost

20:12:32.281 [info] Child :pg of Supervisor #PID<0.295.0> (Supervisor.Default) started
Pid: #PID<0.296.0>
Start Call: :pg.start_link(Phoenix.PubSub)
Restart: :permanent
Shutdown: 5000
Type: :worker

20:12:32.281 [info] Application phoenix_pubsub started at :nonode@nohost

20:12:32.281 [info] Application phoenix_view started at :nonode@nohost

20:12:32.287 [info] Child Phoenix.CodeReloader.Server of Supervisor Phoenix.Supervisor started
Pid: #PID<0.302.0>
Start Call: Phoenix.CodeReloader.Server.start_link([])
Restart: :permanent
Shutdown: 5000
Type: :worker

20:12:32.287 [info] Child Phoenix.Transports.LongPoll.Supervisor of Supervisor Phoenix.Supervisor started
Pid: #PID<0.303.0>
Start Call: DynamicSupervisor.start_link([name: Phoenix.Transports.LongPoll.Supervisor, strategy: :one_for_one])
Restart: :permanent
Shutdown: :infinity
Type: :supervisor

20:12:32.287 [info] Application phoenix started at :nonode@nohost

20:12:32.310 [info] Child :disk_log_sup of Supervisor :kernel_safe_sup started
Pid: #PID<0.304.0>
Start Call: :disk_log_sup.start_link()
Restart: :permanent
Shutdown: 1000
Type: :supervisor

20:12:32.311 [info] Child :disk_log_server of Supervisor :kernel_safe_sup started
Pid: #PID<0.305.0>
Start Call: :disk_log_server.start_link()
Restart: :permanent
Shutdown: 2000
Type: :worker
[error] `inotify-tools` is needed to run `file_system` for your system, check https://github.com/rvoicilas/inotify-tools/wiki for more information about how to install it. If it's already installed but not be found, appoint executable file with `config.exs` or `FILESYSTEM_FSINOTIFY_EXECUTABLE_FILE` env.
[warning] Could not start Phoenix live-reload because we cannot listen to the file system.
You don't need to worry! This is an optional feature used during development to
refresh your browser when you save files and it does not affect production.

Sass is watching for changes. Press Ctrl-C to stop.

[watch] build finished, watching for changes...
[notice] Connecting to UNIX socket: "/run/user/1000/bus"

[notice] DBUS auth: sending initial data

[notice] Got GUID 'e7e1fcc8ed85d4c36cfa796d635e3c2d' from the server

[notice] Succesfully negotiated UNIX FD passing

[notice] Calling "/"::"org.freedesktop.DBus".:Hello([])

[notice] Calling {:ok,
 [
   {:dbus_message,
    {:dbus_header, 108, 1, 0, 1, 0, 1,
     [
       {1, "/"},
       {6, "org.freedesktop.DBus"},
       {2, "org.freedesktop.DBus"},
       {3, "Hello"}
     ]}, :undefined}
 ], ""}
[notice] Received {:dbus_message,
 {:dbus_header, 108, 2, 1, 1, 10, 1,
  [{6, ":1.16"}, {5, 1}, {8, "s"}, {7, "org.freedesktop.DBus"}]}, ":1.16"}

[notice] Received {:dbus_message,
 {:dbus_header, 108, 4, 1, 1, 10, 2,
  [
    {1, "/org/freedesktop/DBus"},
    {2, "org.freedesktop.DBus"},
    {3, "NameAcquired"},
    {6, ":1.16"},
    {8, "s"},
    {7, "org.freedesktop.DBus"}
  ]}, ":1.16"}

[notice] Hello connection id: ":1.16"

[notice] Calling {:ok,
 [
   {:dbus_message,
    {:dbus_header, 108, 1, 0, 1, 34, 2,
     [
       {8, "s"},
       {1, "/org/freedesktop/DBus"},
       {6, "org.freedesktop.DBus"},
       {2, "org.freedesktop.DBus"},
       {3, "NameHasOwner"}
     ]}, "org.kde.StatusNotifierWatcher"}
 ], ""}
[notice] Received {:dbus_message,
 {:dbus_header, 108, 2, 1, 1, 4, 3,
  [{6, ":1.16"}, {5, 2}, {8, "b"}, {7, "org.freedesktop.DBus"}]}, false}

Overriding existing handler for signal 10. Set JSC_SIGNAL_FOR_GC if you want WebKit to use a different signal
                                                                                                             Interactive Elixir (1.14.0) - press Ctrl+C to exit (type h() ENTER for help)

dbus错误不再显示,但显示不变(内容不显示)

参考

https://devblogs.microsoft.com/commandline/systemd-support-is-now-available-in-wsl/

https://x410.dev/cookbook/wsl/sharing-dbus-among-wsl2-consoles/

原创声明:本文系作者授权爱码网发表,未经许可,不得转载;

原文地址:https://www.likecs.com/show-308632242.html