Thursday, June 5, 2014

Configuring NAT for Virtual Box on Windows using VBoxManage modifyvm

c:\Program Files\Oracle\VirtualBox>
c:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm "U12.04ODLController" --n
atpf1 "netioludpnat,udp,173.39.49.192,,10.0.2.15,49150"

c:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm "U12.04ODLController" --n
atpf1 "netioltcpnat,tcp,173.39.49.192,,10.0.2.15,49150"

c:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm "U12.04ODLController" --n
atpf1 "netioludpnat,udp,173.39.49.192,,10.0.2.15,49150"
VBoxManage.exe: error: A NAT rule of this name already exists
VBoxManage.exe: error: Details: code E_INVALIDARG (0x80070057), component NATEng
ine, interface INATEngine, callee IUnknown
VBoxManage.exe: error: Context: "AddRedirect(Bstr(strName).raw(), proto, Bstr(st
rHostIp).raw(), RTStrToUInt16(strHostPort), Bstr(strGuestIp).raw(), RTStrToUInt1
6(strGuestPort))" at line 1655 of file VBoxManageModifyVM.cpp

c:\Program Files\Oracle\VirtualBox>
c:\Program Files\Oracle\VirtualBox>
c:\Program Files\Oracle\VirtualBox>
c:\Program Files\Oracle\VirtualBox>
c:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm "U12.04ODLController" --n
atpf1 delete "netioludpnat"

c:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm "U12.04ODLController" --n
atpf1 delete "netioltcpnat"

c:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm "U12.04ODLController" --n
atpf1 "netioludpnat,udp,173.39.49.192,*,10.0.2.15,49150"

c:\Program Files\Oracle\VirtualBox>VBoxManage modifyvm "U12.04ODLController" --n
atpf2 "netioltcpnat,tcp,173.39.49.192,*,10.0.2.15,49150"

c:\Program Files\Oracle\VirtualBox>