# ansible shell module unable to 'vagrant up' on remote host via playbook

**URL:** <https://forum.ansible.com/t/ansible-shell-module-unable-to-vagrant-up-on-remote-host-via-playbook/37235>\
**Category:** Ansible Project\
**Tags:** ubuntu\
**Created:** [October 16, 2022, 7:57pm UTC](https://forum.ansible.com/t/ansible-shell-module-unable-to-vagrant-up-on-remote-host-via-playbook/37235 "2022-10-16T19:57:24Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oremo\_Ojwang](https://avatars.discourse-cdn.com/v4/letter/o/c68b51/32.png) [@Oremo\_Ojwang](https://forum.ansible.com/u/Oremo_Ojwang)\
**Post date:** [October 16, 2022, 7:57pm UTC](https://forum.ansible.com/t/ansible-shell-module-unable-to-vagrant-up-on-remote-host-via-playbook/37235/1 "2022-10-16T19:57:24Z")

</div>

I intend to launch a number of of vms on multiple host machines. So I have a playbook that installs vagrant and virtualbox on the host machine. Following the installations, the playbook then copies specific Vagrantfile from the ansible controller to the remote host where vms are to be lauched via ‘vagrant up’.  
NB:

I am able to run the ‘vagrant up’ on the target machine but an error is thrown when I use the ansible playbook  
Before running the ansible, I already have set up a sudoer user called devops.  
Target host machines are ubuntu 22 desktop  
ansible version 2.10.8  
vagrant version 2.3.1  
virtualbox version 6.1

Below is the playbook content:

---

<div class="post-metadata">

**Author:** ![Oremo\_Ojwang](https://avatars.discourse-cdn.com/v4/letter/o/c68b51/32.png) [@Oremo\_Ojwang](https://forum.ansible.com/u/Oremo_Ojwang)\
**Post date:** [October 17, 2022, 6:45am UTC](https://forum.ansible.com/t/ansible-shell-module-unable-to-vagrant-up-on-remote-host-via-playbook/37235/2 "2022-10-17T06:45:56Z")

</div>

NB: The ansible controller is a multipass running ubuntu 22.04

---

<div class="post-metadata">

**Author:** ![dnmvisser](https://avatars.discourse-cdn.com/v4/letter/d/8e8cbc/32.png) [@dnmvisser](https://forum.ansible.com/u/dnmvisser)\
**Post date:** [October 17, 2022, 7:06am UTC](https://forum.ansible.com/t/ansible-shell-module-unable-to-vagrant-up-on-remote-host-via-playbook/37235/3 "2022-10-17T07:06:29Z")

</div>

Hii

Some comments inline below

> &nbsp;&nbsp;- name: install prerequisites  
> &nbsp;&nbsp;&nbsp;&nbsp;apt:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;name: libfuse2  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;state: present

I'm surprised that this doesn't need "become: true"?

> &nbsp;&nbsp;- name: move to vagrant-deploy and launch vms for this host  
> &nbsp;&nbsp;&nbsp;&nbsp;shell:  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cmd: vagrant up  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;chdir: /home/devops/vagrant-deploy/  
> &nbsp;&nbsp;&nbsp;&nbsp;become: yes

And I'm surprised that running vagrant needs 'become: yes'.  
AFAIK vagrant does not need this.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"start": "2022-10-15 12:08:49.181709",

> &nbsp;&nbsp;&nbsp;&nbsp;"stderr": "There was an error while executing `VBoxManage`, a CLI used by Vagrant\nfor controlling VirtualBox. The command and stderr is shown below.\n\nCommand: [\"showvminfo\", \"9420c5e1-629e-4148-8ce1-92658357a477\"]\n\nStderr: /usr/lib/virtualbox/VBoxManage: /tmp/.mount\_vagranMxQRIa/usr/lib/libcurl.so.4: no version information available (required by /usr/lib/virtualbox/VBoxRT.so)\nVBoxManage: error: Failed to create the VirtualBox object!\nVBoxManage: error: Code NS\_ERROR\_ABORT (0x80004004) - Operation aborted (extended info not available)\nVBoxManage: error: Most likely, the VirtualBox COM server is not running or failed to start.",

This sounds like your Ubuntu host is missing libcurl.  
Try adding that (libcurl4 to be precise) to the list of packages that  
you install in the "install prerequisites" task.

---

<div class="post-metadata">

**Author:** ![Oremo\_Ojwang](https://avatars.discourse-cdn.com/v4/letter/o/c68b51/32.png) [@Oremo\_Ojwang](https://forum.ansible.com/u/Oremo_Ojwang)\
**Post date:** [October 21, 2022, 7:57am UTC](https://forum.ansible.com/t/ansible-shell-module-unable-to-vagrant-up-on-remote-host-via-playbook/37235/4 "2022-10-21T07:57:27Z")

</div>

Thanks, I was able to remove the become: yes to become\_user:devops and that sorted the issue.
