I searched a lot on the pages but found nothing interesting so decided to write a short tutorial.
Virtual Flash Drive is very helpful, many systems require it instead of an iso image, and it will also come in handy for quick tests or fast move files beetwen VM.
1. We create an image of our flash drive
Tip1 - We can use permanent storage instead of /tmp/
Tip2 - We can change the size bs,count - more info in the dd manual
2. Add a device for our flash drive [VM --> Monitor]
Tip - can use another format or cache
3. Install our flash drive in the slot [VM --> Monitor]
Tip - can change 'removable' walue for example Windows see on=PENDRIVE off=USB HDD
4. (Optional) Remove your pendrive if it is no longer needed
Extra Tip Can boot from usb, can add more pendrive - repeat all steps and replace drive-usb0 with for example drive-usb[X]
Extra Tip To add permanently to our machine:
Virtual Flash Drive is very helpful, many systems require it instead of an iso image, and it will also come in handy for quick tests or fast move files beetwen VM.
1. We create an image of our flash drive
Bash:
dd bs=1G count=8 if=/dev/zero of=/tmp/usb0.img
Tip2 - We can change the size bs,count - more info in the dd manual
2. Add a device for our flash drive [VM --> Monitor]
Code:
drive_add 0 file=/tmp/usb0.img,if=none,id=drive-usb0,format=raw,cache=none
3. Install our flash drive in the slot [VM --> Monitor]
Code:
device_add usb-storage,id=drive-usb0,drive=drive-usb0,removable=on
4. (Optional) Remove your pendrive if it is no longer needed
Code:
device_del drive-usb0
Extra Tip Can boot from usb, can add more pendrive - repeat all steps and replace drive-usb0 with for example drive-usb[X]
Extra Tip To add permanently to our machine:
Bash:
qm set 1003 -args "-drive file=/tmp/usb0.img,if=none,id=drive-usb0,format=raw,cache=none -device usb-storage,id=drive-usb0,drive=drive-usb0,removable=on"
Last edited: