I tried to run the official FreeBSD vagrant box by using:
vagrant init freebsd/FreeBSD-10.2-STABLE
And afterwards, modified my Vagrantfile accordingly based on the instructions at https://forums.freebsd.org/threads/52717/ by adding the following lines:
Vagrant.configure("2") do |config|
config.vm.guest = :freebsd
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.box = "freebsd/FreeBSD-10.2-STABLE"
config.ssh.shell = "sh"
config.vm.base_mac = "080027D14C66"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--cpus", "1"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
end
end
When I issue the vagrant up command:
vagrant up --provider virtualbox
the following error was shown:
The configured shell (config.ssh.shell) is invalid and unable to properly execute commands. The most common cause for this is using a shell that is unavailable on the system. Please verify you're using the full path to the shell and that the shell is executable by the SSH user.
Regardless of the error, I'm still able to vagrant ssh
into the box. However, I'm not able to gracefully shutdown the machine using vagrant halt
. It would show the same error as above and does not shutdown at all.
The most common cause for this is using a shell that is unavailable on the system. Please verify you're using the full path to the shell and that the shell is executable by the SSH user. Regardless of the error, I'm still able to vagrant ssh into the box.
args (string or array) - Arguments to pass to the shell script when executing it as a single string. These arguments must be written as if they were typed directly on the command line, so be sure to escape characters, quote, etc. as needed. You may also pass the arguments in using an array. In this case, Vagrant will handle quoting for you.
By default this is "/tmp/vagrant-shell". On Windows, this will default to "C: \ tmp \ vagrant-shell". Perhaps the easiest way to get started is with an inline script. An inline script is a script that is given to Vagrant directly within the Vagrantfile. An example is best:
There is no source uri being provided for the base box to download (when it doesnt exist in the local storage, it will attempt to download 'base' from the specified location). You have neither a base box in storage, nor a src uri for it in the Vagrantfile.
The fix was simple as it was a totally noob mistake on my part. In the Vagrantfile, you should remove all the parts generated when running vagrant init
command except for the two lines at the very top. Then paste the suggested ones below those two lines. The complete Vagrantfile should be like the following:
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.guest = :freebsd
config.vm.synced_folder ".", "/vagrant", id: "vagrant-root", disabled: true
config.vm.box = "freebsd/FreeBSD-10.2-STABLE"
config.ssh.shell = "sh"
config.vm.base_mac = "080027D14C66"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
vb.customize ["modifyvm", :id, "--cpus", "1"]
vb.customize ["modifyvm", :id, "--hwvirtex", "on"]
vb.customize ["modifyvm", :id, "--audio", "none"]
vb.customize ["modifyvm", :id, "--nictype1", "virtio"]
vb.customize ["modifyvm", :id, "--nictype2", "virtio"]
end
config.vm.network "private_network", ip: "192.168.33.10"
end
What I did wrong was nesting this Vagrant.configure("2") do |config|
block inside the auto-generated one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With