Skip to content

ericbuess/vm-bridge

Repository files navigation

VM Bridge

This is my personal Mac + Parallels Ubuntu setup. Fork it and have your AI tool adapt it to your environment.

Bidirectional communication between VMs and host machines, bypassing mosh/tmux clipboard limitations.

Why You Need This

  • Mosh has a ~12KB clipboard limit that truncates large content
  • OSC 52 doesn't work reliably over mosh/tmux
  • No way to trigger host operations from within VM
  • Need bidirectional communication between VM and host

What It Does

  • Unlimited clipboard between VM and host (50MB+)
  • Run commands on host from VM
  • Run commands on VM from host
  • File transfers between systems
  • Notifications from VM to host
  • URL opening on host from VM
  • Extensible - add any command you need

My Setup

  • macOS host (10.211.55.2) with mac_daemon_network.py on port 9999
  • Ubuntu VM (10.211.55.4) with vm_daemon.py on port 9998
  • Python-based daemons for bidirectional communication

Available Commands

Command Description Direction
pbcopy Copy to Mac clipboard VM→Mac
pbpaste Paste from Mac clipboard VM→Mac
notify Show Mac notification VM→Mac
open_url Open URL in Mac browser VM→Mac
run_command Execute shell commands Both ways
read_file Read files Both ways
claude Run Claude CLI (if installed) VM→Mac

Adding Your Own Commands

Edit the COMMANDS dict in the daemon:

COMMANDS = {
    'your_command': {
        'binary': '/path/to/program',
        'allow_stdin': True,
        'allow_args': True,
        'description': 'What it does'
    }
}

Make It Yours

# 1. Fork this repo on GitHub, then clone YOUR fork
git clone https://github.com/yourusername/vm-bridge

# 2. Have your AI adapt it
claude "Adapt this VM bridge for [your environment]"
# or
cursor "Make this work with my VMware/WSL2/Docker setup"

Your AI can:

  • Update IPs for your network
  • Change commands for your OS (pbcopy → clip.exe, etc.)
  • Rewrite in your preferred language
  • Add features you need

Quick Start (my setup)

Mac:

python3 mac_daemon_network.py  # Listens on 0.0.0.0:9999

Ubuntu VM:

python3 vm_daemon.py  # Listens on 0.0.0.0:9998
python3 vm_client.py  # Test it

Files

  • mac_daemon_network.py - Host daemon (receives from VM)
  • vm_daemon.py - VM daemon (receives from host)
  • vm_client.py - VM→Host client
  • mac_to_vm_test.py - Host→VM test script
  • bridge_demo.py - Full demo

Security

  • IP whitelist (only local network)
  • Command whitelist (no arbitrary execution)
  • Size limits per command
  • Direct binary execution (no shell injection)

License

MIT - Fork it, change it, make it work for you.

About

SSH tunnel daemon for VM-to-Mac communication, bypassing mosh/tmux clipboard limitations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •