How to share a drive across all VMs and LXCs

rofo69

Member
Jan 17, 2024
47
9
8
So, I have an Ubuntu VM with a usb drive attached via passthrough from the host. It in turn, shares the contents of the drive to anything on the network via SMB.
All of this works fine, but got me thinking. If an LXC needs to grab files from the SMB, I'm assuming it has no knowledge that the files are actually stored on a drive locally attached to the host, so it has to go out onto the network to get them via SMB.

This means the speed of the connection to the drives is limited (I'm guessing) to the network connection to the router, which is 1 gigabit hardwired connection.

If this is right, the only options I seem to have to speed this up, is either a 2.5g or 10g network ?

Is there a way of sharing drives (perhaps internal ones as well, not just usb) to other VMs and LXC's without having to go out onto the network to get them, and therefore getting closer to the actual speed of the connection/drive ?

Am I right in that I recall its dangerous to directly share (say) usb drives with more than one VM at a time ?
 
Last edited:
So, I have an Ubuntu VM with a usb drive attached via passthrough from the host. It in turn, shares the contents of the drive to anything on the network via SMB.
All of this works fine, but got me thinking. If an LXC needs to grab files from the SMB, I'm assuming it has no knowledge that the files are actually stored on a drive locally attached to the host, so it has to go out onto the network to get them via SMB.

This means the speed of the connection to the drives is limited (I'm guessing) to the network connection to the router, which is 1 gigabit hardwired connection.

If this is right, the only options I seem to have to speed this up, is either a 2.5g or 10g network ?

Is there a way of sharing drives (perhaps internal ones as well, not just usb) to other VMs and LXC's without having to go out onto the network to get them, and therefore getting closer to the actual speed of the connection/drive ?

Am I right in that I recall its dangerous to directly share (say) usb drives with more than one VM at a time ?


UPDATE:- I think I found my own answer, which is what i was hoping for:-

https://www.reddit.com/r/Proxmox/co...Any VM to Other machine,-> router -> internet.
 
  • Like
Reactions: Kingneutron
Regardless, 2.5g network might be worth investing in. Switch prices and NICs are comparable to 1gbit equipment these days and you can use the same CAT5E cables.

Just try to go with Intel chipsets; not much choice besides Realtek if you go with USB3 NIC
 
Despite the link above suggesting that file copies between VM's don't leave proxmox's internal 'switch' if on the same vmbr, I've done some testing which seems to suggest otherwise, but could this be because of SMB ?

Test 1, SMB share on VM1, accessed via a physical PC on the same (1g wired) network. Transfer speeds around 105MB/s, which is what I would expect.

Test 2, SMB share on VM1, accessed via VM2 on same proxmox host, same vmbr.. same speeds as above...

Test 3, USB passthrough all disks to the same VM and copy files between them. Transfer speeds around 150MB/s which I think is the max speed for the drive.

Shouldn't Tests 2 and 3 generate the same speeds ?