No Audio in Whonix WS AppVM

My average workspace uses 10 VMs, of which 6 are Whonix-related.

The 4 Fedora21 VMs currently have proper audio, although looks like there was an issue in the past:
Occasioanlly, in some rare cases, sound does not work in a VM · Issue #787 · QubesOS/qubes-issues · GitHub : (Occasioanlly, in some rare cases, sound does not work in a VM)

Of the 6 Whonix VMs, 3 had audio (VM Manager ‘Attach/Detach Audio Input…’ enabled) on 1 run, 2 on 2nd reboot, 3 on 3rd reboot. Shutting down and restarting VM does not solve. Rebooting the entire machine seems to have some effect that’s not completely random but I havent been able to identify.

To confirm no audio, ‘pactl list’ shows Sink #0 Name: auto_null instead of vchan_output.

Running ‘pactl -nF /etc/pulse/qubes-default.pa’ restores audio for the current session but does not persist. It seems on VM startup, the qubes-default.pa is not running as it is supposed to.

Perhaps, related issues:
Known Issue: No Sound/Audio Output [BUG]: Whonix Forum
Audio Sometimes Not Working in Qubes: ⚓ T134 Audio Sometimes Not Working in Qubes

I can’t tell if this issue is related to any prior links because I don’t know how to view these past commits, such as:
http://git.qubes-os.org/?p=marmarek/gui-daemon.git;a=commit;h=62885a8b1fb807dfbbccc6d80f3b4a9aca66fa50

VM with bad audio has process:
/usr/bin/pulseaudio --start

VM with good audio:
pulseaudio --start -n --file=/etc/pulse/qubes-default.pa --exit-idle-time=-1

Posted wrong command earlier. To temporarily restore audio, use:
pulseaudio -nF /etc/pulse/qubes-default.pa
or
start-pulseaudio-with-vchan

Still don’t know why wrong process is loading at startup.

I don’t have this issue, but I am using Whonix 11. This used to be an issue I had fixed with making sure original pulseaudio.desktop was not started,

Is this a recent issue, or has it been happening for over 2 weeks?

Which version of Whonix you using?

Have you applied apt-get update && apt-get dist-upgrade in last 2 weeks?

Do you have the qubes testers repo enabled when applying updates?

What kernel is used for Whonix VM?

Does start-pulseaudio-with-vchan resolve issue when running manually

Does /usr/share/qubes/xdg/autostart/pulseaudio.desktop file exist with an entry of NotShowIn=QUBES or Does /var/lib/qubes/xdg/autostart/pulseaudio.desktop file exist with an entry of NotShowIn=X-QUBES.

Some other tests to help out… In whonix-ws TemplateVM can you remove (or move the file elsewhere) the /etc/xdg/autostart/pulseaudio.desktop file?

EDIT:

Also which version of Qubes you using (Release 2 or 3)?

[quote=“nrgaway, post:3, topic:1330”]Is this a recent issue, or has it been happening for over 2 weeks?

Which version of Whonix you using?[/quote]

The AppVM was originally created using a Whonix 10 WS Template. After the release of Whonix 11, I kept the same AppVM and switched templates to the new version. Not completely sure, but seems to me this issue started with transition to 11.

[quote=“nrgaway, post:3, topic:1330”]Have you applied apt-get update && apt-get dist-upgrade in last 2 weeks?

Do you have the qubes testers repo enabled when applying updates?[/quote]

Yes to updates. Don’t know about testers repo. Just Whonix Stable I think.

uname -r
3.18.17-5.pvops.qubes.x86_64

Yes. First need to kill /usr/bin/pulseaudio --start
pulseaudio -nF /etc/pulse/qubes-default.pa also works to restore audio temporarily.

[quote=“nrgaway, post:3, topic:1330”]Does /usr/share/qubes/xdg/autostart/pulseaudio.desktop file exist with an entry of NotShowIn=QUBES or Does /var/lib/qubes/xdg/autostart/pulseaudio.desktop file exist with an entry of NotShowIn=X-QUBES.

Some other tests to help out… In whonix-ws TemplateVM can you remove (or move the file elsewhere) the /etc/xdg/autostart/pulseaudio.desktop file?[/quote]

/usr/share/qubes/xdg/autostart/pulseaudio-kde.desktop says NotShowIn=QUBES
and exec=start-pulseaudio-kde
/var/lib/qubes/xdg/autostart/pulseaudio.desktop says NotShowIn=X-QUBES
and exec=start-pulseaudio-x11

Should I touch the TemplateVM? Some AppVMs based on the Template work properly… (these also brought over from Whonix 10)

Thanks for helping.

EDIT:

[quote=“nrgaway, post:3, topic:1330”]EDIT:

Also which version of Qubes you using (Release 2 or 3)?[/quote]
Qubes Release 3 RC2

[quote=“nrgaway, post:3, topic:1330”]Does /usr/share/qubes/xdg/autostart/pulseaudio.desktop file exist with an entry of NotShowIn=QUBES or Does /var/lib/qubes/xdg/autostart/pulseaudio.desktop file exist with an entry of NotShowIn=X-QUBES.

Some other tests to help out… In whonix-ws TemplateVM can you remove (or move the file elsewhere) the /etc/xdg/autostart/pulseaudio.desktop file?[/quote]

/usr/share/qubes/xdg/autostart/pulseaudio-kde.desktop says NotShowIn=QUBES and exec=start-pulseaudio-kde /var/lib/qubes/xdg/autostart/pulseaudio.desktop says NotShowIn=X-QUBES and exec=start-pulseaudio-x11

Should I touch the TemplateVM? Some AppVMs based on the Template work properly… (these also brought over from Whonix 10)

The issue seems to be qubes-whonix is using old path for XDG (/usr/share/qubes/xdg/autostart/) which was just changed in last 2 weeks… You can either delete the pulseaudio-kde.desktop in /etc/xdg/autostart or copy the contents of /usr/share/qubes/xdg/autostart to /var/lib/qubes/xdg/autostart in the TemplateVM.

We will need to release a qubes-whonix update for permanent fix.

Patrick, you want me to update qubes-whonix master in my repo? Just need to change XDG path and change QUBES to X-QUBES for better form.

Yes. Whonix 11 branch mostly. Looks like this requires a stable update. I then try to forward port the patch to master.

Copying the contents of /usr/share/qubes/xdg/autostart to /var/lib/qubes/xdg/autostart did not solve. Sorry for being dense but I don’t know which files are supposed to be where and I don’t want to mess up my template for any patches to come. Here’s what I’ve got:

/usr/share/qubes/xdg/autostart:
pulseaudio-kde.desktop

/var/lib/qubes/xdg/autostart:
pulseaudio.desktop
pulseaudio-kde.desktop

/etc/xdg/autostart:
pulseaudio.desktop
pulseaudio-kde.desktop
qubes-pulseaudio.desktop

Seems like qubes-pulseaudio.desktop is the only one I need right? Do I delete everything else?

! Also, there is one other file in /usr/share/qubes/xdg/autostart:
whonix-setup-wizard.desktop
I also copied that to /var/lib/qubes/xdg/autostart and changed QUBES to X-QUBES.
Now, templateVM asks if I want to enable Tor. Tor should NOT be enabled, right? else you get tor over tor when it updates through the whonix gateway?

Audio is resolved. Thanks for your help.

I’ll save Patrick a post:

Whonix is based on Debian
http://standards.freedesktop.org/autostart-spec/autostart-spec-latest.html

EDIT:
Solution:

  1. Edit *.desktop files in /usr/share/qubes/xdg/autostart:
    Change NotShowIn=QUBES to NotShowIn=X-QUBES
  2. sudo mv /usr/share/qubes/xdg/autostart/* /var/lib/qubes/xdg/autostart
  3. Edit /usr/bin/qubes-session:
    Change XDG_CONFIG_QUBES=“/usr/share/qubes/xdg” to XDG_CONFIG_QUBES=“/var/lib/qubes/xdg”

It seems you did not also have the updated qubes-session. I will make sure repo is updated with it as well this week.

Thanks for all the detailed error reporting :slight_smile:

Looking at your commits in the Whonix 11 branch…

Probably won’t work. No such script.

And I am wondering how to port this to master (Whonix 12).

[hr]

Files:

'gateway_first_run_notice' 'spice-vdagent' 'whonixsetup' 'whonix-setup-wizard'

Short answer, nevermind: solved upstream.

[hr]

I guess the whole etc/qubes/triggers.d/whonix-trigger-desktop-file-install.trigger can be avoided in Whonix 12. There should be no need for any Whonix specific xdg modifications.

The only missing file may be /etc/xdg/autostart/pulseaudio-kde.desktop. But I don’t see why this should be handled in the qubes-whonix package. So can you just fix this in qubes-core-agent-linux?

Updated from qubes jessie-testing repository.

Before update.

ii  libqubesdb                                   3.0.4-1+deb8u1                       amd64        QubesDB libs.
ii  qubes-core-agent                             3.0.15-1+deb8u1                      amd64        Qubes core agent
ii  qubes-gpg-split                              2.0.11-1+jessie1                     amd64        The Qubes service for secure gpg separation
ii  qubes-gui-agent                              3.0.9+deb8u1                         amd64        Makes X11 windows available to qubes dom0
ii  qubes-pdf-converter                          2.0.3-1+jessie1                      amd64        The Qubes service for converting untrusted PDF files into trusted ones
ii  qubes-thunderbird                            1.2.7-1+jessie1                      amd64        The Qubes extension for Thunderbird
ii  qubes-utils                                  3.0.10+deb8u1                        amd64        Qubes Linux utilities
ii  qubes-whonix                                 1:4.2-1                              all          Qubes Configuration for Whonix-Gateway and Whonix-Workstation
ii  qubesdb                                      3.0.4-1+deb8u1                       amd64        QubesDB management tools and daemon.
ii  qubesdb-vm                                   3.0.4-1+deb8u1                       amd64        QubesDB VM service.                                                              

After update:

ii libqubesdb 3.0.5-1+deb8u1 amd64 QubesDB libs. ii qubes-core-agent 3.0.15-1+deb8u1+devel1 amd64 Qubes core agent ii qubes-gpg-split 2.0.11-1+jessie1 amd64 The Qubes service for secure gpg separation ii qubes-gui-agent 3.0.10+deb8u1 amd64 Makes X11 windows available to qubes dom0 ii qubes-pdf-converter 2.0.3-1+jessie1 amd64 The Qubes service for converting untrusted PDF files into trusted ones ii qubes-thunderbird 1.2.7-1+jessie1 amd64 The Qubes extension for Thunderbird ii qubes-utils 3.0.10+deb8u1 amd64 Qubes Linux utilities ii qubes-whonix 1:4.2-1 all Qubes Configuration for Whonix-Gateway and Whonix-Workstation ii qubesdb 3.0.5-1+deb8u1 amd64 QubesDB management tools and daemon. ii qubesdb-vm 3.0.5-1+deb8u1 amd64 QubesDB VM service.

diff:

[code]
1,2c1,2
< ii libqubesdb 3.0.4-1+deb8u1 amd64 QubesDB libs.
< ii qubes-core-agent 3.0.15-1+deb8u1 amd64 Qubes core agent

ii libqubesdb 3.0.5-1+deb8u1 amd64 QubesDB libs.
ii qubes-core-agent 3.0.15-1+deb8u1+devel1 amd64 Qubes core agent
4c4
< ii qubes-gui-agent 3.0.9+deb8u1 amd64 Makes X11 windows available to qubes dom0


ii qubes-gui-agent 3.0.10+deb8u1 amd64 Makes X11 windows available to qubes dom0
9,10c9,10
< ii qubesdb 3.0.4-1+deb8u1 amd64 QubesDB management tools and daemon.
< ii qubesdb-vm 3.0.4-1+deb8u1 amd64 QubesDB VM service.


ii qubesdb 3.0.5-1+deb8u1 amd64 QubesDB management tools and daemon.
ii qubesdb-vm 3.0.5-1+deb8u1 amd64 QubesDB VM service.[/code]

Rebooted Qubes-Whonix-Workstation (12ish development version) 4 times. Youtube, sound in Tor Browser was working reliable all times. I conclude, this is not a Qubes-Whonix specific problem. Requires no fix inside Qubes-Whonix.

Link: