Enabling VirtualBox guest to access a remote (network) NFS share

If I change the VirtualBox network setting (Machine > Settings > Network > Attached to: > NAT [default]) to Bridged Adapter and select the appropriate Ethernet adapter in the drop-down (not wireless), it appears that this will enable me to access an NFS share on another machine (running NFS server) from the guest machine (Windows in this case). See https://www.virtualbox.org/manual/ch06.html#network_bridged.

Please tell me if this is correct and any possible downsides.

Hi
I always run a bridged interface for virtual machines, if the host has two network (not wireless) interfaces, if not pop in a cheap PCIx1 card, assuming a desktop, for laptops have found the USB to ethernet devices adequate.

Can I use the same interface (e.g., eth0) for both the host and the guest, in the bridged mode?

Hi
No, then you would need to use NAT… Is this a desktop or laptop?

Desktop (the machine discussed in https://forums.opensuse.org/showthread.php/544948-Driving-dual-monitors-with-CPU-integrated-graphics - thank you for responding there).

I thought NAT does not allow guest access to the network. Perhaps there is some way I can mount the “remote” network shares in the Windows guest with the attachment set to NAT.

I only have eth0 and 5 virtual machines bridged to eth0 - it works fine has for 12 years and 7 upgrades.

I use static ip’s on all my virtual machines so I can ssh into them if I have an issue.

vm1 ends in 101
vm2 ends in 102

vm5 ends in 105

Thanks. The goal here is to treat the machine with the NFS shares as a network attached storage (NAS) device.

Hopefully to clarify some misinformation…

The Guest should be able to use a bridge device configured for bridging and then participate on the real network like any other machine virtual or physical. And, this should fully support NFS shares. As a fully capable host on the network, Guests using bridging connections will use any network services on the network the same as any physical machine.

When configured with a NAT connection, unlike all other virtualization Virtualbox Guests share the same IP address as the HostOS but should again support NFS shares. If you want to configure your Guest with its own, unique NAT IP address, you have to configure to use a NAT-network connection in the Guest’s network properties… not NAT.

When a Guest is configured to use any kind of NAT, the machine should have full access to anything on the network including network shares. The problem is not making outbound connections, it’s that remote machines cannot easily initiate an inbound connection. This is why NAT is most often used for workstations and Desktops which might need resources from remote machines, but are practically never used for Servers which respond to requests from other machines.

If you run into problems setting up a network share,

  • Be aware of the NAT vs NAT-network connection only in Virtualbox.
  • Be aware that name resolution if required must be provided by an external authority, there is no local service on the Host that can provide name resolution (although technically there typically is a forwarding service that’s not authoritative)

TSU

NAT allows the guest to access the network. I update NAT VM’s all the time - I have 20 Virtual Machines in NAT - some Windows - some Various Flavors of Linux.
The Only VM’s I have with Bridge and static IP’s are those that the Internet has access to.
NAT does not allow the network to access the guest as the NAT IP address is not accessible from the network.

No that’s not correct. I only use bridged mode for my (VirtualBox) VM guest on a laptop with one wired ethernet interface.

tsu2 -

Thank you for the detailed explanation. I acknowledge that I am not at all familiar with the various network modes, even after reading and re-reading the relevant sections of Chapter 6 of the VirtualBox manual, as well as several third-party websites.

I’m not following the “inbound connection” issue. At the risk of belaboring the issue, if one of the PCs on the network is running NFS server and providing shares for every physical machine on the network (accessed either through autofs or systemd.automount), can the Windows guest be configured to permit the guest to access the shares on demand? A SAMBA share? Please note that the server PC is a platform running native openSuSE and not virtual.

For mixed OS environments, Samba is a good option for file sharing. However, here is a guide for installing and using an NFS client with Windows 10…

https://graspingtech.com/mount-nfs-share-windows-10/

deano_ferrari -

Thank you for that link. As I was drafting my last post, I began to wonder how does one configure the Windows machine to see an NFS share. And I haven’t used SAMBA since somewhere back in Suse version 9 or 10.

Would your bridged configuration permit bidirectional (read/write) access to an NFS share on your network?

Yes, it effectively connects the guest to the LAN (same subnet) as with the other hosts.

Hi
Then it must be some foo in Virtualbox, never used it, always have virtual machines (qemu) with own interfaces via a bridge I enjoy my 1Gb network speeds :wink:

Samba file sharing is simple enough to set up. Some openSUSE guides that may be of interest to you…

https://doc.opensuse.org/documentation/leap/reference/html/book-opensuse-reference/cha-samba.html
https://en.opensuse.org/Samba

It’s just bridging (virtual and real interfaces). I have no need for such fast speeds in the context of the VMs I use/support. At work, we have VMs in use for mobile radio applications, with bridging employed.

FWIW…

Thank you all for the feedback and helpful suggestions.