Assuming you want the simplest solution - for a Debian-based OS, simply run the following:
apt-get install locate && updatedb
locate example.txt
The above to be run as root, of course (or via sudo). updatedb isn't autonomous - it'll run whenever called manually, or the VM is rebooted. So if you add a bunch of files, and want them included in the search, you'd need to run updatedb again before running locate filename.