Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Shared Folder & USB Pass-through win10 kvm

  1. #1
    Join Date
    Oct 2008
    Location
    UK
    Beans
    1,816
    Distro
    Ubuntu Mate 22.04 Jammy Jellyfish

    Shared Folder & USB Pass-through win10 kvm

    Try as I might I cannot get either shared folder and usb pass-through in either my win10 guest kvm (or ubuntu guest). I have followed many instructions both via virt manager and the terminal, deleted vm s to start again fresh, but find I'm still defeated. I feel somewhat exited because indeed kvm is faster and more responsive (than vb) and I can see the end of my win10 dual boot days, but I feel frustrated not being able to achieve what appears to be achievable. A pointer to some instructions that definitely work would be most appreciated (although I suspect I'm not doing something obvious that is not given in the many web pages I have so far tried).

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Shared Folder & USB Pass-through win10 kvm

    For shared storage, just use any network method that you would use between 2 physical systems. If that is CIFS or NFS, then use those. If you want sftp, Windows has filezilla or WinSCP. These all work, though CIFS has the same problems that CIFS always has.

    As for USB passthru ... let me check it out.
    My KVM host is running 16.04. I'll connect to a Windows host using SPICE. On Windows, the GPU drivers are QXL. Inside the VM window, there is a menu .... File View Send Key Help ....
    I plug in a USB Flash drive, but for Windows VMs, the File --> USB Device Selection is gray.
    For a 20.04 Linux VM, File --> USB Device Selection is available. I selected that, a window popped up with 2 USB devices.
    * USB Flash Memory
    * CHESEN PS2 to USB Converter (i.e. a USB to PS2 keyboard + mouse)

    Inside Linux, I see:
    Code:
    $ lsblk 
    NAME                       SIZE TYPE FSTYPE      MOUNTPOINT
    sda                        962M disk             
    └─sda1                     961M part vfat
    as expected. Back in the USB Device Selection - I deselect the Flash memory and check the Windows File menu. No joy.

    Let's check the USB Controller in virt-manager. Under Windows, it is emulating a USB3 controller. It is for the 20.04 VM system too. Hummmm.

    Looking at the Linux guest, I see 2 USB Redirectors setup in the VM HW list, but none are in the Windows VM HW list. I need to add one to Windows, yes? Add Hardware, USB Redirectory, Spice Channel. This change requires a reboot to become effective. No problem - isn't only Windows. Shutdown (not reboot). Then restart. Check the File ---> USB Device Selection. It is not gray! Select the Flash Memory and get a warning .... "there are no free channels." Perhaps I need 2 USB Redirectors minimal? Let's try that. Ok, shutdown, added another USB Redirector, started the VM, File--> USB Device selected, no warning/errors. Could this be it?

    Open MS-Exploder and there's not extra drive label. Check out MS-Disk Manager ... the device isn't seen at all there either. Maybe I should try a different flash drive?

    Grabbed a Kingston microSD -to- USB3.1 converter; dropped in a 64G FAT32 (had to reformat from f2fs) Samsung card, plugged it into the KVM host. Did a quick mount to ensure it was working:
    Code:
    sudo mount -o uid=tf /dev/sdb1  /mnt/1
    de-mount it in Linux. Tell Windows VM to redirect it and told disk manager to rescan for disks. Disk manager isn't seeing it. It has a MSDOS Partition table and 1 partition FAT32. Bummer.

    Let's try USB2. Shutdown, change VM settings (USB Controller 3 --> 2), restart the VM ....

    Ok, I spent another 20 minutes screwing around with this and didn't get any farther. Disk Manager, Device Manager, I did see that some "unknown device" was listed, but couldn't install a driver to make it work and at the end, Windows claimed the existing drivers were fine. I use virtio SCSI disk drivers from redhat in this VM - the QXL driver is from Redhat too, I think.

    Just a second ago, saw a Windows popup about a new device, which I was able to click. It said that the device wasn't working properly and that I needed to remove and re-insert it. I did that. The removal had the expected sound, but the re-insertion did not.

    Even connected the device to an old, old, old, Win7 machine here. It worked perfectly, as expected. Told it to format - the default was for exFAT, which I allowed. I don't use exFAT - ever, but this 1 time. That didn't help.

    Time to google some libvirt, Windows USB controller passthru help.
    https://virtuozzosupport.force.com/s/article/000017379 says we have to use old versions of USB controllers.
    When I look in the VM XML file, I'm seeing ich9-ehci1 as the model of USB controller show. That link says the model nec-xhci should work. Let's try that. Ouch. The VM refused to start. Put it back, quick!

    I give up. Sorry.

    Use Linux. Much easier.

  3. #3
    Join Date
    May 2008
    Beans
    3,974
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Shared Folder & USB Pass-through win10 kvm

    Host:-----------Ubuntu 20.10
    Guest:---------Win10_20H2_English_x64.iso
    Virtualiser:----QEMU/KVM
    GUI:------------Virtual Machine Manager 2.2.1

    This is my first time using QEMU/KVM and during installation of the VM software and VM GUI, I accepted the defaults.

    Luckily, USB Pass Through seems to work OK

    Insert USB > Virtual Machine > Redirect USB Device

    It was also OK for a USB DVD RW (I managed to add some DVB drivers to Windows 10 guest)

    Screenshot attached with USB Stick acceptance.

  4. #4
    Join Date
    Oct 2008
    Location
    UK
    Beans
    1,816
    Distro
    Ubuntu Mate 22.04 Jammy Jellyfish

    Re: Shared Folder & USB Pass-through win10 kvm

    Wow - thank you, that simple! Just tried it and yes, it is working for me. Have you had any luck/tried a shared folder(?) - this is a biggie for me as if I could do this I can do away with my win10 dual boot.

  5. #5
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Shared Folder & USB Pass-through win10 kvm

    Quote Originally Posted by Quarkrad View Post
    Wow - thank you, that simple! Just tried it and yes, it is working for me. Have you had any luck/tried a shared folder(?) - this is a biggie for me as if I could do this I can do away with my win10 dual boot.
    I'm on 16.04 KVM.
    Code:
    ii  virt-manager     1:1.3.2-3ubuntu1.16.04.4
    Cannot change that for a few months.
    My Windows install has been migrated from VM-host to VM-host for about 10 yrs. A fresh install will break it.

    Happy it is working for someone. Would be interesting to see the USB controller model specified in the VM XML. Please.

    There are serious security considerations using VM-host-sharing capabilities. Best to use existing network protocols. For any Vbox lurkers - this is especially important for people running virtualbox as there are number of problems with the sharing under that hypervisor.

  6. #6
    Join Date
    May 2008
    Beans
    3,974
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Shared Folder & USB Pass-through win10 kvm

    Quote Originally Posted by TheFu View Post
    Would be interesting to see the USB controller model specified in the VM XML. Please.
    .
    Controller USB 0 (XML content) as follows:-

    Code:
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <alias name="usb"/>
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </controller>

  7. #7
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    5,739

    Re: Shared Folder & USB Pass-through win10 kvm

    Insert USB > Virtual Machine > Redirect USB Device
    This manual redirection isn't necessary on initial insertion of a USB - at least in newer versions of Virt Manager GUI, it can be set to automatically appear on the active screen - host or guest. Go to Virt Manager Preferences and select "Console" tab, then see "Spice USD redirection". Set this to "Auto Redirect on USB attach" See the attached image!
    Attached Images Attached Images

  8. #8
    Join Date
    Oct 2008
    Location
    UK
    Beans
    1,816
    Distro
    Ubuntu Mate 22.04 Jammy Jellyfish

    Re: Shared Folder & USB Pass-through win10 kvm

    My personal need for a share folder is for itunes so I can have all my mp3 files stored on a separate hd rather than the same disc that the VM is installed on. That is how I currently have it configured using VBox. For all other vm activities I am 99.9% internal only - however, I do take all the issues re security.

    Dennis N what version of Virt Man are you using? Mine is 2.2.1

  9. #9
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Shared Folder & USB Pass-through win10 kvm

    Quote Originally Posted by tea for one View Post
    Controller USB 0 (XML content) as follows:-

    Code:
    <controller type="usb" index="0" model="qemu-xhci" ports="15">
      <alias name="usb"/>
      <address type="pci" domain="0x0000" bus="0x02" slot="0x00" function="0x0"/>
    </controller>
    Thanks. Tried to change to the qemu-xhci devide model and virsh edit refused.
    Code:
    error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/domain.rng
    Extra element devices in interleave
    Element domain failed to validate content
    Guess the libvirt is too old. I have 3 VM-hosts.
    • 1 of them isn't critical and will end up being the first of my older systems to be moved to 20.04 when that time comes.
    • 1 of them is too critical to risk due to all the production VMs it runs.
    • The last one is also the backup server for the LAN, connected to multiple backup LANs. My backup software broke with the python2-->python3 move in 20.04, so I'm afraid to move it for now.

    There are always dependencies that slow things down around here. ;(

    Guess I'm out of the USB passthru stuff on Windows ... but it works flawlessly to Linux VMs.

  10. #10
    Join Date
    May 2008
    Beans
    3,974
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    Re: Shared Folder & USB Pass-through win10 kvm

    Quote Originally Posted by Quarkrad View Post
    My personal need for a share folder is for itunes so I can have all my mp3 files stored on a separate hd rather than the same disc that the VM is installed on. That is how I currently have it configured using VBox. For all other vm activities I am 99.9% internal only - however, I do take all the issues re security.
    If you have a look at this site https://www.spice-space.org/spice-user-manual.html

    There is some info about:-
    Agent support allows better integration with the guest. For example, it allows copy and paste between the guest and the host OSes, dynamic resolution changes when the client window is resized/full-screened, file transfers through drag and drop,
    Under Download tab:-
    Windows guest tools - spice-guest-tools
    I haven't explored it completely because I'm happy with using USB re-direction at the moment.

    Good luck

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •