So - i googled this and found about 1 Million Issues regarding vagrant provisioning and ssh agents. I tried lots of solutions and nothing works. I tried adding options for the network adaptor (VirtualBox), destroying the machine, reinstalling vagrant and so on, everytime i need to run vagrant this thing blocks me from working.
Now i work on a completely fresh OS Installation (Ubuntu 20.04)! I install VirtualBox 6.1 like instructed on the oracle website and downloaded the right vagrant binary from vagrantup.com/downloads.
And again - vagrant manages it to fail right-away! So okay - lets face it - vagrant is buggy and should be replaced but there are projects where i wont get any budget to migrate to containers, so i need to make that setup work again - and hopefuly someone has a solution for me, that actually works.
Okay - here the final vagrant up
output:
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.
So the machine runs but vagrant was not able to connect and run the provisioning. It basically downloaded the image and started it.
So i try vagrant ssh --debug
The last lines i see:
Checking key permissions: ~/.vagrant.d/insecure_private_key
INFO ssh: Invoking SSH: /tmp/.mount_vagran2MLjJR/usr/bin/ssh ["vagrant@127.0.0.1", "-p", "2222", "-o", "LogLevel=FATAL", "-o", "Compression=yes", "-o", "DSAAuthentication=yes", "-o", "IdentitiesOnly=yes", "-o", "StrictHostKeyChecking=no", "-o", "UserKnownHostsFile=/dev/null", "-i", "~/.vagrant.d/insecure_private_key"]
And thats it - the command will fail without further notice.
So i can only kill the vm (shutdown using vagrant halt wont work either!) and try to get more logs:
(just to make sure i re-installed the vbguest plugin)
vagrant up --debug
Okay - the screen-output looks like a loop. And i can only find "Attemping SSH connection..." with the given options (path to key, etc)
After a few minutes (i gues the configured timeout) i can see:
INFO interface: Machine: error-exit ["Vagrant::Errors::VMBootTimeout", "Timed out while waiting for the machine to boot. This means that\nVagrant was unable to communicate with the guest machine within\nthe configured (\"config.vm.boot_timeout\" value) time period.\n\nIf you look above, you should be able to see the error(s) that\nVagrant had when attempting to connect to the machine. These errors\nare usually good hints as to what may be wrong.\n\nIf you're using a custom box, make sure that networking is properly\nworking and you're able to connect to the machine. It is a common\nproblem that networking isn't setup properly in these boxes.\nVerify that authentication configurations are also setup properly,\nas well.\n\nIf the box appears to be booting properly, you may want to increase\nthe timeout (\"config.vm.boot_timeout\") value."]
Here is some config:
unless Vagrant.has_plugin?("vagrant-vbguest")
raise 'vagrant-vbguest is not installed, see README.md!'
end
unless Vagrant.has_plugin?("vagrant-disksize")
raise 'vagrant-disksize is not installed, see README.md!'
end
Vagrant.configure("2") do |config|
# https://docs.vagrantup.com
config.vm.box = "ubuntu/bionic64"
config.disksize.size = "25GB"
# forward http traffic
config.vm.network "forwarded_port", guest: 80, host: 8083
# forward mysql
config.vm.network "forwarded_port", guest: 3306, host: 3308
# forward xdebug
config.vm.network "forwarded_port", guest: 9000, host: 9000
# forward elastic
config.vm.network "forwarded_port", guest: 9200, host: 9200
# forward solr
config.vm.network "forwarded_port", guest: 8983, host: 8983
config.vm.synced_folder ".", "/vagrant",
type: "virtualbox",
id: "vagrant-root",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]
config.vm.provider "virtualbox" do |vb|
vb.memory = "8192"
vb.cpus = 4
vb.customize [ "modifyvm", :id, "--uartmode1", "disconnected" ]
vb.customize [ "modifyvm", :id, "--cableconnected1", "on" ]
end
config.vm.provision "shell", path: "config/bootstrap.sh"
config.vm.provision "shell", path: "config/solr.sh"
config.vm.provision "shell", path: "config/startup.sh", run: "always"
end
My problem is - i have no idea how to solve this. I would be happy if i could disable the ssh authentication or use a password but i would need to connect to the vm to change it... Even if i could login using virtualbox i would only be able to fix my local installation. But there are other people as well working on that code and a solution should fix this.
Just to sum this up once more:
We deal with:
- A standard Ubuntu 20.04
- A standard VirtualBox Installation
- A original vagrant binary
Fresh installation
wont work
Kind regards, Philipp