GitLab Runner with Virtualbox executor cannot handle concurrent jobs

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 = ""

New contributor

Roli Mayer is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật