diff options
| author | Louis Burda <dev@sinitax.com> | 2026-02-22 14:29:33 +0100 |
|---|---|---|
| committer | Louis Burda <dev@sinitax.com> | 2026-02-22 14:29:33 +0100 |
| commit | c36faf0ba768088266fc9f9053ee8b10af5343f5 (patch) | |
| tree | 2d151132f3c86f04054d45cb201a6777f6026c89 | |
| parent | 564fb4e818636ef8eaaa67accd1460196e0ba79d (diff) | |
| download | incus-fwd-main.tar.gz incus-fwd-main.zip | |
| -rwxr-xr-x | incus-fwd | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -436,6 +436,18 @@ examples: print(f"Error: Unable to access instance '{args.instance}'", file=sys.stderr) sys.exit(1) + try: + instance_type = subprocess.check_output( + ['incus', 'list', '--format=csv', '--columns=t', args.instance], + stderr=subprocess.DEVNULL, + text=True + ).strip() + if instance_type.upper() == 'VIRTUAL-MACHINE': + print(f"Warning: Instance '{args.instance}' is a VM. Port forwarding only works with containers.", file=sys.stderr) + sys.exit(1) + except (FileNotFoundError, subprocess.CalledProcessError): + pass + existing_mappings, device_to_mapping = load_existing_mappings(args.instance) reset_mode = args.map_all or args.unmap_all |
