I am trying to get audio working on a Win10 Guest running on a Ubuntu host following this guide https://blog.zerosector.io/2018/07/28/kvm-qemu-windows-10-gpu-passthrough/ .
GPU pass through works however I have issues with audio. The section that describes how to get audio working requires command line arguments to be passed to the VM by editing the first line of the xml file and then adding these lines at the end:
<qemu:env name='QEMU_AUDIO_DRV' value='pa'/>
<qemu:env name='QEMU_PA_SAMPLES' value='8192'/>
<qemu:env name='QEMU_AUDIO_TIMER_PERIOD' value='99'/>
<qemu:env name='QEMU_PA_SERVER' value='/run/user/1000/pulse/native'/>
The issue that I am having is that when I get to the part where I edit my VM configuration with virsh edit win10 the changes are not saved and the following error occurs:
Failed. Try again? [y,n,i,f,?]:
error: XML document failed to validate against schema: Unable to
validate doc against /usr/share/libvirt/schemas/domain.rng
Element domain has extra content: env
I tried both f and i responses, but the xml file does not save and the audio still does not work in the VM.
Doing some research I found that modifying the first line of the xml file from
<domain type='kvm'> to
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
does not have an effect as that schema does not exist anymore (404s). Replacing it with the .rng alternative 'https://libvirt.org/schemas/domain.rng' does not work either.
My question is: How do I pass the required commandline arguments to the machine that already exists and is configured through virt-manager?
EDIT: I decided to try again and I managed to figure it out, thanks to Michael Hampton's reply. Check the answer below.
<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
works fine for me. What is the problem you had with it?<domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
at the start of the file and then adding the environment variables specified creates the error that I described above. It is as if the the xml validation fails because it does not recognise theenv
parameters I am trying to pass.