OS: Kubuntu 18.04

I have some virtual machines made using virt-manager and qemu/kvm. (I'm not using VirtualBox). The VMs work well and I can copy/paste from the VM to the host and vice versa.

When making the VMs, I just use the basic set-up and don't do anything advanced.

But now, I want to make my existing VMs read from or write to a pendrive. Is that possible?

In case it's helpful:

apt list --installed | grep -i virt shows

gir1.2-libvirt-glib-1.0/bionic,now 1.0.0-1 amd64 [installed,automatic]
libgovirt-common/bionic,bionic,now 0.3.4-2 all [installed,automatic]
libgovirt2/bionic,now 0.3.4-2 amd64 [installed,automatic]
libvirt-bin/bionic-updates,bionic-security,now 4.0.0-1ubuntu8.10 amd64 [installed]
libvirt-clients/bionic-updates,bionic-security,now 4.0.0-1ubuntu8.10 amd64 [installed,automatic]
libvirt-daemon/bionic-updates,bionic-security,now 4.0.0-1ubuntu8.10 amd64 [installed,automatic]
libvirt-daemon-driver-storage-rbd/bionic-updates,bionic-security,now 4.0.0-1ubuntu8.10 amd64 [installed,automatic]
libvirt-daemon-system/bionic-updates,bionic-security,now 4.0.0-1ubuntu8.10 amd64 [installed,automatic]
libvirt-glib-1.0-0/bionic,now 1.0.0-1 amd64 [installed,automatic]
libvirt0/bionic-updates,bionic-security,now 4.0.0-1ubuntu8.10 amd64 [installed,automatic]
python-libvirt/bionic,now 4.0.0-1 amd64 [installed,automatic]
qml-module-qtquick-virtualkeyboard/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed]
qtvirtualkeyboard-plugin/bionic,now 5.9.5+dfsg-0ubuntu1 amd64 [installed]
virt-manager/bionic-updates,bionic-updates,now 1:1.5.1-0ubuntu1.2 all [installed]
virt-viewer/bionic,now 6.0-2 amd64 [installed,automatic]
virtinst/bionic-updates,bionic-updates,now 1:1.5.1-0ubuntu1.2 all [installed,automatic]

And apt list --installed | grep -i qemu shows

ipxe-qemu/bionic-updates,bionic-updates,now 1.0.0+git-20180124.fbe8c52d-0ubuntu2.2 all [installed,automatic]
ipxe-qemu-256k-compat-efi-roms/bionic,bionic,now 1.0.0+git-20150424.a25a16d-0ubuntu2 all [installed,automatic]
qemu-block-extra/bionic-updates,bionic-security,now 1:2.11+dfsg-1ubuntu7.13 amd64 [installed,automatic]
qemu-kvm/bionic-updates,bionic-security,now 1:2.11+dfsg-1ubuntu7.13 amd64 [installed]
qemu-system-common/bionic-updates,bionic-security,now 1:2.11+dfsg-1ubuntu7.13 amd64 [installed,automatic]
qemu-system-x86/bionic-updates,bionic-security,now 1:2.11+dfsg-1ubuntu7.13 amd64 [installed,automatic]
qemu-utils/bionic-updates,bionic-security,now 1:2.11+dfsg-1ubuntu7.13 amd64 [installed,automatic]

It is possible. You need to:

  1. open Virtual Machine Manager (virt-manager)
  2. select your machine
  3. choose Open
  4. select ViewDetails
  5. click Add Hardware and select USB Host Device:

    add USB Host Device

  6. click Finish

  7. as the result the USB device will be shown in left list:

    physical USB device added

  8. start your virtual machine as usual

Moreover you can boot from this USB device if you select it in Boot Options.

On my Ubuntu 16.04 LTS I see other option while VM is running - we need to select Virtual Machine menu item and choose Redirect USB device, then in opened Select USB devices for redirection window check the needed device and click on corresponding device:

USB Device redirection

This is possible because of already added default USB Redirector devices.

  • 1
    Now I can make my own AppImages on my 16.04 VM (like Leafpad and Shutter and gcolor2 which have been dropped in 19.04) and copy them to wherever I want :) – DK Bose May 17 '19 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.