You have to pass the information in as part of the vagrant up/reload process.
Through a combination of the shell provisioner or file provisioner you can accomplish what you need
# Env Variable
config.vm.provision "shell", inline: "EXPORT box_version = ..."
or
# Text File
config.vm.provision "shell", inline: "echo box_version = ... > ~/bversion.txt"
or
#Hardcoded text file as part of some outside process
config.vm.provision "file", source: "~/bversion.txt", destination: "~/bversion.txt"