Passthrough SMB share to VM

donzodaddy

New Member
Feb 15, 2025
1
0
1
I have an SMB share mounted on my host, which I want to be able to passthrough to a linux VM, which is connected to a VPN and does not see my smb share (VPN does not support split tunneling in linux). Is there a way to passthrough the SMB share directory to my linux VM? I am unable to add it via the normal hardware menu, as I don't want to create any new directories as a hard drive for this share, I want access to what is already in the SMB share.

Any ideas?

Thanks
 
Hello @donzodaddy

I do not know exact behavior of your VPN, but did you considered options of adding NIC and configure to host network ?

Option 1)
add new virtual NIC to VM and configure it to the host network, then connect directly to you SMB share.

Option 2)
SSHFS you need to have connection to the host from VM, install "sshfs" on VM. If there is no connection due to VPN it might help to create new IP in different range on host https://unix.stackexchange.com/questions/178118/two-ips-on-one-nic-network-card and on VM dedicated new NIC for connection with host only.

sshfs user@host-ip:/path/to/mounted/smb /mount/point/in/vm

Option 3)
Using VirtFS/9P passthrough, but this is not officially supported https://forum.proxmox.com/threads/folder-passthrough-9p-possible.77155/ or https://wiki.qemu.org/Documentation/9psetup
 
Last edited: