2
I have a hardware machine running Ubuntu 12.04 and a Selenium server hub connected to the internet through a public IP. On that machine I'm running two VirtualBox VMs running Selenium server nodes and a web server. The communication between the hub and the nodes needs to be bidirectional therefore VMs need to have the network connection set to bridge. But that doesn't work because I only have a single public IP.
Is there a way to make a virtual LAN between the VMs and the hardware machine so I can access the the virtualized web servers and Selenium servers from the hardware machine?
Thanks! Now I have another issue. I am able to select
Host-only Adapter
but theName:
select box doesn't have any values in it. And it seems I need to select an interface to attach to. – lucassp – 2013-10-24T12:21:08.093Nevermind, found it. – lucassp – 2013-10-24T12:28:58.453
@lucassp Also, you should remember that you can always reach machine behind NATs by means of "reverse ssh tunnels". There are lots of guides on Google on how to do it. My extra advice is to use a utility called autossh which restarts automatically if the connection is interrupted. The configuration on server and client are two one-liners, pretty simple. – MariusMatutiae – 2013-10-24T13:50:27.553
It seems I have another problem: the Selenium server nodes connect correctly to the Selenium server hub on the Host machine, but the Selenium server hub always tries to check the availability of the nodes using the NAT IP 10.0.0.x, and it fails, of course. If I disable NAT, everything is fine but I don't have internet on the VMs anymore. Any idea on how to fix it? – lucassp – 2013-10-24T14:14:22.530
Add another adapter to the VMs? One with Nat, one without? – MariusMatutiae – 2013-10-24T14:20:07.280
That's the problem. If I have two adapters on each VM one NAT (10.0.0.x) and Host only (192.168.56.x), and on each VM a Selenium server node connects to the Selenium server hub of the host machine (192.168.56.1), then the Selenium server hub on the host machine tries to check the nodes periodically using 10.0.0.x IPs and not using the local Host only network IPs. Therefore I need to disable NAT and lose my internet connection, and I still need it. – lucassp – 2013-10-24T14:33:16.840
Do you have access to the hub? I.e., something like telnet or ssh? – MariusMatutiae – 2013-10-24T14:44:32.573
The Hub runs on the Host machine and can be accessed using the "Host only" at 192.168.56.1. It looks like it's a Selenium issue: the nodes register themselves to the hub using the NAT IPs and not the "Host only" IPs. I will do some more tests tomorrow. http://stackoverflow.com/questions/13625153/not-able-to-register-selenium-webdriver-node-on-vm-to-the-hub-on-host
– lucassp – 2013-10-24T14:52:23.257Add a route in its routing table. – MariusMatutiae – 2013-10-24T14:56:10.457