You need name resolution for this to work. It could be DNS, but if you ran your own DNS server, you would ask a different question. So I guess you don't. No DNS server, no DNS-based name resolution.

Another name resolution method is `/etc/hosts`. You could simply add `hostname.local` to the `/etc/hosts` file on the hypervisor host. Probably the easiest solution, especially if you don't access the VM from other computers.

The third commonly used method is **mDNS**. It relies on a service running on the VM that responds to queries of the type "who has the name `hostname.local`?". On Linux, this service is typically named "Avahi". Perhaps your Raspberry Pi runs it, and your VM doesn't. Or perhaps mDNS queries don't reach the VM.

To find out which name resolution methods are enabled, see the ***hosts*** clause in the `/etc/nsswitch.conf` file.