0

I want to setup port forwarding for my virutal machine in VMWare. I know I can do this with the Virtual Network Editor in VMware Workstation Pro, but I need to setup this port forwarding using a powershell script which means I need to do it using some command. I cannot seem to find any documentation on this besides a solution for VMWare Fusion. Has anyone tried setting up port forwarding in VMWare Workstation using the command line?

John
  • 101
  • Looks like you want to check here potentially for a starting point: https://docs.vmware.com/en/VMware-Fusion/13/com.vmware.fusion.using.doc/GUID-24F54E24-EFB0-4E94-8A07-2AD791F0E497.html and search for `setPortForwarding`. Read it over, try some things, then come back and show what you've tried and is not working if that does not help with an [edit]. We're not supposed to just write people scripts for SU etiquette reasons unless they show their code and effort in on the matter. Good luck, ping me back if you want too. – Vomit IT - Chunky Mess Style Jul 22 '23 at 20:20
  • As per https://www.vmware.com/pdf/vix162_vmrun_command.pdf, I see it states *"The vmrun utility runs on any VMware platform with VIX libraries installed, including VMware Workstation, VMware Fusion, and VMware Server. For information about the various facilities that `vmrun` controls, see the user documentation for your product."*. See here for installing PowerShell solution (PowerCLI) too: https://docs.vmware.com/en/VMware-vSphere/7.0/com.vmware.esxi.install.doc/GUID-F02D0C2D-B226-4908-9E5C-2E783D41FE2D.html and https://developer.vmware.com/web/tool/13.1.0/vmware-powercli – Vomit IT - Chunky Mess Style Jul 22 '23 at 20:24
  • @VomitIT-ChunkyMessStyle the first vmware docs you are linking to states: "Only Fusion Pro supports the host network commands." so this is why I disregarded this. At the moment I'm trying the solution presented here: https://superuser.com/a/726147/1822210 but I cannot see the change in Virtual Network Editor after a restart of the VMware NAT Service so I'm trying to debug this at the moment. – John Jul 23 '23 at 11:14
  • @VomitIT-ChunkyMessStyle Nevermind your suggestion with vmrun just works :) – John Jul 23 '23 at 11:23

0 Answers0