I have a problem getting my RMI application to work. Having a RMI Server app running in a VMWare that forwards port 1099 in a NAT enviroment.
Physical machines IP on the outside =
Physical machines IP in local area =
Virtual machines IP =

I start a rmiregistry on my virtual machine and since port 1099 is NAT-forwarded I can connect to the registry from the outside using telnet

I startup my serverside rmi-app on the virtual machine
and in my app I do the following binding:
System.getProperties().put("java.rmi.server.hostname", HOST);
Registry reg = LocateRegistry.createRegistry Registry.REGISTRY_PORT);
Naming.rebind("//"+ HOST + ":1099/" + CommandBroker.NAME, this);
This work fine with HOST= or HOST= but when setting HOST= (the public IP address), startup fails with:
java.rmi.AccessException: Registry.Registry.rebind disallowed; origin / is non-local host
When server is running with HOST= or HOST= (like I said using HOST= doesn't work at all, the server is not allowed to bind) the binding from the outside using my client-app works (bind to the public IP) , but however when trying to actually use the remote object the client throws the following exception:
Using HOST= on serverside
Operation timed out: connect:could be due to invalid address
or when server HOST=
java.net.ConnectException: Connection refused: connect
	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:585)
I assume using the public IP on serverside by setting HOST= to is the right way, but as stated above binding to the rmiregistry is not allowed! What am I missing?

Thanks alot, your help is very much appreciated.