


No privileges are required to run the web server.No need to install software since Linux and Mac typically already have Python installed.There are a couple of reasons why I like Python's built-in web server: User networking (slirp): forward a port with the hostfwd_add QEMU monitor command or -net user,hostfwd= option documented in the QEMU man page.NAT, bridged, or routed networking: the virtual machine's IP address.To access the virtual machine from the host: Bridged or routed networking: the IP address of the host.NAT networking: the default gateway from ip route show | grep ^default, for example.To access the host from a virtual machine: The web server generates index listings for directories so it is easy to browse. The directory hierarchy at path/to/shared/files is now available over HTTP on all IPs for the machine on port 8000. $ cd path/to/shared/files & python -m SimpleHTTPServer To share some files, simply change into the directory subtree you want to export and start the web server: The one-liner that shares files over HTTP

But my favorite ad-hoc file sharing tool is Python's built-in webserver. There are several solutions to sharing files, like network file systems, third-party file hosting, or even the virtfs paravirtualized file system supported by KVM. This can be drivers or installers from the host into the virtual machine or it could be in order to get some data out of the virtual machine and onto the host. It's pretty common to need to copy files between a virtual machine and the host.
