Can KVM simulate non-GPU devices so they could be shared among VMs?


Recommended Posts

Hi,

 

My current and biggest gripe with unraid is that to be able to run 2 VMs at the same time I need to double up on every hardware I want to use in those VMs. I googled stuff like "kvm sharing devices" but didn't find anything that could hint it is possible to do. So either my google-fu sucks or that's not the way KVM works or maybe it's just not how all type1 hypervisors work.

 

What I thought I will get when switching from bare metal Windows to unraid?

 

Well, I hoped to have work VM running and my home/gaming VM running at the same time. I hoped I could use same sound card and same webcam on both of them so when my friend calls me on my private skype I would be able to answer as well as I could have calls with my work team mates on my work skype in my work VM.

 

But reality is different. I need to run either work VM or home VM. And very often when I switch between them by shutdown in current and starting up the other I get boot issues which I guess stem from devices not being properly released by first VM. So I have to reboot whole system.

 

I guess what I was expecting was VirtualBox on steroids. Seamless virtualization environment but with real GPU where I need it. I hoped everything else to be as easy as in VirtualBox. Need a sound card? Sure, here's emulated one. Need real one? Sure, here's list of your devices, please select one. Even if I had to use command line to do it I wouldn't complain because I would get what I want and need to have to not feel pain every time I need to jump from one VM to another.

 

I expected more power and capabilities but it seems like what I got is just more issues than it's worth.

 

Just to be clear: I don't blame unraid or kvm or anybody here. When tool is not right for the work it's not tool to blame. I think unard is great when used as it was meant to be used but I would like to know if my needs can even be met in kvm world in general (for example would it be possible when running KVM in Fedora or other Linux OS?) or I should just get back to VirtualBox and stop whining?

 

I would really appreciate the answer because right now I kind of wasted a lot of time to have stuff setup but the more I try to like it the more problems I discover and I really think about installing my Win10 on bare metal and get back to my boring but free of such issues.

Link to comment

 

Well, I hoped to have work VM running and my home/gaming VM running at the same time. I hoped I could use same sound card and same webcam on both of them so when my friend calls me on my private skype I would be able to answer as well as I could have calls with my work team mates on my work skype in my work VM.

 

That makes it sound like you want two machines to use the same soundcard concurrently.....  :-\ 

 

You do have a point with hardware not being released on shutdowns.

Link to comment

There is audio support within KVM, however it requires that the underlying linux system its running on have fully configured audio support of which unraid does not have. (yet?!)

 

 

A cheap work around maybe would be for you to use a $5 usb sound card for one vm such as https://www.amazon.com/Sabrent-External-Adapter-Windows-AU-MMSA/dp/B00IRVQ0F8/ref=zg_bs_3015427011_1

Link to comment

There is audio support within KVM, however it requires that the underlying linux system its running on have fully configured audio support of which unraid does not have. (yet?!)

 

A cheap work around maybe would be for you to use a $5 usb sound card for one vm such as https://www.amazon.com/Sabrent-External-Adapter-Windows-AU-MMSA/dp/B00IRVQ0F8/ref=zg_bs_3015427011_1

 

I've activated a load of stuff in the kernel for the DVB builds.  Might want to try it.  Use the LibreELEC one.  If anything else needs activating then let me know and I can do that with the next build.

Link to comment

Ok thanks CHMB I will try maybe later see if i can get to work

 

xml code would look like this

 
    <sound model='ich6'/>
  </sound>

  

 

put in between the  <devices>  </devices> part in xml

 

These can be emulated

pcspk        PC speaker

sb16          Creative Sound Blaster 16

ac97          Intel 82801AA AC97 Audio

es1370      ENSONIQ AudioPCI ES1370

ich6          Intel ich6

usb

 

 

Link to comment

I can get virtual emulated sound card working with windows 10 but only streaming via rdp. Vnc streaming will not work with sound  (would be so nice to have spice in unraid as opposed to vnc) only rdp or other third party remote desktop software that supports sound redirection.

 

What I wanted to achieve was to be able to configure the motherboard onboard sound to be connected to unraid. Then when using an emulated sound card in the vm to  have the sound output through motherboard of server. The advantage being not having to passthrough audio and have vms "share" audio as the original poster edgeinterface was suggesting. I know this is possible but my knowledge of how to do this is lacking!!!

Link to comment

I can get virtual emulated sound card working with windows 10 but only streaming via rdp. Vnc streaming will not work with sound  (would be so nice to have spice in unraid as opposed to vnc) only rdp or other third party remote desktop software that supports sound redirection.

 

What I wanted to achieve was to be able to configure the motherboard onboard sound to be connected to unraid. Then when using an emulated sound card in the vm to  have the sound output through motherboard of server. The advantage being not having to passthrough audio and have vms "share" audio as the original poster edgeinterface was suggesting. I know this is possible but my knowledge of how to do this is lacking!!!

 

Yep, that sounds exactly like what I would want to have. If that's only a matter of know-how it's good because probably somebody knows how and maybe will do it :)

Link to comment

For time being I switched back to bare metal win10. I don't think type1 hypervisor environment is for me right now. All the issues with locked devices when switching between vms and lack of sharing basic devices like mouse keyboard and sound card made my daily use of computer more problematic than it's worth. That's not a fault of unraid but rather me not really understanding how things work.

 

I will keep my unraid usb stick and will keep checking out what's happening but for now I'm giving up.

Link to comment
  • 3 years later...
On 7/25/2016 at 11:33 AM, SpaceInvaderOne said:

Ok thanks CHMB I will try maybe later see if i can get to work

 

xml code would look like this

 


 
    <sound model='ich6'/>
  </sound>

  
 

 

 

put in between the  <devices>  </devices> part in xml

 

These can be emulated

pcspk        PC speaker

sb16          Creative Sound Blaster 16

ac97          Intel 82801AA AC97 Audio

es1370      ENSONIQ AudioPCI ES1370

ich6          Intel ich6

usb

 

 

 

Thread necro time but,...

 

The way I read it, you need mobo sound activated and a pulse audio driver running and the your QEMU can pretend to have "sb16" sound in your Win98 VM and it would come out of the mobo sound ports.   Would be sweet for some of the retro and quirky OS emulation.... I can think of 3 cases I would love to try

Link to comment
  • 6 months later...

@SpaceInvaderOne

 

This is an old necro thread so this might be old news. I run a virtual sound device on my unraid server (ac97) and use it fine through virt-manager with spice to view. I found your post kind of amusing since I used your guide to setup the virt-manager link. Maybe unraid devs added something since your post though that made this possible.

 

If that didn't work I was probably going to use scream audio or some other network sound device but it would be a long clunkier of a workflow.

  • Like 1
Link to comment
  • 3 months later...
On 12/15/2020 at 4:58 PM, scorcho99 said:

@SpaceInvaderOne

 

This is an old necro thread so this might be old news. I run a virtual sound device on my unraid server (ac97) and use it fine through virt-manager with spice to view. I found your post kind of amusing since I used your guide to setup the virt-manager link. Maybe unraid devs added something since your post though that made this possible.

 

If that didn't work I was probably going to use scream audio or some other network sound device but it would be a long clunkier of a workflow.

 

The zombie thread wont die...

 

I hope I am not confusing matters (and am not running unRAID right now) but do we not need hardware drivers in unRAID for sound cards like a basic Pulse audio driver for Realtek ALC (that seems to be 95% of mobos these days) so that we can define ac97 or sb16 in the VM XML and have that emulated device output sound via the onboard mobo audio? Or is that already possible?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.