Running MediaMonkey + WiFi Sync on Linux (in Windows VM)
Posted: Thu May 29, 2025 8:50 am
Hey all, I just figured out how to use MediaMonkey successfully on Linux, including Wi-Fi Sync with MediaMonkey on Android.
I thought I should share it here, to save others the trouble of trying to emulate it with Wine, or wasting time figuring out why Wi-Fi sync doesn't work when running MM in a Virtual Machine.
The basic idea is to run MM in a Windows (11) Virtual Machine (VM), to get full compatibility (as opposed to running it in Wine), then configure the NIC in the VM to use the same network/IP as the host, to set up "Media Sharing" in MM using some port number that you also map from the host into the VM.
In more detail:
1. On your Linux host, install Docker
2. On your Linux host, make sure kvm is installed and that the kernel module is activated (there are many guides on the Internet, it can be as easy as "sudo dnf install -y qemu-kvm libvirt" + "sudo modprobe kvm" + "sudo modprobe kvm_intel" which works e.g. on Fedora)
3. Create a Windows 11 VM using the "dockur/windows" project found on Github (I cannot post direct links in this forum, so you'll have to search for it yourself). This project essentially ships a Docker image with various libraries (such as qemu) and scripts, which set up a new Windows VM from scratch, downloading the official installation ISOs from Microsoft, and making an unattended installation. To create a container from that image, I use the following Docker compose.yml (see the comments for where you need to replace values):
4. Connect to the Windows VM, either via the browser-based VNC on 127.0.0.1:8006, or via RDP (install the "freerdp" package, then run a command such as "xfreerdp /v:127.0.0.1 /u:Docker /p:admin /sound")
5. In the VM, we must fix a DNS entry that points to "host.lan". By default, dockur/windows project configures "20.20.20.1" in the hosts file, so you need to change it. Open Notepad as administrator, then open the file "%WINDIR%\system32\drivers\etc\hosts" and update the 20.20.20.1 IP to the gateway IP of your network (e.g. 192.168.0.1).
6. Verify that when you open "\\host.lan" in Explorer, you see a "Data" folder that contains your files
7. MM seems to be unable to use this network drive as a location for your library, but you can instead use the Explorer feature to "map a network drive". This drive (e.g. "Z:\") can be added as "Local" location in MM just fine.
8. In the VM, download and install MM. In MM, set up your media library. Using xfreerdp, you should hear the music.
9. If you want Wi-Fi sync, in MM, click "Tools -> Options -> Library -> Media Sharing" and configure the sharing server. Make sure to use the same port as in the compose.yml shown above (23227). Now you can set up the sync server in the MMA app (the QR code should also work).
I hope this helps.
The primary insights (which took me a lot of time to figure out) were:
1. Discovery of the dockur/windows project, which is really the easiest and most-performing option to set up a Windows VM
2. Realizing that we need to "bend" the internal network (used internally in the VM) from 20.20.20.x to the network of my host. Why? Because otherwise, syncing/downloading files from MMA would otherwise not work. Bending the internal network (and still using "NATting") is much easier to set up, compared to setting up "bridge networking" (where the VM would get a "real" 192.168.0.x IP from my physical LAN router)
I thought I should share it here, to save others the trouble of trying to emulate it with Wine, or wasting time figuring out why Wi-Fi sync doesn't work when running MM in a Virtual Machine.
The basic idea is to run MM in a Windows (11) Virtual Machine (VM), to get full compatibility (as opposed to running it in Wine), then configure the NIC in the VM to use the same network/IP as the host, to set up "Media Sharing" in MM using some port number that you also map from the host into the VM.
In more detail:
1. On your Linux host, install Docker
2. On your Linux host, make sure kvm is installed and that the kernel module is activated (there are many guides on the Internet, it can be as easy as "sudo dnf install -y qemu-kvm libvirt" + "sudo modprobe kvm" + "sudo modprobe kvm_intel" which works e.g. on Fedora)
3. Create a Windows 11 VM using the "dockur/windows" project found on Github (I cannot post direct links in this forum, so you'll have to search for it yourself). This project essentially ships a Docker image with various libraries (such as qemu) and scripts, which set up a new Windows VM from scratch, downloading the official installation ISOs from Microsoft, and making an unattended installation. To create a container from that image, I use the following Docker compose.yml (see the comments for where you need to replace values):
Code: Select all
services:
windows:
image: dockurr/windows
container_name: windows
environment:
# You may want to add more environment variables here, to further configure the VM
VERSION: "11"
VM_NET_IP: "192.168.0.222" # replace this with the IP of your Linux host
devices:
- /dev/kvm
- /dev/net/tun
cap_add:
- NET_ADMIN
ports:
- 8006:8006
- 3399:3389/tcp
- 3399:3389/udp
- 23227:23227 # you can use a different port number if you like
volumes:
- ./windows:/storage
- /path/to/your/music/on/host:/data # update the path
restart: always
stop_grace_period: 2m
5. In the VM, we must fix a DNS entry that points to "host.lan". By default, dockur/windows project configures "20.20.20.1" in the hosts file, so you need to change it. Open Notepad as administrator, then open the file "%WINDIR%\system32\drivers\etc\hosts" and update the 20.20.20.1 IP to the gateway IP of your network (e.g. 192.168.0.1).
6. Verify that when you open "\\host.lan" in Explorer, you see a "Data" folder that contains your files
7. MM seems to be unable to use this network drive as a location for your library, but you can instead use the Explorer feature to "map a network drive". This drive (e.g. "Z:\") can be added as "Local" location in MM just fine.
8. In the VM, download and install MM. In MM, set up your media library. Using xfreerdp, you should hear the music.
9. If you want Wi-Fi sync, in MM, click "Tools -> Options -> Library -> Media Sharing" and configure the sharing server. Make sure to use the same port as in the compose.yml shown above (23227). Now you can set up the sync server in the MMA app (the QR code should also work).
I hope this helps.
The primary insights (which took me a lot of time to figure out) were:
1. Discovery of the dockur/windows project, which is really the easiest and most-performing option to set up a Windows VM
2. Realizing that we need to "bend" the internal network (used internally in the VM) from 20.20.20.x to the network of my host. Why? Because otherwise, syncing/downloading files from MMA would otherwise not work. Bending the internal network (and still using "NATting") is much easier to set up, compared to setting up "bridge networking" (where the VM would get a "real" 192.168.0.x IP from my physical LAN router)