Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ AnyVM includes a built-in, premium VNC Web UI that allows you to access the VM's
- **Fullscreen**: Toggle fullscreen mode for an immersive experience.
- **Stats**: Real-time FPS and latency monitoring.
- **Accessibility**: Available at `http://localhost:6080` by default. If the port is occupied, AnyVM will automatically try the next available port (e.g., 6081, 6082).
- **Remote Access**: Use `--remote-vnc` to automatically create a public, secure tunnel (via Cloudflare, Localhost.run, or Pinggy) to access your VM's display from anywhere in the world. (In Google Cloud Shell, this is enabled by default; use `--remote-vnc no` to disable).
- **Remote Access**: Use `--remote-vnc` to automatically create a public, secure tunnel (via Cloudflare, Localhost.run, Pinggy, or Serveo) to access your VM's display from anywhere in the world. (In Google Cloud Shell, this is enabled by default; use `--remote-vnc no` to disable).

## 9. CLI options (with examples)

Expand Down Expand Up @@ -237,9 +237,9 @@ All examples below use `python3 anyvm.py ...`. You can also run `python3 anyvm.p
- **VNC Web UI**: Enabled by default starting at port `6080` (auto-increments if busy). Use `--vnc off` to disable.
- Example: `python3 anyvm.py --os freebsd --vnc 0`

- `--remote-vnc`: Create a public tunnel for the VNC Web UI using Cloudflare, Localhost.run, or Pinggy.
- `--remote-vnc`: Create a public tunnel for the VNC Web UI using Cloudflare, Localhost.run, Pinggy, or Serveo.
- Example: `python3 anyvm.py --os freebsd --remote-vnc`
- Advanced: Use `cf`, `lhr`, or `pinggy` to specify a service: `python3 anyvm.py --os freebsd --remote-vnc cf`
- Advanced: Use `cf`, `lhr`, `pinggy`, or `serveo` to specify a service: `python3 anyvm.py --os freebsd --remote-vnc cf`
- Disable: Use `no` to disable (e.g., in Google Cloud Shell where it's default): `python3 anyvm.py --os freebsd --remote-vnc no`

- `--mon <port>`: Expose the QEMU monitor via telnet on localhost.
Expand Down
16 changes: 12 additions & 4 deletions anyvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2155,15 +2155,21 @@ def tunnel_manager():
},
{
'name': 'Localhost.run',
'cmd': lambda: ["ssh", "-o", "StrictHostKeyChecking=no", "-o", "BatchMode=yes", "-o", "ExitOnForwardFailure=yes", "-o", "ConnectTimeout=10", "-R", "80:localhost:{}".format(web_port), "[email protected]"],
'cmd': lambda: ["ssh", "-F", "/dev/null" if sys_name != "windows" else "NUL", "-T", "-o", "StrictHostKeyChecking=no", "-o", "IdentitiesOnly=yes", "-o", "BatchMode=yes", "-o", "ExitOnForwardFailure=yes", "-o", "ConnectTimeout=10", "-R", "80:localhost:{}".format(web_port), "[email protected]"],
'regex': r"https?://[a-z0-9.-]+\.lhr\.(?:life|proxy\.localhost\.run|localhost\.run)",
'msg': "Open this link to access WebVNC (via Localhost.run): {}"
},
{
'name': 'Pinggy',
'cmd': lambda: ["ssh", "-o", "StrictHostKeyChecking=no", "-o", "BatchMode=yes", "-o", "ExitOnForwardFailure=yes", "-o", "ConnectTimeout=10", "-p", "443", "-R", "80:localhost:{}".format(web_port), "a.pinggy.io"],
'cmd': lambda: ["ssh", "-F", "/dev/null" if sys_name != "windows" else "NUL", "-T", "-o", "StrictHostKeyChecking=no", "-o", "IdentitiesOnly=yes", "-o", "BatchMode=yes", "-o", "ExitOnForwardFailure=yes", "-o", "ConnectTimeout=10", "-p", "443", "-R", "80:localhost:{}".format(web_port), "a.pinggy.io"],
'regex': r"https?://[a-z0-9.-]+\.pinggy\.link",
'msg': "Open this link to access WebVNC (via Pinggy): {}"
},
{
'name': 'Serveo',
'cmd': lambda: ["ssh", "-o", "StrictHostKeyChecking=no", "-o", "ExitOnForwardFailure=yes", "-o", "ConnectTimeout=10", "-R", "80:localhost:{}".format(web_port), "serveo.net"],
'regex': r"https?://[a-z0-9.-]+\.(?:serveo\.net|serveousercontent\.com)",
'msg': "Open this link to access WebVNC (via Serveo): {}"
}
]

Expand All @@ -2176,6 +2182,8 @@ def tunnel_manager():
strategies = [s for s in strategies if s['name'] == 'Localhost.run']
elif "pinggy" in req:
strategies = [s for s in strategies if s['name'] == 'Pinggy']
elif "serveo" in req:
strategies = [s for s in strategies if s['name'] == 'Serveo']

for strat in strategies:
cmd = strat['cmd']()
Expand Down Expand Up @@ -2392,8 +2400,8 @@ def print_usage():
--vnc <display> Enable VNC on specified display (e.g., 0 for :0).
Default: enabled (display 0). Web UI starts at 6080 (increments if busy).
Use "--vnc off" to disable.
--remote-vnc Create a public URL for the VNC Web UI using Cloudflare, Localhost.run, or Pinggy.
Usage: --remote-vnc (auto), --remote-vnc cf, --remote-vnc lhr, --remote-vnc pinggy.
--remote-vnc Create a public URL for the VNC Web UI using Cloudflare, Localhost.run, Pinggy, or Serveo.
Usage: --remote-vnc (auto), --remote-vnc cf, --remote-vnc lhr, --remote-vnc pinggy, --remote-vnc serveo.
Enabled by default if no local browser is detected (e.g., in Cloud Shell).
Use "--remote-vnc no" to disable.
--remote-vnc-link-file Specify a file to write the remote VNC link to (instead of the default .remote file).
Expand Down