Linux – How to make Windows 7 Network show Samba share after VM is rebooted/restored

linuxnetworkingsambavirtualboxwindows

On Windows 7, I have VirtualBox running Linux (Ubuntu 8.04), with Samba set up so that the Windows host can access it. But if the virtual machine is shut down & restored, or rebooted, the Windows Network no longer shows it.

I've tried refreshing many times, restarting Samba, disabling/enabling the virtual network adapter, and running the succession of commands ipconfig /release, ipconfig /flushdns, & ipconfig /renew, but none worked. As a last resort I could restart the host itself, but is there a better way?

Best Answer

Windows networking uses NetBios for computer name resolution on file sharing. This is configured through the nbtstat command line program not ipconfig. Try running nbtstat -R to purge and reload the name cache. You should then be able to find the machine again or right click on the Computer icon to re-map the network drive manually.

Also is virtualbox using a Bridged network adapter or NAT? When trying to access VMs over the network it is usually easier to setup a bridged network adapter so long as there is a DHCP server available to assign IP addresses. Most cable modems use NAT and DHCP already so they will give private addresses to all of your virtual machines.

Related Question