VM Mount folder from host to Guest

jeremyoha450

Dabbler
Joined
Mar 1, 2022
Messages
19
Hi guys

How can i create a mount on the guest that uses a location on the host?
without using network.

regards
Jeremy
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
You need an internal bridge network....


It "hidden" in a section of
"why should I use different interface types".
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
without using network.
Not possible. NFS or SMB it is. If you need a local mount point with full POSIX semantics, you could consider using TrueNAS CORE and jails. They can do that. VMs can't.
 

mgoulet65

Explorer
Joined
Jun 15, 2021
Messages
95
If you include "without using network" do you mean shared storage or dedicated to the VM? I dedicate a zvol on my Scale server to a VM.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
I dedicate a zvol on my Scale server to a VM.
That's a virtual disk. But you cannot access that via e.g. sharing on the NAS. It's a frequent requirement to have a folder that is accessible from inside a container or VM as well as from outside. In the case of a VM since the VM and the host don't share a kernel, networking, file system, anything, ... you must use a network sharing protocol for that mount. Docker on the other hand or jails on FreeBSD can do direct mounts with local access semantics.

You can e.g. run a MySQL server inside one jail, mount the directory containing the local communication socket ("mysql.sock") into three other jails, and use the database in these jails without a TCP connection. Similar for Docker as far as I know.

HTH,
Patrick
 

mgoulet65

Explorer
Joined
Jun 15, 2021
Messages
95
That's a virtual disk. But you cannot access that via e.g. sharing on the NAS. It's a frequent requirement to have a folder that is accessible from inside a container or VM as well as from outside. In the case of a VM since the VM and the host don't share a kernel, networking, file system, anything, ... you must use a network sharing protocol for that mount. Docker on the other hand or jails on FreeBSD can do direct mounts with local access semantics.

You can e.g. run a MySQL server inside one jail, mount the directory containing the local communication socket ("mysql.sock") into three other jails, and use the database in these jails without a TCP connection. Similar for Docker as far as I know.

HTH,
Patrick
Right...which is why I said it was dedicated not shared.
 

morganL

Captain Morgan
Administrator
Moderator
iXsystems
Joined
Mar 10, 2018
Messages
2,694
The NFS/SMB share provides sharing capabilities
The ZVOL option provides max performance
The 3rd option of mounting a host file system is interesting, but won't be available until a future release.

The technology is called virtio-fs... but only works with both VM and host support. If it's needed, I'd recommend adding a suggestion in jira.

That technology will not be good for sharing data with other machines or VMs.....so make sure your application doesn't ever need to do that.
 

mgoulet65

Explorer
Joined
Jun 15, 2021
Messages
95
bit silly that other VM solutions can do it but but kvm on scale cant :(
Keep in mind what Scale is and isn't trying to be. It is not claiming to be a fully featured GUI frontend to KVM. It is, in their own words, "...an Open Source Hyperconverged Infrastructure (HCI) solution." Do I wish it could do some things? Sure, I'd love native qcow2 support for VMs from the GUI. But it isn't "silly" that it doesn't provide the feature you are looking for. It just is.
 
Top