Jenkins VirtualBox插件启动代理失败问题求助(适配VirtualBox 5.1.6)
Let's dig into why your Jenkins VirtualBox agent isn't coming online, even though the VM starts up fine. I've dealt with this exact scenario with older Jenkins and VirtualBox versions, so here's what to check step by step for your setup (Jenkins 2.89.2, VirtualBox 5.1.6):
1. First, Confirm Network Connectivity Between VM and Jenkins Master
The biggest culprit here is usually a network block stopping the VM from reaching the Jenkins master. Here's how to verify:
- Log into the running VM manually (use the VirtualBox GUI, or run
VBoxManage startvm "Automatic Test setup" --type headlessthenVBoxManage controlvm "Automatic Test setup" screenshotpng vm.pngto check the VM state without GUI access). - Run
ping 10.1.20.81(your Jenkins master's IP from the logs) inside the VM. If this fails:- Check VirtualBox network settings for the VM: make sure you're using a Bridged Adapter (if the VM and Jenkins are on the same physical network) or a Host-Only Adapter with matching IP ranges.
- Firewall rules: double-check that both the Jenkins host and VM allow traffic on port 18083 (VirtualBox web service) and the Jenkins JNLP port (default is 50000—confirm this in Jenkins under
Manage Jenkins > Configure Global Security > Agents).
2. Validate JNLP Launcher Configuration in Jenkins
Sometimes the JNLP setup is misconfigured, even if the VM is running:
- Go to your node's config page (
Manage Jenkins > Manage Nodes > Automatic Test setup > Configure):- Confirm the Launch method is set to "Launch agent via Java Web Start" (JNLP), and leave the "Tunnel connection through" field empty unless you're using a proxy (which doesn't seem to be the case here).
- Check global security settings (
Manage Jenkins > Configure Global Security):- Ensure "Agents" are allowed to connect via JNLP. If you're using a fixed JNLP port, make sure that port is open and reachable from the VM.
- If you require agent authentication, verify the VM has the correct credentials (or temporarily allow anonymous agent connections for testing—just don't leave that enabled for production).
3. Double-Check VirtualBox Plugin and Web Service Setup
Since you're using a custom plugin branch for VirtualBox 5.1.6, let's rule out plugin-related issues:
- Check Jenkins system logs (
Manage Jenkins > System Log) for any plugin initialization errors—custom branches sometimes have missing dependencies or compatibility quirks. - On the VirtualBox host machine (10.1.20.81):
- Run
VBoxManage list extpacksto confirm the VirtualBox Extension Pack is installed (this is required for the web service to function). - Restart the VirtualBox web service to fix intermittent glitches:
VBoxManage web-service --stop VBoxManage web-service --start
- Run
4. Give the VM More Time to Boot Before Launching JNLP
Your logs show Jenkins is trying to launch the JNLP agent immediately after the VM starts, but the VM might not be fully booted or have network connectivity ready yet:
- Go back to your node's config and increase the "Sleep before stage 2 launcher" timeout—try setting it to 60 seconds (up from whatever the default is) to give the VM time to finish booting and initialize the network.
- Test launching the JNLP agent manually:
- From the Jenkins node page, click "Launch" to download the JNLP file. Transfer it to the VM and run it with
javaws agent.jnlp. Any error messages here will tell you exactly what's wrong (e.g., certificate issues, incorrect Jenkins URL, network timeouts).
- From the Jenkins node page, click "Launch" to download the JNLP file. Transfer it to the VM and run it with
5. Account for Older Jenkins Version Quirks
Jenkins 2.89.2 is a fairly old version, so keep these compatibility notes in mind:
- Make sure your custom VirtualBox plugin branch is explicitly compatible with Jenkins 2.89.2—some newer plugin features might break on older Jenkins versions.
- Both the Jenkins master and VM need to run Java 8. Jenkins 2.89.2 doesn't support newer Java versions, and using Java 11+ on the VM can cause JNLP connection failures.
内容的提问来源于stack exchange,提问作者Chen He

