3

I am running an Ubuntu 18.04.2 LTS VM on a PureOS 8.0 host, running GNOME Boxes 3.30.3 and a QEMU session broker. The VM has spice-vdagent 0.17.0 installed. I cannot get audio in the VM to play.

I have the volume up on the VM and host. The VM sound device is called "Dummy Sound". If I "Test Speakers" with the Sound control panel, or play a YouTube video, there is no sound.

I found a 2016 blog post about running Windows 10 on Boxes that suggests that audio is a Boxes feature:

Self-configuring audio output for Windows 10 and 8 in GNOME Boxes is pending [a bug]. To get audio working you can use one of these two options:

Option 1: [Edit QEMU XML file. I tried this, there is no <sound> tag in my XML file.]

Option 2: [Use USB sound card. I don't have a USB sound card.]

How can I play sound in the VM?

Roman Riabenko
  • 2,145
  • 3
  • 15
  • 39
Noodle
  • 135
  • 1
  • 4

1 Answers1

4

Edit your QEMU.xml to use the Intel HD audio adapter to work around bug #761031.

Open Boxes, perform a full shut down of the virtual machine, and note the auto-assigned name given to the virtual machine. Open up the Terminal and type EDITOR=gedit virsh edit YOURBOXNAME.

If you’ve modified the name after installing, you can find the file in ~/.config/libvirt/qemu/, but don’t edit it directly — rather use the name with the previous command. Add the lines below, save and close the file.

<sound model='ich6'>
  <address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>

Found this in the dead fedoraproject archives.

If slot 0x04 is already used, try 0x06.

If you'd prefer not to edit the XML directly, you can:

  • Install Virtual Machine Manager (virt-manager)
  • Add a new "QEMU/KVM user session" connection to show your Boxes in the VM manager interface
  • Show the virtual hardware details, select "Add Hardware" and add an HDA (ICH6) Sound device (this will select the slot for you)
  • Start the machine in Boxes as normal
Noodle
  • 135
  • 1
  • 4
K7AAY
  • 3,696
  • 4
  • 22
  • 39
  • 1
    When I run the command EDITOR=gedit virsh edit YOURBOXNAME (replacing YOURBOXNAME with xml file name boxes-unknown) I get the error error: failed to get domain 'boxes-unknown' error: Domain not found: no domain with matching name 'boxes-unknown' – uzi3k Dec 29 '19 at 20:28