Virt-Manager Qemu/KVM USB problem

New to Debian (Or Linux in general)? Ask your questions here!

Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-08 22:23

Hello.

I'm having an issue when trying to add an external USB hard disk to my Virt-Manager. I'm trying some new stuff in a Debian environment inside Virt-Manager.

These are the steps I take.

On VM settings I set USBController to USB3.0
Image

Then, click on "Add hardware" button
Image

Then, I choose "USB Host Device" and click on my "Western Digital" external USB drive and "Finish".
Image

The hardware is added and visible:
Image

When I try to run my VM I get this error:
Image


This drive is not mounted in my laptop (host) so it's not being used (I guess).
'lsusb' shows the drive there and it's ok.

Anyone knows what is wrong?
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Re: Virt-Manager Qemu/KVM USB problem

Postby CwF » 2019-08-09 01:55

Don't pre-attach it.
AFTER the vm is up and running use the menu on the viewer window to attach usb devices dynamically. The alternate virt-viewer has a nicer menu to do so. The cli option to do so is stupid complex.

Option 2, vfio pass a real port to total usb control withing the vm. Then you could boot from it.
CwF
 
Posts: 446
Joined: 2018-06-20 15:16

Re: Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-09 18:37

I think I tried that and I got a message saying that I had "no free USB ports".

I have no idea what to do to fix this. I searched Google/DuckDuckGo but no relevant results came up!
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Re: Virt-Manager Qemu/KVM USB problem

Postby CwF » 2019-08-09 19:21

Assuming your vm has usb ports...
You do NOT use virt-manager!

repeat, once the vm is running, that window has a menu, the tab is 'Virtual Machine' and the last menu entry is 'Redirect USB Device'.

part 1a, if you are using virt-viewer the menu is 'File'> 'USB Device Selection'

The device shows up on the host, then you do either the above and onto the vm it goes.

Note both viewers have a drop down while in full screen (hover top edge center) and virt-viewer has a usb icon right there..

Totally different is using vfio to pass the usb PORT, using the manager to attach the PCI HOST DEVICE.

I recommend not using virt-managers 'Add Hardware'> 'USB Host Device' prior to starting the vm, because...
CwF
 
Posts: 446
Joined: 2018-06-20 15:16

Re: Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-09 21:27

CwF wrote:Assuming your vm has usb ports...
You do NOT use virt-manager!

repeat, once the vm is running, that window has a menu, the tab is 'Virtual Machine' and the last menu entry is 'Redirect USB Device'.

part 1a, if you are using virt-viewer the menu is 'File'> 'USB Device Selection'

The device shows up on the host, then you do either the above and onto the vm it goes.

Note both viewers have a drop down while in full screen (hover top edge center) and virt-viewer has a usb icon right there..

Totally different is using vfio to pass the usb PORT, using the manager to attach the PCI HOST DEVICE.

I recommend not using virt-managers 'Add Hardware'> 'USB Host Device' prior to starting the vm, because...


Where do I check if my VM has USB ports?

I don't understand what you mean by "You do NOT use vit-manager". That's what I'm using. Virt-Manager and Qemu/KVM...
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Re: Virt-Manager Qemu/KVM USB problem

Postby CwF » 2019-08-09 21:59

Once you have a vm running, in a window, a window that is not the virt-manager window, but the particular vm window, that has the menu.

The window title will be "buster on Qemu/KVM", or whatever on Qemu/KVM. That window does NOT have a title of "Virtual Machine Manager"

So if no vm is not running, you have no window! Get the vm running, then start poking around its menu choices...You are not probing hard enough.
CwF
 
Posts: 446
Joined: 2018-06-20 15:16

Re: Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-09 22:28

CwF wrote:Once you have a vm running, in a window, a window that is not the virt-manager window, but the particular vm window, that has the menu.

The window title will be "buster on Qemu/KVM", or whatever on Qemu/KVM. That window does NOT have a title of "Virtual Machine Manager"

So if no vm is not running, you have no window! Get the vm running, then start poking around its menu choices...You are not probing hard enough.



Ah ok, I completely misunderstood your sentence. Ok, I'll try that!
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Re: Virt-Manager Qemu/KVM USB problem

Postby CwF » 2019-08-09 23:31

Sorry, my focus is distracted, let me start over. I'm mixing in my use of a different viewer...


In your first screen shot this is the vm window, the right one!

The menu is 'File' 'Virtual Machine' 'View' 'Send Key'.

Click on 'Virtual Machine' and tell me what is the bottom menu entry.

Should be 'Redirect USB Device'.

Click on that while the icon 'Show the Graphical Console' is active, the one to the left of the active 'Show Virtual Hardware Details' in your screen shot.

The option 'Redirect USB Device' is greyed out unless the vm is running.
CwF
 
Posts: 446
Joined: 2018-06-20 15:16

Re: Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-10 08:08

CwF wrote:Sorry, my focus is distracted, let me start over. I'm mixing in my use of a different viewer...


In your first screen shot this is the vm window, the right one!

The menu is 'File' 'Virtual Machine' 'View' 'Send Key'.

Click on 'Virtual Machine' and tell me what is the bottom menu entry.

Should be 'Redirect USB Device'.

Click on that while the icon 'Show the Graphical Console' is active, the one to the left of the active 'Show Virtual Hardware Details' in your screen shot.

The option 'Redirect USB Device' is greyed out unless the vm is running.


No, you were right. It's just that the sentence was like duplicate meaning... And I caught the one I shouldn't. (I mean when you said "I do NOT use Vit-Manager"). I understood all the rest and managed to do what you said and it worked...

It's done.

Thanks
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Re: Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-10 14:02

I'll use this thread to ask more questions about Virt-Manager and Qemu/KVM

For instance, how can I share host and client machine's clipboard so that I can copy/paste between both?
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Re: Virt-Manager Qemu/KVM USB problem

Postby CwF » 2019-08-11 13:41

A default virt-manager created vm should have the qemu-ga and spice channels, so no concern on the host.

In the guest install spice-vdagent and use xserver-xorg-video-qxl, other video drivers work too.
There are the same for windows from Fedora.

With 5+ vm's communicating sometimes a few channels drop off after weeks of uptime, haven't traced that out. If you're mixing in Wayland, since it's inferior in function, I don't care...

If and when you get serious with vfio passed gpu's, add a passed nic to the vm and you can use x2x for linux guest and it is far superior offering functional multi-media keys and the like, more mouse-hoover functions work, etc. x2vnc also works, and may work for a wayland desktop. They both use their own c-n-p functions and do work.

Note the primary and secondary clipboards can get tangled. I've used things to help, whatever clipboard managers but found they can trap contents so no advice there. middleclick c-n-p on the host often has the contents from a gui copy on a guest.
CwF
 
Posts: 446
Joined: 2018-06-20 15:16

Re: Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-11 13:56

CwF wrote:A default virt-manager created vm should have the qemu-ga and spice channels, so no concern on the host.

In the guest install spice-vdagent and use xserver-xorg-video-qxl, other video drivers work too.
There are the same for windows from Fedora.

With 5+ vm's communicating sometimes a few channels drop off after weeks of uptime, haven't traced that out. If you're mixing in Wayland, since it's inferior in function, I don't care...

If and when you get serious with vfio passed gpu's, add a passed nic to the vm and you can use x2x for linux guest and it is far superior offering functional multi-media keys and the like, more mouse-hoover functions work, etc. x2vnc also works, and may work for a wayland desktop. They both use their own c-n-p functions and do work.

Note the primary and secondary clipboards can get tangled. I've used things to help, whatever clipboard managers but found they can trap contents so no advice there. middleclick c-n-p on the host often has the contents from a gui copy on a guest.



Yeah, I managed to find that out while searching internet. It's working now. At least from client to host. Haven't tried the other way around tough!.
Thank you @CwF
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Re: Virt-Manager Qemu/KVM USB problem

Postby CwF » 2019-08-11 14:00

Also, you can graphically drag a file from the host to the guest desktop - it's one way, no guest to host.
CwF
 
Posts: 446
Joined: 2018-06-20 15:16

Re: Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-12 17:57

CwF wrote:Also, you can graphically drag a file from the host to the guest desktop - it's one way, no guest to host.


Oh nice, that's also handy!

Thank you
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Re: Virt-Manager Qemu/KVM USB problem

Postby PsySc0rpi0n » 2019-08-12 20:00

I have another question.

I need to add/share a SATA disk I have in my laptop with my VM. I searched but only thing I found is to edit some XML file and add some lines.

Isn't there another way?
User avatar
PsySc0rpi0n
 
Posts: 109
Joined: 2012-10-24 13:54
Location: Portugal

Next

Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable