LIST natpf rules in Virtualbox/Vagrant

后端 未结 5 1933
执念已碎
执念已碎 2021-02-04 06:13

I often get errors like this when running Vagrant:

VBoxManage: error: A NAT rule of this name already exists
VBoxManage: error: Details: code NS_ERROR_INVALID_AR         


        
5条回答
  •  伪装坚强ぢ
    2021-02-04 06:39

    This got the job done for me:

    VBoxManage showvminfo $VM_NAME --machinereadable | awk -F '[",]' '/^Forwarding/ { printf ("Rule %s host port %d forwards to guest port %d\n", $2, $5, $7); }'
    

提交回复
热议问题