Skip to main content
Improved formatting
Source Link
karel
  • 13.5k
  • 26
  • 47
  • 54

I found this!. I will be testing it tonight as have the same issue

[http://gurjeet-tech.blogspot.co.uk/2012/09/how-to-install-kvm-with-working-audio.html][1] How to install KVM with a working audio (on Ubuntu)

The things we are trying to fix are:

  1. Make KVM run as a non-root user, specifically, as your login, so that it can share your ALSA audio.

  2. Make KVM to not disable audio.

  3. Replace the KVM binary with a script that sets up proper environment variable, so that KVM and use your alsa audio driver. Instructions follow:

cd /usr/bin

sudo mv kvm kvm.bin

sudo touch kvmInstructions follow:

sudo chmod +x kvm

cd /usr/bin  
sudo mv kvm kvm.bin  
sudo touch kvm  
sudo chmod +x kvm  

Edit /usr/bin/kvm/usr/bin/kvm and paste this text in it:

#!/bin/sh

QEMU_AUDIO_DRV=alsa /usr/bin/kvm.bin $@

#!/bin/sh  
QEMU_AUDIO_DRV=alsa /usr/bin/kvm.bin $@

Edit /etc/libvirt/qemu.conf/etc/libvirt/qemu.conf and look for the following lines (remember all these lines are in different sections of this file)  :

vnc_allow_host_audio = 0

#user = "root"

#group = "root"

vnc_allow_host_audio = 0
#user = "root"
#group = "root"

and replace root with your local user name, for example: vnc_allow_host_audio = 1

user = "gurjeet"vnc_allow_host_audio = 1

group = "gurjeet"

user = "gurjeet"
group = "gurjeet"

Now) Now restart the KVM service:

sudo service libvirt-bin restart

sudo service libvirt-bin restart

Now launch your guest OS and enjoy its sound.

found this! I will be testing it tonight as have the same issue

[http://gurjeet-tech.blogspot.co.uk/2012/09/how-to-install-kvm-with-working-audio.html][1]

The things we are trying to fix are:

  1. Make KVM run as a non-root user, specifically, as your login, so that it can share your ALSA audio.

  2. Make KVM to not disable audio.

  3. Replace the KVM binary with a script that sets up proper environment variable, so that KVM and use your alsa audio driver. Instructions follow:

cd /usr/bin

sudo mv kvm kvm.bin

sudo touch kvm

sudo chmod +x kvm

Edit /usr/bin/kvm and paste this text in it:

#!/bin/sh

QEMU_AUDIO_DRV=alsa /usr/bin/kvm.bin $@

Edit /etc/libvirt/qemu.conf and look for the following lines (remember all these lines are in different sections of this file)  :

vnc_allow_host_audio = 0

#user = "root"

#group = "root"

and replace root with your local user name, for example: vnc_allow_host_audio = 1

user = "gurjeet"

group = "gurjeet"

Now restart the KVM service

sudo service libvirt-bin restart

Now launch your guest OS and enjoy its sound.

I found this. I will be testing it tonight as have the same issue: How to install KVM with a working audio (on Ubuntu)

The things we are trying to fix are:

  1. Make KVM run as a non-root user, specifically, as your login, so that it can share your ALSA audio.

  2. Make KVM to not disable audio.

  3. Replace the KVM binary with a script that sets up proper environment variable, so that KVM and use your alsa audio driver.

Instructions follow:

cd /usr/bin  
sudo mv kvm kvm.bin  
sudo touch kvm  
sudo chmod +x kvm  

Edit /usr/bin/kvm and paste this text in it:

#!/bin/sh  
QEMU_AUDIO_DRV=alsa /usr/bin/kvm.bin $@

Edit /etc/libvirt/qemu.conf and look for the following lines (remember all these lines are in different sections of this file):

vnc_allow_host_audio = 0
#user = "root"
#group = "root"

and replace root with your local user name, for example: vnc_allow_host_audio = 1

user = "gurjeet"
group = "gurjeet"

) Now restart the KVM service:

sudo service libvirt-bin restart

Now launch your guest OS and enjoy its sound.

Source Link

found this! I will be testing it tonight as have the same issue

[http://gurjeet-tech.blogspot.co.uk/2012/09/how-to-install-kvm-with-working-audio.html][1]

The things we are trying to fix are:

  1. Make KVM run as a non-root user, specifically, as your login, so that it can share your ALSA audio.

  2. Make KVM to not disable audio.

  3. Replace the KVM binary with a script that sets up proper environment variable, so that KVM and use your alsa audio driver. Instructions follow:

cd /usr/bin

sudo mv kvm kvm.bin

sudo touch kvm

sudo chmod +x kvm

Edit /usr/bin/kvm and paste this text in it:

#!/bin/sh

QEMU_AUDIO_DRV=alsa /usr/bin/kvm.bin $@

Edit /etc/libvirt/qemu.conf and look for the following lines (remember all these lines are in different sections of this file) :

vnc_allow_host_audio = 0

#user = "root"

#group = "root"

and replace root with your local user name, for example: vnc_allow_host_audio = 1

user = "gurjeet"

group = "gurjeet"

Now restart the KVM service

sudo service libvirt-bin restart

Now launch your guest OS and enjoy its sound.