I would like to run 2 (more than 1) jobs concurrently with my preconfigured virtualbox executor (Windows 10 base image). The Virtualbox creates two instances of my base image (xyz-concurrent-0 and xyz-concurrent-1), and starting the jobs together, and the runner get them up, the first one works correctly, but the second one always fails with the following error message:
Log of the job which started a bit earlier:
Running with gitlab-runner 16.10.0 (81ab07f6)
on Runner_1 93V7Dm8Bk, system ID: s_a1f2f83ac892
Preparing the "virtualbox" executor
01:55
Using VirtualBox version 7.0.14r161095 executor...
Creating new VM...
Creating default snapshot...
Waiting for VM to become responsive...
Starting SSH command...
Preparing environment
00:02
Running on WIN10 via
EVH11716WS...
Getting source from Git repository
00:12
Fetching changes with git depth set to 20...
Initialized empty Git repository in C:/Users/gitlab-user/builds/roland.mayer/roli-dummy-project/.git/
Created fresh repository.
warning: auto-detection of host provider took too long (>2000ms)
warning: see https://aka.ms/gcm/autodetect for more information.
fatal: Unable to persist credentials with the 'wincredman' credential store.
See https://aka.ms/gcm/credstores for more information.
Checking out 6cce2e68 as detached HEAD (ref is main)...
git-lfs/3.4.1 (GitHub; windows amd64; go 1.20.11; git 0898dcbc)
Skipping Git submodules setup
Executing "step_script" stage of the job script
00:32
$ powershell -File echo.ps1
WIN10
WIN10
WIN10
Cleaning up project directory and file based variables
00:01
Job succeeded
Log of the job which started a bit later:
Running with gitlab-runner 16.10.0 (81ab07f6)
on Runner_1 93V7Dm8Bk, system ID: s_a1f2f83ac892
Preparing the "virtualbox" executor
00:25
Using VirtualBox version 7.0.14r161095 executor...
Creating new VM...
ERROR: Preparation failed: VBoxManageOutput error: vboxmanage.exe: error: Locking of attached media failed. A possible reason is that one of the media is attached to a running VM
vboxmanage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component SessionMachine, interface IMachine
Will be retried in 3s ...
Using VirtualBox version 7.0.14r161095 executor...
Restoring VM from snapshot...
Previous VM failed. Deleting, because VBoxManageOutput error:
Creating new VM...
ERROR: Preparation failed: VBoxManageOutput error: vboxmanage.exe: error: Locking of attached media failed. A possible reason is that one of the media is attached to a running VM
vboxmanage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component SessionMachine, interface IMachine
Will be retried in 3s ...
Using VirtualBox version 7.0.14r161095 executor...
Restoring VM from snapshot...
Previous VM failed. Deleting, because VBoxManageOutput error:
Creating new VM...
ERROR: Preparation failed: VBoxManageOutput error: vboxmanage.exe: error: Locking of attached media failed. A possible reason is that one of the media is attached to a running VM
vboxmanage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component SessionMachine, interface IMachine
Will be retried in 3s ...
ERROR: Job failed (system failure): VBoxManageOutput error: vboxmanage.exe: error: Locking of attached media failed. A possible reason is that one of the media is attached to a running VM
vboxmanage.exe: error: Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component SessionMachine, interface IMachine
I have tried out different configurations, such as:
- one runner with 2 concurrent jobs allowed
concurrent = 2
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "Runner_1"
url = "myurl"
id = 1
token = "mytoken"
token_obtained_at = 2024-04-19T10:36:11Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "virtualbox"
shell = "powershell"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.ssh]
user = "gitlab-user"
identity_file = "C:\Users\myuser\.ssh\id_ed25519"
disable_strict_host_key_checking = true
[runners.virtualbox]
base_name = "Win10_prepare"
base_folder = ""
disable_snapshots = false
start_type = ""
- two runners with 2 concurrent jobs allowed
concurrent = 2
check_interval = 0
shutdown_timeout = 0
[session_server]
session_timeout = 1800
[[runners]]
name = "Runner_1"
url = "myurl"
id = 1
token = "mytoken"
token_obtained_at = 2024-04-19T10:36:11Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "virtualbox"
shell = "powershell"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.ssh]
user = "gitlab-user"
identity_file = "C:\Users\myuser\.ssh\id_ed25519"
disable_strict_host_key_checking = true
[runners.virtualbox]
base_name = "Win10_prepare"
base_folder = ""
disable_snapshots = false
start_type = ""
[[runners]]
name = "Runner_2"
url = "myurl"
id = 2
token = "mytoken"
token_obtained_at = 2024-04-19T10:36:11Z
token_expires_at = 0001-01-01T00:00:00Z
executor = "virtualbox"
shell = "powershell"
[runners.cache]
MaxUploadedArchiveSize = 0
[runners.ssh]
user = "gitlab-user"
identity_file = "C:\Users\myuser\.ssh\id_ed25519"
disable_strict_host_key_checking = true
[runners.virtualbox]
base_name = "Win10_prepare"
base_folder = ""
disable_snapshots = false
start_type = ""
Roli Mayer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.