I am trying to get the VirtualBox plugin working with Jenkins. My plan is then to hook up the Selenium plugin as well and get a grid running on the VirtualBox cloud. When I follow the instructions on the plugin page to create the new node, that works fine. When I try to launch the slave agent, the VM does start up, but I continuously get the following error during SSH connection until it reaches the maximum number of attempts:
[VirtualBox] Launching node ubuntu-12.10-desktop-i386
[VirtualBox] Powering up VirtualBoxMachine{host=VirtualBoxHost{url='http://localhost:18083', username='*MY DOMAIN/USER NAME ON MY LOCAL MACHINE IS HERE*'},name='ubuntu-12.10-desktop-i386'}...
[VirtualBox] starting node ubuntu-12.10-desktop-i386 from state PoweredOff
[VirtualBox] node ubuntu-12.10-desktop-i386 started
[VirtualBox] Sleep before stage 2 launcher, attempt 1
[VirtualBox] Starting stage 2 launcher (SSHLauncher)
[01/04/13 14:13:26] [SSH] Opening SSH connection to 192.168.56.100:22.
java.io.IOException: There was a problem while connecting to 192.168.56.100:22
at com.trilead.ssh2.Connection.connect(Connection.java:793)
at com.trilead.ssh2.Connection.connect(Connection.java:565)
at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:693)
at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:278)
at hudson.plugins.virtualbox.VirtualBoxComputerLauncher.delegateLaunch(VirtualBoxComputerLauncher.java:80)
at hudson.plugins.virtualbox.VirtualBoxComputerLauncher.launch(VirtualBoxComputerLauncher.java:64)
at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:199)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at com.trilead.ssh2.transport.TransportManager.establishConnection(TransportManager.java:346)
at com.trilead.ssh2.transport.TransportManager.initialize(TransportManager.java:454)
at com.trilead.ssh2.Connection.connect(Connection.java:733)
... 11 more
[01/04/13 14:13:28] [SSH] Connection closed.
[VirtualBox] Stage 2 launcher completed
[VirtualBox] Sleep before stage 2 launcher, attempt 2
(etc...)
This is my configuration:
Why is this not working?
UPDATE: The slave VM is running Ubuntu and openssh-server is in fact running once I log in on that VM. I have made a couple of more updates since posting here, some based on an answer to Stack Overflow question How to SSH to a VirtualBox Ubuntu guest externally through a Windows host?. A few questions that might help solve this:
- When Jenkins boots up the slave VM, does Ubuntu need to be configured so that it automatically logs into the desired user's account?
- If not, how do I tell Jenkins to log in as a specific user?
- Does it matter if it logs into the Guest account or one with more privileges?
- What should my network configuration settings look like? This is what I have currently: