Error when molecule through vagrant start VM in vbox (Windows, WSL2)

26 Views Asked by At

My env is like this :

Molecule with Vagrant 2.4.1 in WSL2 (Debian 12). Windows 10 with Vagrant 2.4.1 and VirtualBox 7.0.1

molecule.yml below

---
dependency:
  name: galaxy
  enabled: false
prerun: false
driver:
  name: vagrant
  provider:
    name: virtualbox
lint: |
  yamllint .
  ansible-lint .
platforms:
  - name: peertube-host
    box: debian/buster64
    memory: 2048
    cpu: 2
    interfaces:
      - auto_config: true
        network_name: private_network
        type: static
        ip: "192.168.56.4"
provisioner:
  name: ansible
  log: True
  env:
    ALLOW_WORLD_READABLE_TMPFILES: True
    ANSIBLE_FORCE_COLOR: true
    ANSIBLE_ROLES_PATH: ../../roles:../../roles-dependencies/
    ANSIBLE_COLLECTIONS_PATH: $PWD/collections-dependencies/
    ANSIBLE_VERBOSITY: 3
  playbooks:
    converge: ../../site.yml
  inventory:
    links:
      group_vars: ../../inventories/molecule/group_vars/
verifier:
  name: testinfra
  options:
    junit-xml: default-report.xml
    o: "junit_family=legacy"

When I do a molecule create my vm is created correctly but it doesn't start because of headless mode error.

        "There was an error while executing `VBoxManage`, a CLI used by Vagrant",
        "for controlling VirtualBox. The command and stderr is shown below.",
        "",
        "Command: [\"startvm\", \"2fa5ff42-1aec-47ba-a7cb-2b161bff3cf6\", \"--type\", \"headless\"]",
        "",
        "Stderr: VBoxManage.exe: error: The virtual machine 'default_peertube-host_1710842684897_81290' has terminated unexpectedly during startup with exit code -1073741819 (0xc0000005)",
        "VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component MachineWrap, interface IMachine"

In Windows Application Logs Viewer, i can read :

Faulting application name VBoxHeadless.exe, version: 7.0.14.11095, timestamp: 0x65a53a70
Failing module name: VBoxHeadless.exe, version: 7.0.14.11095, timestamp: 0x65a53a70
Exception code: 0xc0000005
Error offset: 0x000000000001b21b
Failing process ID: 0x245c
Start time of the failing application: 0x01da79e4e25c2618
Path of the faulting application: C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe
Path of the faulting module: C:\Program Files\Oracle\VirtualBox\VBoxHeadless.exe
Report ID: 6771c359-7ee3-494a-806a-6be9772f8535
Full name of the failing package:
Application ID relating to the failing package:

I try direclty with Vagrant inside WSL, I've set a new vagrantfile with this setting, to start VM in GUI mode and it works :

  config.vm.provider "virtualbox" do |v|
   v.gui = true
  end

So, how to fix headless issue ? or how to set GUI mode inside my molecule.yml

0

There are 0 best solutions below