[TUTORIAL] Virtual Pendrive on VM

I spent the day trying to solve this and did it
Good for you. However your solution involves quite a serious host modification, & in fact is not a Proxmox/HV directly linked solution. This could be done purely in the Host (without passthrough to VM), or it could be directly done Guest/Client side, as others have done in non HV environments with the dummy_hcd module, for which it was designed. However doing it within PVE host & then using passthrough to VM probably is the only possible solution to make it bootable. (Have you tested booting from it?).

BTW this has been done in Proxmox before as shown here.
 
Good for you. However your solution involves quite a serious host modification, & in fact is not a Proxmox/HV directly linked solution. This could be done purely in the Host (without passthrough to VM), or it could be directly done Guest/Client side, as others have done in non HV environments with the dummy_hcd module, for which it was designed. However doing it within PVE host & then using passthrough to VM probably is the only possible solution to make it bootable. (Have you tested booting from it?).

BTW this has been done in Proxmox before as shown here.
Ah, it's true, someone have done this before!
The problem of other solutions, like the one an this Thread, in my case, is that I need to specify the ProductId and VendorId, not only the serial. By using the qemu to create the virtual USB I can't set the PID and VID (it uses a QEMU one), and it doesnt work for me.
And yes, the USB is bootable!
Now I need to find a way to load the module g_mass_storage file=/mnt/backing_file idVendor=.... on proxmox boot. dummy_hcd module load on boot after editing /etc/modules, g_mass_storage dont, and I think that the problem is the arguments

edit: did it! now it's ready for my VM after boot
 
Last edited:
Ah, it's true, someone have done this before!
The problem of other solutions, like the one an this Thread, in my case, is that I need to specify the ProductId and VendorId, not only the serial. By using the qemu to create the virtual USB I can't set the PID and VID (it uses a QEMU one), and it doesnt work for me.
And yes, the USB is bootable!
Now I need to find a way to load the module g_mass_storage file=/mnt/backing_file idVendor=.... on proxmox boot. dummy_hcd module load on boot after editing /etc/modules, g_mass_storage dont, and I think that the problem is the arguments

edit: did it! now it's ready for my VM after boot
How did you get the module to load? Can you share the instructions for what you did? Thanks!
 
How did you get the module to load? Can you share the instructions for what you did? Thanks!
on /etc/modprobe.d I made a file 1-mass_storage.conf with the content: options g_mass_storage file=xxxxx idVendor=0x0781 idProduct=xxxxxx iManufacturer=xxxxxxxx iProduct=xxxxxx iSerialNumber=xxxxxxx

and on /etc/modules-load.d:
0-usbvirtual.conf with the content dummy_hcd
and 1-mass_storage.conf with the content g_mass_storage
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!