I'm trying to set up Laravel Homestead on Windows 8.1 x64 and I can't seem to get passed the error below.
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'laravel/homestead'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'laravel/homestead' is up to date...
==> default: Setting the name of the VM: casensitive_default_1420409560257_10693
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
This is a very popular error with Homestead, and I've found a couple similar posts on stackoverflow such as: one, and two. But setting the boot_mode in my Vagrantfile didn't fix the issue.
Vagrant.configure("1") do |config|
config.vm.boot_mode = :gui
end
To make sure I had VT-x I downloaded intels tool, which I do: i7 core; and I checked that Virtualization is enabled in BIOS.
In the Vagrantfile I'm using defaults (most of it appears to be commented out) and I've set config.vm.box to:
"laravel/homestead"
and my Homestead.yaml is set to (and already had id_ras.pub and id_rsa):
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
authorize: ~/.ssh/id_rsa.pub
keys:
- ~/.ssh/id_rsa
folders:
- map: ~/d/projects
to: /home/vagrant/projects
sites:
- map: roopla.app
to: /home/vagrant/projects/test_app/public
databases:
- homestead
variables:
- key: APP_ENV
value: local
This is pretty far out of my normal Composer, PHP, GruntJS, BowerJS, AngularJS day, and I'm not sure what I'm really doing, initially I was just learning Laravel 4/5 and then I jumped sideways because Homestead looked useful and kewl, so I'm just blindly following instructions so any snippets of knowledge that can be imparted would be much appreciated.
First, make sure you haven't turned on Hyper-V.
Second, probably you have problem with ssh keys. The simplest solution is to alter your vagrant file not to use SSH keys but login and password.
Look at my vagrantfile:
require 'json'
require 'yaml'
VAGRANTFILE_API_VERSION = "2"
homesteadYamlPath = File.expand_path("Homestead.yaml")
afterScriptPath = File.expand_path("after.sh")
aliasesPath = File.expand_path("aliases")
require_relative 'scripts/homestead.rb'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
if File.exists? aliasesPath then
config.vm.provision "file", source: aliasesPath, destination: "~/.bash_aliases"
end
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
Homestead.configure(config, YAML::load(File.read(homesteadYamlPath)))
if File.exists? afterScriptPath then
config.vm.provision "shell", path: afterScriptPath
end
config.vm.network "forwarded_port", guest: 11300, host: 11301
end
I've added here 2 lines:
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
because I had the same problem as you and now Homestead works for me without any problems.
Related
UPDATE: After host PC reboot vagrant up shows port collision on any port
My vagrant machine fails to start.
Usually it was working normally, but today after I restarted my PC the vagrant machine no more starts.
I did not change the Vagrantfile.
It says about ports collision.
If I remove the 6379 setting for redis, then it says for port 1080 and so on.
Like all ports have the collision.
If I try to run the macine via VMware - then it starts OK, but I cannont connect to it via ssh, because it doesn't have the settings that are defined in Vagrantfile...
Here is the log:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: There was a problem while downloading the metadata for your box
==> default: to check for updates. This is not an error, since it is usually due
==> default: to temporary network problems. This is just a warning. The problem
==> default: encountered was:
==> default:
==> default: The requested URL returned error: 404
==> default:
==> default: If you want to check for box updates, verify your network connectio n
==> default: is valid and try again.
==> default: Fixed port collision for 6379 => 6379. Now on port 2250.
Vagrant found a port collision for the specified port and virtual machine.
While this port was marked to be auto-corrected, the ports in the
auto-correction range are all also used.
VM: default
Forwarded port: 1080 => 1080
Here is my Vagrantfile:
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/trusty64"
forward_port = ->(guest, host = guest) do
config.vm.network :forwarded_port,
guest: guest,
host: host,
auto_correct: true
end
config.vm.synced_folder "sites/", "/var/www"
config.vm.synced_folder ".", "/vagrant", disabled: true
forward_port[6379] # redis
forward_port[1080] # mailcatcher
forward_port[3306] # mysql
forward_port[80, 8080] # nginx/apache
config.vm.provision :puppet do |puppet|
puppet.manifests_path = "manifests"
puppet.manifest_file = "default.pp"
end
config.vm.network :private_network, ip: "33.33.33.10"
config.ssh.username = "vagrant"
config.ssh.password = "vagrant"
end
I am facing issue to see login page at
https://10.2.2.2:8443/console
,
even when I trying to do
"oc login https://10.2.2.2"
It worked for the first installation and I was able to login, but I had no luck when I did few re-installations to customize.
I have already gone throgh existing github vagrant issues, and stackoverflow as well but no clues for this issue.
I appreciate if someone can help me with this issue.
Installations Detals:
I've followed this blog for cluster setup in my mac ,
1) Installed VirtualBox Version 5.1.14 r112924 (Qt5.6.2)
2) Installed Vagrant 1.9.1
Here is my Vagrantfile config,
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 1.7.2"
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version. Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
config.vm.box = "openshift/origin-all-in-one"
# uncomment this line if you downloaded the box and want to use it instead
# config.vm.box = "openshift3"
config.vm.box_check_update = false
config.vm.network "private_network", ip: "10.2.2.2"
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.hostname = "origin"
# Create a forwarded port mapping which allows access to a specific port
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# config.vm.network "forwarded_port", guest: 80, host: 8080
# config.vm.network "forwarded_port", guest: 80, host: 1080
# config.vm.network "forwarded_port", guest: 443, host: 1443
# config.vm.network "forwarded_port", guest: 5000, host: 5000
# config.vm.network "forwarded_port", guest: 8080, host: 8080
# config.vm.network "forwarded_port", guest: 8443, host: 8443
config.vm.provider "virtualbox" do |vb|
# vb.gui = true
vb.memory = "4096"
vb.cpus = 2
vb.name = "origin-1.3.0"
end
end
This is my debug logs for Vagrant up --debug
Last login: Wed Feb 1 13:59:59 on ttys000
xxxxxs-MBP:origin xxxxx$ vagrant init openshift/origin-all-in-one
A `Vagrantfile` has been placed in this directory. You are now
ready to `vagrant up` your first virtual environment! Please read
the comments in the Vagrantfile as well as documentation on
`vagrantup.com` for more information on using Vagrant.
xxxxxs-MBP:origin xxxxx$ vagrant up --provider=virtualbox
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'openshift/origin-all-in-one' could not be found. Attempting to find and install...
default: Box Provider: virtualbox
default: Box Version: >= 0
==> default: Loading metadata for box 'openshift/origin-all-in-one'
default: URL: https://atlas.hashicorp.com/openshift/origin-all-in-one
==> default: Adding box 'openshift/origin-all-in-one' (v1.3.0) for provider: virtualbox
default: Downloading: https://atlas.hashicorp.com/openshift/boxes/origin-all-in-one/versions/1.3.0/providers/virtualbox.box
==> default: Successfully added box 'openshift/origin-all-in-one' (v1.3.0) for 'virtualbox'!
/Users/xxxxx/.vagrant.d/boxes/openshift-VAGRANTSLASH-origin-all-in-one/1.3.0/virtualbox/include/_Vagrantfile:5: warning: already initialized constant VAGRANTFILE_API_VERSION
/Users/xxxxx/origin/Vagrantfile:5: warning: previous definition of VAGRANTFILE_API_VERSION was here
==> default: Importing base box 'openshift/origin-all-in-one'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: origin-1.3.0
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
default: Adapter 3: hostonly
==> default: Forwarding ports...
default: 8443 (guest) => 8443 (host) (adapter 1)
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Remote connection disconnect. Retrying...
default:
default: Vagrant insecure key detected. Vagrant will automatically replace
default: this with a newly generated keypair for better security.
default:
default: Inserting generated public key within guest...
default: Removing insecure key from the guest if it's present...
default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
default: No guest additions were detected on the base box for this VM! Guest
default: additions are required for forwarded ports, shared folders, host only
default: networking, and more. If SSH fails on this machine, please install
default: the guest additions and repackage the box to continue.
default:
default: This is not an error message; everything may continue to work properly,
default: in which case you may ignore this message.
==> default: Setting hostname...
==> default: Configuring and enabling network interfaces...
==> default: Running provisioner: shell...
default: Running: inline script
==> default:
==> default: Successfully started and provisioned VM with 2 cores and 5 G of memory.
openshift.service in vm is failing to start automatically,
I did ssh to machine and started manually with command sudo systemctl start origin and everything working perfect.
I had a bit of issue with Origin myself. I ended up using Docker and OpenShift Client. I have written down step by step on how to get started with OpenShift Origin on Windows. I am not trying to promote anything here. The entry is too long for me to cut and paste it. Please visit the link below:
http://blog.muralibala.com/2017/01/getting-started-with-openshift-origin-on-windows/
Hope this is helpful.
I am trying to get Linux Ubuntu 32 bit box running on Windows VM Ware. I was following a course on UDACITY and they told me to install these software. I don't know much about how to run these software. I tried to find answers on Stack but it was all on different OS not Windows. I tried some edit also by enabling GUI and i also added Vagrant configure in Vagrantfile.
Having a problem with ssh authentication:
Error:
e2sn7cy#EMR-HZDEV08-003 /C/Users/e2sn7cy/fullstack/vagrant (master)
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty32' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 8000 => 1234 (adapter 1)
default: 8080 => 8080 (adapter 1)
default: 5000 => 4321 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
default: Warning: Connection timeout. Retrying...
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.
If you look above, you should be able to see the error(s) that
Vagrant had when attempting to connect to the machine. These errors
are usually good hints as to what may be wrong.
If you're using a custom box, make sure that networking is properly
working and you're able to connect to the machine. It is a common
problem that networking isn't setup properly in these boxes.
Verify that authentication configurations are also setup properly,
as well.
If the box appears to be booting properly, you may want to increase
the timeout ("config.vm.boot_timeout") value.
My Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
Vagrant.configure("2") do |config|
config.ssh.private_key_path = "~/.ssh/id_rsa"
config.ssh.forward_agent = true
end
config.vm.provision "shell", path: "pg_config.sh"
# config.vm.box = "hashicorp/precise32"
config.vm.box = "ubuntu/trusty32"
config.vm.network "forwarded_port", guest: 8000, host: 1234
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 5000, host: 4321
end
My pg_config.sh
apt-get -qqy update
apt-get -qqy install postgresql python-psycopg2
apt-get -qqy install python-flask python-sqlalchemy
apt-get -qqy install python-pip
pip install bleach
pip install oauth2client
pip install requests
pip install httplib2
su postgres -c 'createuser -dRS vagrant'
su vagrant -c 'createdb'
su vagrant -c 'createdb forum'
su vagrant -c 'psql forum -f /vagrant/forum/forum.sql'
vagrantTip="[35m[1mThe shared directory is located at /vagrant\nTo access your shared files: cd /vagrant(B[m"
echo -e $vagrantTip > /etc/motd
you can open the gui mode to see what happened in your virtual machine.
do not change the default configuration, download a new box and use the default config
if you want to use the python development environment, you can download a box including all python environment
Try setting config.vm.boot_timeout to a higher value, default is 300. Like this:
config.vm.box = "ubuntu/trusty32"
config.vm.boot_timeout = 600
I have been trying to replace manual vitualbox setup with vagrant. I usually create a guest node with 2 network adapters a NAT for the guest(ubuntu) to use the host internet for all apt-get operations, and a hostonly for my host to connect to the guest. I has been working pretty well.
Below is my vagrant file
Vagrant.configure("1") do |config|
config.vm.boot_mode = :gui
end
Vagrant.configure("2") do |config|
config.vm.define "web" do |web|
web.vm.box = "ubuntu/trusty64"
web.vm.network "forwarded_port", guest:22, host:2222, id:"ssh", disabled:true
web.vm.network "private_network", ip:"192.168.56.103", :adapter =>2
end
end
Below is the output:
Bringing machine 'web' up with 'virtualbox' provider...
==> web: Importing base box 'ubuntu/trusty64'...
==> web: Matching MAC address for NAT networking...
==> web: Checking if box 'ubuntu/trusty64' is up to date...
==> web: A newer version of the box 'ubuntu/trusty64' is available! You currently
==> web: have version '14.04'. The latest is version '20150430.0.0'. Run
==> web: `vagrant box update` to update.
==> web: Setting the name of the VM: ansible_web_1431424632866_64634
==> web: Clearing any previously set forwarded ports...
==> web: Clearing any previously set network interfaces...
==> web: Preparing network interfaces based on configuration...
web: Adapter 1: nat
web: Adapter 2: hostonly
==> web: Forwarding ports...
==> web: Booting VM...
==> web: Waiting for machine to boot. This may take a few minutes...
web: SSH address: 127.0.0.1:22
web: SSH username: vagrant
web: SSH auth method: private key
web: Warning: Authentication failure. Retrying...
web: Warning: Authentication failure. Retrying...
web: Warning: Authentication failure. Retrying...
Now on vagrant it almost works and I can't figure out few things:
Question 1 Does vagrant need port forwarding to connect to the guest?
Question 2 When vagrant says : ==> web: Preparing network interfaces based on configuration...
web: Adapter 1: nat
web: Adapter 2: hostonly I figured the eth1 should be up but that's not the case. ifconfig -a shows the interface eth1 without any IP any sudo ifup eth1 shows Ignoring unknown interface eth1=eth1. What happened here and how can I solve this?
Thanks for helping
Never mind, I fixed it. This relies heavily on the version of vagrant used. This works with any of the version which support auto correct feature of the forwarding port.
After removing the line:
web.vm.network "forwarded_port", guest:22, host:2222, id:"ssh", disabled:true
It started working like a charm and I could add other nodes .Kindly see below the config that worked for sake of sharing
Vagrant.configure("1") do |config|
config.vm.boot_mode = :gui
end
Vagrant.configure("2") do |config|
auto_config= false
config.vm.define "web" do |web|
web.vm.box = "ubuntu/trusty64"
web.vm.network "private_network", ip:"192.168.56.103", :adapter =>2
end
(1..3).each do |i|
config.vm.define "mongo-#{i}" do |mongo|
mongo.vm.box = "ubuntu/trusty64"
mongo.vm.network "private_network" , ip:"192.168.56.11#{i}", :adapter =>2
end
end
(1..2).each do |i|
config.vm.define "tomcat-#{i}" do |tomcat|
tomcat.vm.box = "ubuntu/trusty64"
tomcat.vm.network "private_network" , ip:"192.168.56.12#{i}", :adapter =>2
end
end
(1..2).each do |i|
config.vm.define "mysql-#{i}" do |mysql|
mysql.vm.box = "ubuntu/trusty64"
mysql.vm.network "private_network" , ip:"192.168.56.13#{i}", :adapter =>2
end
end
end
Whenever I try to boot a Vagrant box on my Windows 7 x64 laptop in git bash using vagrant up, I get a long series of Warning: Remote connection disconnect. Retrying... messages. Occasionally this results in failure with a couple of different messages (either guest VM tools not being installed, or a timeout), but sometimes, after 10 or 15 messages, it will boot successfully and I can SSH into it.
A picture, to illustrate:
And the full output of the vagrant up command:
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ianwalter/ubuntu-node-nginx' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
==> default: Forwarding ports...
default: 9966 => 9966 (adapter 1)
default: 22 => 2222 (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: private key
default: Warning: Connection timeout. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
default: Warning: Remote connection disconnect. Retrying...
And so on. Is this usual behavior? Is there some way I can fix it? I'm running Vagrant 1.6.2 with VirtualBox 4.3.12.
EDIT: After BrianC's advice, I booted a GUI session to see what the VM was doing while the connection was refused. This is what it looks like:
I have solved this for now by changing base box from ianwalter/ubuntu-node-nginx to ubuntu/trusty64 and installing node/NPM manually from the package manager. It doesn't seem to give me the same trouble, so I surmise there is something in the other image that is causing the stall.
I also faced similar issue with vagrant but in my case I was not able to SSH even the vagrant was up.
I was using following configurations.
windows 10 64 bit
virtual box 5.0.20
HP ab032tx laptop
enabled virtualization in BIOS settings
Following were the vagrant file setting in my project folder.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "scotch/box"
config.vm.network "private_network", ip: "192.168.33.10"
config.vm.hostname = "scotchbox"
config.vm.synced_folder ".", "/var/www", :mount_options => ["dmode=777", "fmode=666"]
config.vm.boot_timeout = 1000
# Optional NFS. Make sure to remove other synced_folder line too
#config.vm.synced_folder ".", "/var/www", :nfs => { :mount_options => ["dmode=777","fmode=666"] }
end
Every time I run vagrant up command following error occurred.
default: Warning: Remote connection disconnect. Retrying..
Solution To fix this I run the following command (vagrant destroy)
vagrant destroy
default: Are you sure you want to destroy the 'default' VM? [y/N] y
==> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
Once this command was run I again run vagrant up and everything started working.
Before this when ever I was running vagrang ssh I got following output.
vagrant ssh-config
Host default
HostName 127.0.0.1
User vagrant
Port 2222
UserKnownHostsFile /dev/null
StrictHostKeyChecking no
PasswordAuthentication no
IdentityFile "C:/Users/muk_t/.vagrant.d/insecure_private_key"
IdentitiesOnly yes
LogLevel FATAL
Note : linux version used was 64 bit.