Re: [vagrant-up] Change working directory for the shell provisioner
Hello You can try to change the format of the script to be inside a block $script = <<-SCRIPT cd /home/vagrant/pep_code git init git config --global user.name \"Giacomo\" git config --global user.email \"[redacted]\" git add * && git commit -m \"fix\" mkdir build && cd build CC=clang CXX=clang++ cmake -DWITH_CASTOR=OFF .. ninja SCRIPT Vagrant.configure("2") do |config| config.vm.provision "shell", inline: $script end On Thu, Jun 29, 2023 at 6:46 PM Giacomo Tommaso Petrucci < giacomo.tom.petru...@gmail.com> wrote: > Thank you for your answers. Yes, this is a little inconvenient but doable. > > Regards, > > Giacomo Tommaso Petrucci > > Il giorno giovedì 29 giugno 2023 alle 17:52:28 UTC+2 dnmo...@gmail.com ha > scritto: > >> If neither one is an option you have to put multiple commands together >> like cd /home/path1/subpath && ninja >> >> On Thursday, June 29, 2023 at 11:50:05 AM UTC-4 dnmo...@gmail.com wrote: >> >>> Jim is correct. >>> >>> You typically would want to run the command from the root with the full >>> path e.g. ./home/vagrant/pep_code/build/ninja (if ninja is a script). >>> >>> If ninja is an app, you would do something like ninja >> file> e.g. ninja /home/vagrant/pep_code/build/ >>> >>> On Thursday, June 29, 2023 at 11:06:20 AM UTC-4 Jim McGinness wrote: >>> Each shell provisioning line runs as its own process. Directory changes do not persist from one line to the next. You will need to gather your individual lines into an actual script to get the result you want. For more info, see https://developer.hashicorp.com/vagrant/docs/provisioning/shell -- jmcg On Thu, Jun 29, 2023 at 9:51 AM Giacomo Tommaso Petrucci < giacomo.to...@gmail.com> wrote: > Greetings, > > I wrote the following Vagrantfile: > > Vagrant.configure("2") do |config| > config.vm.box = "ubuntu/jammy64" > config.vm.synced_folder "pep_code", "/home/vagrant/pep_code" > > # Update and install dependencies > config.vm.provision "shell", inline: "echo Updating..." > config.vm.provision "shell", inline: "sudo apt-get update && sudo > apt-get -y upgrade" > config.vm.provision "shell", inline: "sudo apt-get -y install clang > ninja-build golang golang-goprotobuf-dev ccache distcc git cmake valgrind > libboost-all-dev zlib1g-dev libbz2-dev libsqlite3-dev libcurl4-openssl-dev > curl libpam0g-dev libssl-dev libreadline-dev patch vim flex qtbase5-dev > qtdeclarative5-dev qttools5-dev qttools5-dev-tools libunwind-dev libc6-dev > libc6-dev-i386 software-properties-common gcc-multilib" > config.vm.provision "file", source: "pep_code", destination: > "/home/vagrant/pep_code" > config.vm.provision "shell", inline: "cd /home/vagrant/pep_code" > config.vm.provision "shell", inline: "git init" > config.vm.provision "shell", inline: "git config --global user.name > \"Giacomo\"" > config.vm.provision "shell", inline: "git config --global user.email > \"[redacted]\"" > config.vm.provision "shell", inline: "git add * && git commit -m > \"fix\"" > config.vm.provision "shell", inline: "mkdir build && cd build" > config.vm.provision "shell", inline: "CC=clang CXX=clang++ cmake > -DWITH_CASTOR=OFF .." > config.vm.provision "shell", inline: "ninja" > end > > It fails while provisioning with the following message: > > default: CMake Error: The source directory "/home" does not appear to > contain CMakeLists.txt. >default: Specify --help for usage, or press the help button on the > CMake GUI. > 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. > > > I was expecting the lines > > config.vm.provision "shell", inline: "cd /home/vagrant/pep_code" > > and > > config.vm.provision "shell", inline: "mkdir build && cd build" > > to change the working directory of the provisioning process, but this > doesn't seem the case. Docker has an instruction for this, WORKDIR. Does > Vagrant have something similar? A quick Google search didn't turn up > anything. > Thank you for your help, > > Giacomo Tommaso Petrucci > > -- > This mailing list is governed under the HashiCorp Community Guidelines > - https://www.hashicorp.com/community-guidelines.html. Behavior in > violation of those guidelines may result in your removal from this mailing > list. > > GitHub Issues: https://github.com/hashicorp/vagrant/issues > Discuss: https://discuss.hashicorp.com/c/vagrant/24 > --- > You received this message because you are subscribed to the Google > Groups "Vagrant" group. > To unsubscribe from this group and stop
Re: [vagrant-up] Re: Vagrant plugin issues
Hello The error message is complaining about plugin so you need to make sure the shell part is a valid script it seem the formatting is wrong around this line sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose- plugin -y i think should be sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y Better will be make sure you are using a good / valid Vagrantfile, go and check as possible a copy of the file from where you got this if this is from a book, try to get the commands they want you to run -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/hashicorp/vagrant/issues Discuss: https://discuss.hashicorp.com/c/vagrant/24 --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0exKJrinDjKXm4dVZ%3DddVtbQuGwii-a_vh6fBKyN3tVabg%40mail.gmail.com.
Re: [vagrant-up] Re: Vagrant plugin issues
Without knowing where you copied this vagrantfile from, I'd guess there should be no space between "docker-compose-" and "plugin -y" On July 3, 2023, at 4:31 AM, SAKSHAM CHITRANSH wrote: # -- mode: ruby -- # vi: set ft=ruby : # All Vagrant configuration is done below. The "2" in Vagrant.configure # configures the configuration version (we support older styles for # backwards compatibility). Please don't change it unless you know what # you're doing. Vagrant.configure("2") do |config| # The most common configuration options are documented and commented below. # For a complete reference, please see the online documentation at # https://docs.vagrantup.com. # Every Vagrant development environment requires a box. You can search for # boxes at https://vagrantcloud.com/search. config.vm.box = "ubuntu/focal64" # Disable automatic box update checking. If you disable this, then # boxes will only be checked for updates when the user runs # `vagrant box outdated`. This is not recommended. # config.vm.box_check_update = false # 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. # NOTE: This will enable public access to the opened port # config.vm.network "forwarded_port", guest: 80, host: 8080 # Create a forwarded port mapping which allows access to a specific port # within the machine from a port on the host machine and only allow access # via 127.0.0.1 to disable public access # config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1" # Create a private network, which allows host-only access to the machine # using a specific IP. config.vm.network "private_network", ip: "192.168.56.82" # Create a public network, which generally matched to bridged network. # Bridged networks make the machine appear as another physical device on # your network. config.vm.network "public_network" # Share an additional folder to the guest VM. The first argument is # the path on the host to the actual folder. The second argument is # the path on the guest to mount the folder. And the optional third # argument is a set of non-required options. # config.vm.synced_folder "../data", "/vagrant_data" # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. # Example for VirtualBox: # config.vm.provider "virtualbox" do |vb| # # Display the VirtualBox GUI when booting the machine # vb.gui = true # # # Customize the amount of memory on the VM: vb.memory = "2048" end # # View the documentation for the provider you are using for more # information on available options. # Enable provisioning with a shell script. Additional provisioners such as # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the # documentation for more information about their specific syntax and use. config.vm.provision "shell", inline: <<-SHELL sudo apt-get update sudo apt-get install \ ca-certificates \ curl \ gnupg -y sudo install -m 0755 -d /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg sudo chmod a+r /etc/apt/keyrings/docker.gpg echo \ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose- plugin -y SHELL end this is the vagrant file and it is showing package plugin error what should i do? On Mon, Jul 3, 2023 at 1:50 AM dnmo...@gmail.com wrote: You're going to need to post your Vagrant file. On Sunday, July 2, 2023 at 12:54:06 PM UTC-4 SAKSHAM CHITRANSH wrote:  This error is showing while installing a machine what should i do? -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/hashicorp/vagrant/issues Discuss: https://discuss.hashicorp.com/c/vagrant/24 --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/22a16ce0-8b7d-4099-b0e1-885e36d406b7n%40googlegroups.com. -- This mailing list is governed under the HashiCorp Community Guidelines -
[vagrant-up] Re: error running Vagrant up
This isn't a Vagrant issue. VT-x is.a BIOS setting (on your computers Motherboard) that allows for virtualization. You will need to restart your machine, get into the BIOS settings and then look for the VT-x settings that will allow you to move forward (usually a checkbox). The location for the settings are different for every motherboard On Tuesday, July 4, 2023 at 8:36:32 AM UTC-4 Akinola Akinbusola wrote: > i am having the error running Vagrant up, it is showing > > There was an error while executing `VBoxManage`, a CLI used by Vagrant > for controlling VirtualBox. The command and stderr is shown below. > > Command: ["startvm", "9ce2d19c-eb2a-4fe1-9a1f-69c30f9c81db", "--type", > "headless"] > > Stderr: VBoxManage.exe: error: Not in a hypervisor partition (HVP=0) > (VERR_NEM_NOT_AVAILABLE). > VBoxManage.exe: error: VT-x is disabled in the BIOS for all CPU modes > (VERR_VMX_MSR_ALL_VMX_DISABLED) > VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component > ConsoleWrap, interface IConsole > -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/hashicorp/vagrant/issues Discuss: https://discuss.hashicorp.com/c/vagrant/24 --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/3ed0099c-9b10-442f-9e0d-94e3f0fa65e4n%40googlegroups.com.
[vagrant-up] error running Vagrant up
i am having the error running Vagrant up, it is showing There was an error while executing `VBoxManage`, a CLI used by Vagrant for controlling VirtualBox. The command and stderr is shown below. Command: ["startvm", "9ce2d19c-eb2a-4fe1-9a1f-69c30f9c81db", "--type", "headless"] Stderr: VBoxManage.exe: error: Not in a hypervisor partition (HVP=0) (VERR_NEM_NOT_AVAILABLE). VBoxManage.exe: error: VT-x is disabled in the BIOS for all CPU modes (VERR_VMX_MSR_ALL_VMX_DISABLED) VBoxManage.exe: error: Details: code E_FAIL (0x80004005), component ConsoleWrap, interface IConsole -- This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list. GitHub Issues: https://github.com/hashicorp/vagrant/issues Discuss: https://discuss.hashicorp.com/c/vagrant/24 --- You received this message because you are subscribed to the Google Groups "Vagrant" group. To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/60a5483f-995b-4e35-a799-115fefcd18cbn%40googlegroups.com.