Ubuntu 16.04 Vbox - Trellis installation - Vagrant issues

I installed trellis and trying to setup a local development setup.

Am using a virtual box from my windows machine and inside the Virtual box am using an Ubuntu -16.04 LTS.

On this Ubuntu am trying to setup my WordPress websites. There are issues with Vagrant up command and it doesn’t do an ssh. May be the issue with using virtual machine within a virtual box. Here are the series of errors -

vagrant up

ringing machine ‘default’ up with ‘virtualbox’ provider…
==> default: Checking if box ‘bento/ubuntu-16.04’ is up to date…
==> default: [vagrant-hostmanager:guests] Updating hosts file on active guest virtual machines…
==> default: [vagrant-hostmanager:host] Updating hosts file on your workstation (password may be required)…
==> default: Machine already provisioned. Run vagrant provision or use the --provision
==> default: flag to force provisioning. Provisioners marked to run always will still run.

==> default: Machine ‘default’ has a post vagrant up message. This is a message
==> default: from the creator of the Vagrantfile, and not from Vagrant itself:
==> default:
==> default: Your Trellis Vagrant box is ready to use!
==> default: * Composer and WP-CLI commands need to be run on the virtual machine
==> default: for any post-provision modifications.
==> default: * You can SSH into the machine with vagrant ssh.
==> default: * Then navigate to your WordPress sites at /srv/www
==> default: or to your Trellis files at /home/vagrant/trellis.

========================================
vagrant ssh

ssh_exchange_identification: read: Connection reset by peer

vagrant provision

==> default: Running provisioner: ansible…
default: Running ansible-galaxy…

  • composer (1.5.0) is already installed, skipping.
  • ntp (1.3.0) is already installed, skipping.
  • logrotate (e7a498d) is already installed, skipping.
  • swapfile (0.4) is already installed, skipping.
  • geerlingguy.daemonize (1.1.1) is already installed, skipping.
  • mailhog (2.1.0) is already installed, skipping.
    default: Running ansible-playbook…

PLAY [WordPress Server: Install LEMP Stack with PHP 7.1 and MariaDB MySQL] *****

TASK [Gathering Facts] *********************************************************
System info:
Ansible 2.3.1.0; Vagrant 1.9.5; Linux
Trellis at “Option to install WP-CLI packages”

SSH Error: data could not be sent to remote host “127.0.0.1”. Make sure this
host can be reached over ssh
fatal: [default]: UNREACHABLE! => {“changed”: false, “unreachable”: true}
to retry, use: --limit @/sites/kollabio.com/trellis/dev.retry

PLAY RECAP *********************************************************************
default : ok=0 changed=0 unreachable=1 failed=0

Ansible failed to complete successfully. Any error output should be
visible above. Please fix these errors and try again.

==================================================

ansible-playbook dev.yml -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory

PLAY [WordPress Server: Install LEMP Stack with PHP 7.1 and MariaDB MySQL] ***********************************************************

TASK [Gathering Facts] ***************************************************************************************************************
System info:
Ansible 2.3.1.0; Linux
Trellis at “Option to install WP-CLI packages”

SSH Error: data could not be sent to remote host “127.0.0.1”. Make sure this
host can be reached over ssh
fatal: [default]: UNREACHABLE! => {“changed”: false, “unreachable”: true}
to retry, use: --limit @/sites/kollabio.com/trellis/dev.retry

PLAY RECAP ***************************************************************************************************************************
default : ok=0 changed=0 unreachable=1 failed=0 Preformatted text

My hosts file looks like this :

127.0.0.1 localhost

127.0.1.1 rushmith-VirtualBox

The following lines are desirable for IPv6 capable hosts

::1 ip6-localhost ip6-loopback

fe00::0 ip6-localnet

ff00::0 ip6-mcastprefix

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

vagrant-hostmanager-end

vagrant-hostmanager-start id: f84bb24c-1353-4f57-ac87-40ba356cacfd

192.168.50.5 hostname.dev

192.168.50.5 www.hostname.dev

vagrant-hostmanager-end

Why am I not able to contact my localhost, can anyone help me here ?

I highly suggest not doing this :frowning: I don’t really know what the actual issue is, but this will only lead to problems.

2 Likes

I only have windows 10 currently, am trying to do same stuff from here. Don’t know if this works or not. I think the actual problem is with vagrant offering only 32bit of virtual drive, which doesn’t support the requirements.

Anyways thank you for the suggestion.

Are you nesting hypervisors (VM in VirtualBox) because you want to use Vagrant in Linux environment despite having a Windows system?

@strarsis

No, That’s WSL, a different concept from windows.

To be more clear on My question (Am not being rude, I need help) :

  1. I have windows 10 Machine with Virtualbox installed in it.
  2. Created an Ubuntu 16.04 LTS Virtual Machine in my virtual box.
  3. Started the roots project on this Ubuntu virtual machine.
  4. Vagrant up unable to create a virtual disk of Ubuntu and gives an error.
  5. This error is because my Ubuntu Virtual Machine doesn’t allow Vagrant to mount a 64-bit virtual machine.
  6. There’s no boot options on the Ubuntu virtual machine to change it from 32-bit to 64-bit.
  7. As @swalkinshaw suggested, I came back to my windows 10.

Again the problem is same but a little bit better.

This time on windows, I can see vagrant creating a Virtual-box with desired host-name.

I can login to the virtual box machine with vagrant/vagrant. But, Am unable to ssh from my machine to that vagrant.

I tried loading a puttyGen private-key by adding ppk extension to insecured_private_key and configured it on the Putty.

ssh-config output on my Windows is as below :

> Host default
>   HostName 127.0.0.1
>   User vagrant
>   Port 2222
>   UserKnownHostsFile /dev/null
>   StrictHostKeyChecking no
>   PasswordAuthentication no
>   IdentityFile C:/Users/rushm/.vagrant.d/insecure_private_key
>   IdentitiesOnly yes
>   LogLevel FATAL
>   ForwardAgent yes

I have git for windows, WinScp, putty, puttyGen, on my machine.

I also set up the Path for ssh.exe which is :

%PATH%;C:\Program Files\Git\usr\bin

The error now says :

==> default: Running provisioner: ansible_local…
An error occurred in the underlying SSH library that Vagrant uses.
The error message is shown below. In many cases, errors from this
library are caused by ssh-agent issues. Try disabling your SSH
agent or removing some keys and try again.

If the problem persists, please report a bug to the net-ssh project.

Net::SSH::ConnectionTimeout

Already am stuck here since ages. Seeing same errors daily is frustrating. Sometimes I feel like why is it made so complicated with Vagrant involvement ?

I lost all my hopes on Roots now.