Connecting 2 VMs

This is for discussing general topics about how to use VirtualBox.
Post Reply
Dominus
Posts: 2
Joined: 11. Aug 2019, 22:32

Connecting 2 VMs

Post by Dominus »

Hello Community,

Is it possible to share folders across VMs?

I currently have a couple of Linux VMs and 1 Win7 VM. Output is genrated in the Linux VM and moved to Win 7 by directing the output to a folder shared with a Win 10 host. The same folder is share to the Win 7 guest whre the next steps pick up.

Is it possible to share directly between 2 or more VMs?

I searched but didn't find anything of note. My search parameters could be simply wrong for what I'm trying to find.

Thanks for the assist.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting 2 VMs

Post by scottgus1 »

If you are using Guest Additions Shared Folders, then you can only share between guest and host.

If you want to put a network between the guests, then you can use real shared folders directly between the guests without having to copy via the host. See section 6 in the manual for the various kinds of networks Virtualbox can provide. Here's three of the possibilities that may be useful:

'Internal' networking makes a private network that the host won't have access to. Internal behaves like an unmanaged switch. No internet or access to or outside the host.

Host-only is like Internal, but with a virtual network adapter attached to the host, too, so the host can access the guests on the 'internal-like' network. No internet or access outside the host.

Bridged puts the guests in the same physical network as the host is attached to. The host and all other computers and devices on the physical LAN will be able to communicate with the guests. Internet is available if the host has it. (Bridged may not work if the host is networked via Wifi.)
Dominus
Posts: 2
Joined: 11. Aug 2019, 22:32

Re: Connecting 2 VMs

Post by Dominus »

Thanks for that. No idea how I missed reading that.
I should never VM when sleepy.
scottgus1 wrote:Bridged puts the guests in the same physical network as the host is attached to. The host and all other computers and devices on the physical LAN will be able to communicate with the guests. Internet is available if the host has it. (Bridged may not work if the host is networked via Wifi.)
Seems to be what I need but this host is wifi. I would need to run a drop to hard wire.

My goal is to have the guest direct share with each other while having the Win 7 guest use the Linux guest as a proxy for net access when needed.

I'll attempt it. Hopefully it works. If not...I'll find another path.

Thanks again for the quick response.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Connecting 2 VMs

Post by scottgus1 »

There would be a way to skip Bridged with the setup you're trying:
Dominus wrote:My goal is to have the guest direct share with each other while having the Win 7 guest use the Linux guest as a proxy for net access when needed.
Put two network adapters in the guest that will act as the internet proxy. One adapter will be set to NAT, which is compatible with Wi-fi, and the other adapter would be on the Internal network connected to all the other guests.

You would have to use a bridging program inside the proxy guest to "bridge" the two network adapters inside that guest so the proxy guest becomes a gateway for the Internal network.

FWIW I would just add another guest running pfSense, setting its "WAN" side to the NAT adapter and the "LAN" side to the Internal adapter. The bridging program is already set up in pfSense. Like this:
pfSense guest network.png
pfSense guest network.png (36.38 KiB) Viewed 1051 times
Post Reply