Have you tried checking out the ports for ambari?
Those ports should only be for the web interfaces not the server if your trying to gain connectivity.
For the cli commands you can port forward with this command:
sudo iptables -A INPUT -i eth0 –proto tcp –dport 12345 -j ACCEPT
or if you did install SSH then you can specify in this way:
I would have to tinker with you on this project because it dives past my understanding of the sandbox’s connection and the headless ubuntu server. I would have to double check ifconfig and port connections. best of luck, please let me know if I can try and help.