How can I write a file to a running virtual os? I'd like to write to the
hosts file of the guest OS in order to set some aliases, is this possible?
Make targeted folder available several protocols:
as hosts file is in /etc (or not - you don't specify OS) I suggest SSH as most proper solution.