Accessing TeamCity server from virtual machine
Hello,
I'm trying to configure TeamCity server with build agent on locally installed virtual machine (both have Windows 7). I noticed that when I start the server with runAll.bat and the agent with agent.bat then it works. But when I use either server or agent as Windows service then it doesn't work anymore. Is there any additional setup required for connectivity in Windows service mode?
Regards,
Piotr
Please sign in to leave a comment.
Do you see any errors in teamcity-server.log?
I don't see any errors in teamcity-server.log. I see the following in teamcity-agent.logs on VM side:
[2012-01-12 20:21:21,539] INFO - buildServer.AGENT.registration - Registering on server http://192.168.0.162, AgentDetails{Name='WIN-MJKEHHSRB6O', AgentId=null, BuildId=null, AgentAddress='192.168.0.136', AlternativeAddresses=[192.168.0.136], Port=9090, Version='18130', PluginsVersion='18130->SHA-1P1lbz5ePDKIIjLEwutIQOuoNq/g=&SHA-1Ryiqyt200emEq4eq8qoXTAmmDFk=', AvailableRunners=[Ant, dotnet-dupfinder, Duplicator, FxCop, gradle-runner, Inspection, Ipr, jetbrains.dotNetGenericRunner, jetbrains.mspec, jetbrains_powershell, JPS, Maven2, MSBuild, MSTest, NAnt, NUnit, rake-runner, simpleRunner, sln2003, VS.Solution], AvailableVcs=[perforce, mercurial, jetbrains.git, svn, cvs], AuthorizationToken='56921fd574b98d7ba0b5eb8b49e7fd01'}
[2012-01-12 20:21:42,645] WARN - buildServer.AGENT.registration - Call http://192.168.0.162/RPC2 buildServer.registerAgent3: java.net.ConnectException: Connection timed out: connect
[2012-01-12 20:21:42,645] WARN - buildServer.AGENT.registration - Connection to TeamCity server is probably lost. Will be trying to restore it. Take a look at logs/teamcity-agent.log for details (unless you're using custom logging).
The IP of my computer is 192.168.0.162 and the IP of VM is 192.168.0.136.
The sitation is the same in 3 scenarios:
- server started as Windows service and agent started as Windows service
- server started using bat file and agent started as Windows service
- server started as Windows service and agent started using bat file
Only when I start both agent and server using bat files it works.
Thanks,
Piotr
Hi Piotr
It looks like firewall issue. Could you recheck it doesn't block the connections.
TeamCity web server should be accessible from build agent's machine.
You are right, thanks. I thought I tried to disable the firewall before but apparently I disabled it only on one side. When I disabled the firewall on both my computer and the virtual machine it started to work. But I still cannot make it work with Firewall enabled.
I tried to add the programs run by the Windows services to the firewall exception list:
- c:\BuildAgent\launcher\bin\TeamCityAgentService-windows-x86-32.exe for agent on VM
- c:\TeamCity\bin\tomcat6.exe for server on my computer
But it didn't work.
Is there a more specific configuration that needs to be done? For example in advanced Windows firewall settings?
Removed duplicate message
No advanced configuration should be required, the server and its agents communicate by HTTP, so just one TCP-port is required at each computer.
With default settings they are
You can try co connect to the agent useng a browser. A request to http://<host>:9090/ sould return
OK, the issue was that I couldn't connect to host:9090 from my computer to VM. Adding an inbound rule in the Windows firewall to open the port 9090 on VM side did the trick.
Thank you!
Piotr
OK, the issue was that I couldn't connect to host:9090 from my computer to VM. Adding an inbound rule in the Windows firewall to open the port 9090 on VM side did the trick.
Thank you!
Piotr
OK, the issue was that I couldn't connect to host:9090 from my computer to VM. Adding an inbound rule in the Windows firewall to open the port 9090 on VM side did the trick.
Thank you!
Piotr