hollodotme / helpers Goto Github PK
View Code? Open in Web Editor NEWHandy helper classes, tutorials, etc. for developers
Handy helper classes, tutorials, etc. for developers
Hi, I just tried your recipe and it works if the .json
file is on the local filesystem but not if it is at a scp://
address. I paste first the working setup, then the failing one. The .json
is the same in both cases.
archlinux-x86_64.json
{
"description": "Base archlinux box",
"name": "archlinux-x86_64",
"versions": [
{
"providers": [
{
"checksum": "5493156f8a09bac901f7312abc921cdf838620ed",
"checksum_type": "sha1",
"name": "virtualbox",
"url": "scp://vagrant@myHost:/vagrant/archlinux-x86_64/boxes/archlinux-x86_64_0.1.box"
}
],
"version": "0.1"
}
]
}
Vagrantfile - working:
VAGRANT_LOG=info vagrant up
- working:
INFO interface: output: Box 'archlinux-x86_64' could not be found. Attempting to find and install...
INFO interface: output: ==> build: Box 'archlinux-x86_64' could not be found. Attempting to find and install...
==> build: Box 'archlinux-x86_64' could not be found. Attempting to find and install...
INFO interface: detail: Box Provider: virtualbox
INFO interface: detail: build: Box Provider: virtualbox
build: Box Provider: virtualbox
INFO interface: detail: Box Version: >= 0
INFO interface: detail: build: Box Version: >= 0
build: Box Version: >= 0
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 1 hooks defined.
INFO runner: Running action: #<Vagrant::Action::Builder:0x00000001c101c8>
INFO warden: Calling IN action: #<Vagrant::Action::Builtin::BoxAdd:0x000000020c5678>
INFO environment: Running hook: authenticate_box_url
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 2 hooks defined.
INFO runner: Running action: #<Vagrant::Action::Builder:0x000000021bd760>
INFO warden: Calling IN action: #<VagrantPlugins::LoginCommand::AddAuthentication:0x007fac80b71d88 >
INFO warden: Calling OUT action: #<VagrantPlugins::LoginCommand::AddAuthentication:0x007fac80b71d8 8>
INFO box_add: Downloading box: file:///home/me/projects/ttp/src/archlinux-x86_64.json => /home/me/.vagrant.d/tmp/box3ac05ced52898c2f2793fe6b3342620ec2248bd7
INFO interface: output: Loading metadata for box 'file://archlinux-x86_64.json'
INFO interface: output: ==> build: Loading metadata for box 'file://archlinux-x86_64.json'
==> build: Loading metadata for box 'file://archlinux-x86_64.json'
INFO interface: detail: URL: file:///home/me/projects/ttp/src/archlinux-x86_64.json
INFO interface: detail: build: URL: file:///home/me/projects/ttp/src/archlinux-x86_64.json
build: URL: file:///home/me/projects/ttp/src/archlinux-x86_64.json
INFO box_add: Downloading box: file:///home/me/projects/ttp/src/archlinux-x86_64.json => /home/me/.vagrant.d/tmp/box3ac05ced52898c2f2793fe6b3342620ec2248bd7
INFO downloader: Downloader starting download:
INFO downloader: -- Source: file:///home/me/projects/ttp/src/archlinux-x86_64.json
INFO downloader: -- Destination: /home/me/.vagrant.d/tmp/box3ac05ced52898c2f2793fe6b3342620ec2248bd7
INFO subprocess: Starting process: ["/opt/vagrant/bin/../embedded/bin/curl", "-q", "--fail", "--location", "--max-redirs", "10", "--user-agent", "Vagrant/1.7.2", "--continue-at", "-", "--insecure" , "-H", "Accept:application/json", "--output", "/home/me/.vagrant.d/tmp/box3ac05ced52898c2f2793fe6b3342620ec2248bd7", "file:///home/me/projects/ttp/src/archlinux-x86_64.json"]
INFO interface: output: Adding box 'archlinux-x86_64' (v0.1) for provider: virtualbox
INFO interface: output: ==> build: Adding box 'archlinux-x86_64' (v0.1) for provider: virtualbox
==> build: Adding box 'archlinux-x86_64' (v0.1) for provider: virtualbox
INFO box_add: Downloading box: scp://vagrant@myHost:/vagrant/archlinux-x86_64/boxes/archlinux-x86_64_0.1.box => /home/me/.vagrant.d/tmp/box934202f8baea7f6136fd6655da2574f61e851417
INFO interface: detail: Downloading: scp://vagrant@myHost:/vagrant/archlinux-x86_64/boxes/archlinux-x86_64_0.1.box
INFO interface: detail: build: Downloading: scp://vagrant@myHost:/vagrant/archlinux-x86_64/boxes/archlinux-x86_64_0.1.box
build: Downloading: scp://vagrant@myHost:/vagrant/archlinux-x86_64/boxes/archlinux-x86_64_0.1.box
INFO interface: info: Box download is resuming from prior download progress
INFO interface: info: ==> build: Box download is resuming from prior download progress
==> build: Box download is resuming from prior download progress
INFO downloader: Downloader starting download:
INFO downloader: -- Source: scp://vagrant@myHost:/vagrant/archlinux-x86_64/boxes/archlinux-x86_64_0.1.box
INFO downloader: -- Destination: /home/me/.vagrant.d/tmp/box934202f8baea7f6136fd6655da2574f61e 851417
INFO subprocess: Starting process: ["/opt/vagrant/bin/../embedded/bin/curl", "-q", "--fail", "--location", "--max-redirs", "10", "--user-agent", "Vagrant/1.7.2", "--continue-at", "-", "--insecure" , "--output", "/home/me/.vagrant.d/tmp/box934202f8baea7f6136fd6655da2574f61e851417", "scp://vagrant@myHost:/vagrant/archlinux-x86_64/boxes/archlinux-x86_64_0.1.box"]
INFO interface: info: ^M^[[K
^M^[[K INFO interface: detail: Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--)
INFO interface: detail: build: Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--)
build: Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--)
[...] and then the download starts...
Vagrantfile - failing:
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define "build" do |box|
box.vm.box = "archlinux-x86_64"
box.vm.box_url = "scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json"
box.vm.box_download_insecure = true
box.vm.box_check_update = true
end
end
VAGRANT_LOG=info vagrant up
- failing:
INFO interface: output: Box 'archlinux-x86_64' could not be found. Attempting to find and install...
INFO interface: output: ==> build: Box 'archlinux-x86_64' could not be found. Attempting to find and install...
==> build: Box 'archlinux-x86_64' could not be found. Attempting to find and install...
INFO interface: detail: Box Provider: virtualbox
INFO interface: detail: build: Box Provider: virtualbox
build: Box Provider: virtualbox
INFO interface: detail: Box Version: >= 0
INFO interface: detail: build: Box Version: >= 0
build: Box Version: >= 0
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 1 hooks defined.
INFO runner: Running action: #<Vagrant::Action::Builder:0x00000002943070>
INFO warden: Calling IN action: #<Vagrant::Action::Builtin::BoxAdd:0x00000002df1b30>
INFO environment: Running hook: authenticate_box_url
INFO runner: Preparing hooks for middleware sequence...
INFO runner: 2 hooks defined.
INFO runner: Running action: #<Vagrant::Action::Builder:0x00000002ee9ec0>
INFO warden: Calling IN action: #<VagrantPlugins::LoginCommand::AddAuthentication:0x007fc77cb7aac0>
INFO warden: Calling OUT action: #<VagrantPlugins::LoginCommand::AddAuthentication:0x007fc77cb7aac0>
INFO box_add: Downloading box: scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json => /home/me/.vagrant.d/tmp/boxd29c424ae74c1d2aeb13b08295ce5619dca34fd5
INFO downloader: HEAD: scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json
INFO subprocess: Starting process: ["/opt/vagrant/bin/../embedded/bin/curl", "-I", "-q", "--fail", "--location", "--max-redirs", "10", "--user-agent", "Vagrant/1.7.2", "--continue-at", "-", "--insecure", "-H", "Accept: application/json", "scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json"]
INFO interface: output: Adding box 'archlinux-x86_64' (v0) for provider: virtualbox
INFO interface: output: ==> build: Adding box 'archlinux-x86_64' (v0) for provider: virtualbox
==> build: Adding box 'archlinux-x86_64' (v0) for provider: virtualbox
INFO box_add: Downloading box: scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json => /home/me/.vagrant.d/tmp/boxd29c424ae74c1d2aeb13b08295ce5619dca34fd5
INFO interface: detail: Downloading: scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json
INFO interface: detail: build: Downloading: scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json
build: Downloading: scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json
INFO interface: info: Box download is resuming from prior download progress
INFO interface: info: ==> build: Box download is resuming from prior download progress
==> build: Box download is resuming from prior download progress
INFO downloader: Downloader starting download:
INFO downloader: -- Source: scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json
INFO downloader: -- Destination: /home/me/.vagrant.d/tmp/boxd29c424ae74c1d2aeb13b08295ce5619dca34fd5
INFO subprocess: Starting process: ["/opt/vagrant/bin/../embedded/bin/curl", "-q", "--fail", "--location", "--max-redirs", "10", "--user-agent", "Vagrant/1.7.2", "--continue-at", "-", "--insecure", "--output", "/home/me/.vagrant.d/tmp/boxd29c424ae74c1d2aeb13b08295ce5619dca34fd5", "scp://vagrant@myHost:/vagrant/archlinux-x86_64/archlinux-x86_64.json"]
INFO interface: info: ^M^[[K
^M^[[K INFO interface: detail: Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--)
INFO interface: detail: build: Progress: 0% (Rate: 0/s, Estimated time remaining: --:--:--)
[...]
^M^[[K INFO subprocess: Starting process: ["/opt/vagrant/bin/../embedded/bin/bsdtar", "-v", "-x", "-m", "-C", "/home/me/.vagrant.d/tmp/vagrant-box-add-temp-20150223-17267-95a0av", "-f", "/home/me/. vagrant.d/tmp/boxd29c424ae74c1d2aeb13b08295ce5619dca34fd5"]
ERROR warden: Error occurred: The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):
bsdtar: Error opening archive: Unrecognized archive format
Any idea of what could be happening?
Thanks for the wonderful code.
This line of code cause exception on Windows
$temp_dir = '/tmp' . DIRECTORY_SEPARATOR . 'PHPExport_' . rand( 1, 9999 );
I guess you should check the current OS and use %temp%
on windows.
There's a typo in section 2.2 that instructs to do:
$ sudo nano /etc/modt
Which will cause grief I guess when trying to see the motd file...
There's a typo in section 2.2 that instructs to do:
$ sudo nano /etc/modt
Which will cause grief I guess when trying to see the motd...
Hi,
I found your tutorial https://github.com/hollodotme/Helpers/blob/master/Tutorials/vagrant/self-hosted-vagrant-boxes-with-versioning.md very useful. I didn't find the information on vagrant docs. I am just curious where you found the instructions for how the json file is structured?
Thanks,
Hi,
trying to build self-hosted vagrant on windows but i encounter the error below
The box failed to unpackage properly. Please verify that the box
file you're trying to add is not corrupted and try again. The
output from attempting to unpackage (if any):
bsdtar.EXE: Error opening archive: Unrecognized archive format
seems that json catalog not read
I created my own VirtualBox image for a Vagrant supported environment with Building a Vagrant Box from Start to Finish. While I'm provisiong all my projects with ansible I've the attempt to install the latest Virtual Box Guest Additions corresponding to my hosts VirtualBox version with ansible as well. So after digging I stumbled upon the fine working Vagrant plugin dotless-de/vagrant-vbguest.
While the package VirtualBox is developed the Guest Additions are too. Very soon you'll get the error message that your Guest Additions on the box aren't up to date with your hosts version of Virtual Box. The mentioned plugin takes care of that problem. This is a great benefit in companywide development environments. There's no need to install a specific version of the Guest Additions in the box itself nor to provison it by any tool of your choice.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.