user2439278 user2439278 - 2 months ago 9
Bash Question

Execute shell script present in host machine path in vagrant

My Vagrantfile is

$script = <<SCRIPT
cd /opt/IBM/WebSphere/AppServer/
sudo sh server1
Vagrant.configure(2) do |config| = "bolbase" "public_network" "forwarded_port", guest: 6000, host: 6000 "forwarded_port", guest: 9060, host: 9060
config.vm.provision "shell", inline: $script
config.vm.provider "virtualbox" do |v|
v.memory = 4096
v.cpus = 2

Error Message :

==> default: sh: line 1: not found The SSH command responded with a non-zero exit status. Vagrant assumes that this means
the command failed. The output for this command should be in the log
above. Please read the output to determine what went wrong

In script tag, i mentioned the path as /opt/IBM/WebSphere/AppServer/. This path present inside my solaris box. During vagrant up i need execute the below command inside the solaris box server1

What is the best way to achieve this.


Could you change this;

cd /opt/IBM/WebSphere/AppServer/bin/


sudo sh /opt/IBM/WebSphere/AppServer/bin/ server1