This can be handled pretty much entirely on the host by configuring your qemu settings; it's got very robust virtual networking options. Basically just expose the host's VPN interface (e.g. usually called something like tun
) for VPN access, and make a separate virtual interface that only the host and guest can access for the stuff like ssh.
Here's the qemu wiki about networking, definitely where you should start
You've defined yourself into an impossible bind: you want something extremely portable, universal but with a small disk imprint, and you want it to be general purpose and versatile.
The problem is that to be universal and general purpose, you need a lot of libraries to interact with whatever type of systems you might have it on (and the peculiarities of each), and you need libraries that do whatever type of interactions with those systems that you specify.
E.g. under-the-hood, python's
open("<filename>", 'r')
is a systemcall to the kernel. But is that Linux? BSD? Windows NT? Android? Mach?What if you want your script to run a CLI command in a subshell? Should it call "cmd"? or "sh"? or "powershell"? Okay, okay, now all you need it to do is show the contents of a file... But is the command "cat" or "type" or "Get-FileContents"?
Or maybe you want to do more than simple read/write to files and string operations. Want to have graphics? That's a library. Want serialization for data? That's a library. Want to read from spreadsheets? That's a library. Want to parse XML? That's a library.
So you're looking at a single binary that's several GBs in size, either as a standalone or a self-extracting installer.
Okay, maybe you'll only ever need a small subset of libraries (basic arithmetic, string manipulation, and file ops, all on standard glibc gnu systems ofc), so it's not really "general purpose" anymore. So you find one that's small, but it doesn't completely fit your use case (for example, it can't parse uci config files); you find another that does what you need it to, but also way too much and has a huge footprint; you find that perfect medium and it has a small, niche userbase... so the documentation is meager and it's not easy to learn.
At this point you realize that any language that's both easy to learn and powerful enough to manage all instances of some vague notion of "computer" will necessarily evolve to being general purpose. And being general purpose requires dependencies. And dependencies reduce portability.
At this point your options are: make your own language and interpreter that does exactly what you want and nothing more (so all the dependencies can be compiled in), or decide which criteria you are willing to compromise on.