Spice audio does not work when spicy is opened from lxc console --type vga

Hi,

Audio does not work when spicy is opened using:

lxc console win11 --type vga

However audio works with this same instance if I open spicy from cli and use this same spice socket:

spicy --uri=spice+unix:///home/mika/snap/lxd/common/config/sockets/1062376126.spice

This is probably related to some privilege issue (e.g. cannot connect to dbus) when spicy is opened from lxd snap package.

Lxc console command outputs errors like:

(spicy:1633481): dbind-WARNING **: 23:05:45.126: Couldn't register with accessibility bus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
GSpice-Message: 23:05:45.182: main channel: opened
/dev/shm/jack_db-0/__db.001: No such file or directory

These errors are not shown if I open spicy from cli.

Instance configuration is:

lxc config show win11
architecture: x86_64
config:
  limits.cpu: "4"
  limits.memory: 8GiB
  raw.qemu: -audio spice -device ich9-intel-hda -device hda-micro
  volatile.cloud-init.instance-id: c77e9688-e8ce-4b50-9d1b-79b53998732c
  volatile.eth0.host_name: tap7437aeb3
  volatile.eth0.hwaddr: 00:16:3e:42:a1:ae
  volatile.last_state.power: RUNNING
  volatile.last_state.ready: "false"
  volatile.uuid: 49c1e18e-208a-4115-bf58-1fa7e47a3cd0
  volatile.uuid.generation: 49c1e18e-208a-4115-bf58-1fa7e47a3cd0
  volatile.vsock_id: "2399700194"
devices:
  install:
    boot.priority: "10"
    source: /home/mika/work/windows-lxd/win11.lxd.iso
    type: disk
  root:
    path: /
    pool: default
    size: 50GiB
    type: disk
  vtpm:
    path: /dev/tpm0
    type: tpm
ephemeral: false
profiles:
- default
stateful: false
description: ""
1 Like

Hey,

Could you please let us know a bit more about your environment so that we can try to reproduce the issue? What’s the host OS (lsb_release -rc), kernel version (uname -a) and LXD version (snap list lxd)?

Thanks

Hi,

Certainly:

> uname -a
Linux SOLPF4F14Z4 6.5.0-35-generic #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May  7 09:00:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
> lsb_release -rc
Release:	22.04
Codename:	jammy
> snap list lxd
Name  Version         Rev    Tracking       Publisher   Notes
lxd   5.21.1-2d13beb  28463  latest/stable  canonical✓  -
> snap connections lxd
Interface       Plug                  Slot             Notes
content         lxd:ceph-conf         -                -
content         lxd:ovn-certificates  -                -
content         lxd:ovn-chassis       -                -
lxd             -                     lxd:lxd          -
lxd-support     lxd:lxd-support       :lxd-support     -
network         lxd:network           :network         -
network-bind    lxd:network-bind      :network-bind    -
system-observe  lxd:system-observe    :system-observe  -

Here is a process tree view of this situation:

In the top spicy the audio works but in spicy forked from lxc process audio does not work.

This is perfectly fine but please know that latest/stable is a moving target so currently is has 5.21 which is an LTS version but when we publish a new feature release (soon), it will have your machine upgrade to a non-LTS.

In other words, please double check that you intend to be on a feature track and not the last LTS one. If you want to switch, now’s a good time, see LXD 5.21.1 LTS has been released for the exact snap refresh command to use.

Now, thanks for providing the version information, I’ll try to replicate the issue here.

1 Like

One way to easily circumvent this issue is to use other spice clients than spicy or virt-viewer e.g. remmina or install them from other source than apt e.g. flathub so that lxd cannot find them.

Then you can just start your favorite spice client manually and use the socket from lxc console command output.

Maybe cli applications like lxd should not open graphical applications because this seems like a permission rabit hole which is not otherwise needed in lxd package.