I want to use gitlab-runner virtualbox executor with just simple debian box so my vagrant file is
Vagrant.configure("2") do |config|
config.vm.box = "debian/buster64"
end
First approach
vagrant up- change name: settings->general->name "my-vm"
- shut down vm
sudo gitlab-runner register...some manual commands...sudo gitlab-runner install --user $(whoami)sudo gitlab-runner start
I can see my runner in my Gitlab Settings CI. It's green. Then I run my job and I get the following problem: ERROR: Preparation failed: VBoxManageOutput error: VBoxManage: error: Could not find a registered machine named my-vm but in my console
VBoxManage list vms
"my-vm" {aaf0b3ff-3c5b-4324-9b2f-034d26036278}
Second approach (from scratch)
vagrant up- change name: settings->general->name "my-vm"
- shut down vm
gitlab-runner register...some manual commands...WARNING: Running in user-mode. WARNING: The user-mode requires you to manually start builds processing: WARNING: $ gitlab-runner run WARNING: Use sudo for system-mode: WARNING: $ sudo gitlab-runner...sudo gitlab-runner install --user $(whoami)sudo gitlab-runner startgitlab-runner run
The Second approach fixed the problem: my runner can see the box and everything works as expected but new one appear:
I don't want to execute gitlab-runner run every time when I want to run jobs. I prefer the first approach but I get the problem when my runner cant find box.
I can use sudo vagrant up and then change name via sudo VBoxManage way and it will work but it looks like more as a workaround.
I can't find any example or explanation how I can solve my issue. How people do this in a area of good practices?