I had the exact same symptoms, and I had to nudge Avahi to start for a fresh install of 18.04.1 (which had already been rebooted many times). Then everything worked. I suspect a lot of people end up asking these questions as maybe not realize it wasn't starting on their VM for whatever reason, etc...
Please see Rucent88's answer before reading more of mine, which was one of the most helpful posts for this issue, and the question was a great succinct question.
With fresh installs of 18.04.1, on VMware it worked out of the box. On VirtualBox I had to set the networking on VirtualBox to “Bridged Adapter” and then bump Avahi and add .local
to the host name. I have installed the VMware many times and never had issues until trying VirtualBox a few days ago.
On my two day adventure I discovered it was Avahi not starting correctly on fresh 18.04.1 on the VirtualBox setups, where it seemed to start fine on fresh install VMware ones. In addition on VMware some other magic is going on as I don't have to add .local
, for XXX machine name and the VMware installs I can simply use the plain Windows host name.
On VirtualBox if I did:
sudo avahi-daemon --check
sudo avahi-daemon
Daemon already running on PID 721
before this, with the added .local
:
sudo mount -t cifs -o username=bob,uid=bob,gid=bob //Xxx.local/MyShare /mnt/MyShare
then it works.
Some people claim that changing nsswitch.conf
should fix mount
resolving the name. But after setting up winbind
and adding to the list in all kinds of different ways it didn't work, and adding or removing mdns4_minimal
seems to not actually affect mount
. Maybe the file wasn't being used.
See also https://ubuntuforums.org/showthread.php?t=2099537 which is a super short example of someone having the problem and someone showing the syntax for fixing his command if you are just missing the differences when using Avahi resolution.
mount -t cifs -o username=USERNAME,password= //$(nmblookup vvlaptop|awk 'END{print $1}')/Documents /mnt/virginia