In my work environment, I deal with multiple operating systems hosted on different virtual machines. A frequent challenge I face is transferring files between these systems — especially when copy-paste and drag-and-drop functionalities are disabled for security reasons.
Ideally, if all these systems existed within the same Active Directory (AD) domain, I could’ve easily used a shared network folder. But that’s not the case. Fortunately, I discovered a simple yet powerful solution using… Python!
Who would’ve thought a snake 🐍 would solve my file-sharing problem?
⚡ The Quickest Cross-OS File Sharing Method
With Python’s built-in web server, I can now instantly share files between any operating system — as long as they’re on the same network. It’s basically the fastest version of AirDrop I’ve ever seen for VMs and local systems.
🔧 How to Set Up a Python Web Server on Windows
Here’s a step-by-step guide to setting it up:
1. Install Python
Go to the official Python website and download the latest version.
During installation, make sure to check the box that says “Add Python to PATH” (important!).
Complete the installation.
2. Verify or Manually Add Python to System Environment Variables
In case Python isn't added to PATH automatically:
- Press the Windows key, search for Python, right-click on the one that shows “(64-bit)”, and choose Open File Location.
- Copy the path (e.g., C:\Users\YourName\AppData\Local\Programs\Python\Python311)
Now, add this path to the system environment variables:
Search for “Environment Variables” in Windows search.
Under System Properties, click Environment Variables.
- Under System variables, click New.
For Variable Name, you can enter something like PYTHON.
For Variable Value, paste the copied Python path.
- Click OK and save.
3. Start the Python Web Server
Open Command Prompt (CMD), navigate to the folder you want to share, and run:
python -m http.server 8080
Or if python doesn’t work, try:
python3 -m http.server 8080
This starts a basic web server that serves files from the current folder on port 8080.
4. Access the Server from Another Device
Now on any device (Windows, Linux, macOS, Android, etc.) connected to the same network, open a browser and type:
http://<IP_ADDRESS>:8080
For example:
http://192.168.8.102:8080
This opens the hosted directory in a browser — allowing you to download files easily and it can also be gotten via phones to.
⚠️ Troubleshooting Tip
If you get an error saying 'python' is not recognized as an internal or external command, it means Python isn’t properly installed or added to the system PATH.
To fix:
Just type "python" in CMD.
If it redirects you to the Microsoft Store, download Python from there.
Then repeat the earlier steps to set it up properly.
✅ Final Thoughts
With this method, I no longer struggle with sharing files across different virtual machines and OS environments. It’s lightweight, doesn't require external tools, and works instantly over LAN.
Python just became my new best friend for file sharing — fast, simple, and cross-platform.
Top comments (0)