Skip to content

Instantly share code, notes, and snippets.

@tknerr
tknerr / virtualbox-vs-vmware-benchmark.md
Last active January 18, 2016 21:55
Benchmark: comparing Vagrant VirtualBox vs VMWare Provider

Environment

  • vagrant 1.7.4
  • vagrant-vmware-workstation 4.0.5

Minimal with Synced Folders Disabled

@tknerr
tknerr / org1-prod.rb
Last active August 29, 2015 14:23 — forked from ranjib/org1-prod.rb
# located at chef_repo/environments/org1-prod.rb
require 'deep_merge'
name 'org1-prod'
description 'Production environment for org1'
org1_yml_path = File.expand_path('../common/org1.yml', __FILE__)
common = YAML.load_file(org1_yml_path)
default_attributes(
common['default'].deep_merge!(
# declare all you org1-prod specific things here.
@tknerr
tknerr / .kitchen.docker.yml
Last active December 4, 2017 20:11
Tricking kitchen-vagrant to use the vagrant/docker provider (why? for better caching via vagrant-cachier)
---
driver:
name: docker
driver_config:
provision_command:
- curl -L https://www.opscode.com/chef/install.sh | bash -s -- -v 12.3.0
- env GEM_HOME=/tmp/verifier/gems GEM_PATH=/tmp/verifier/gems GEM_CACHE=/tmp/verifier/gems/cache /opt/chef/embedded/bin/gem install thor busser busser-serverspec serverspec bundler && chown -R kitchen:kitchen /tmp/verifier
require_chef_omnibus: false
use_sudo: false
@tknerr
tknerr / portforward.bat
Created May 29, 2015 14:22
Set up port forwarding of boot2docker via localhost
:: set up port forwarding to make the docker host work via our weird VPN, too
echo port-forwarding docker port 2376 via localhost...
VBoxManage controlvm "boot2docker-vm" natpf1 delete "tcp-port2376" >NUL 2>&1
VBoxManage controlvm "boot2docker-vm" natpf1 "tcp-port2376,tcp,,2376,,2376"
set DOCKER_HOST=tcp://127.0.0.1:2376
@tknerr
tknerr / generate_client_key.bat
Created May 29, 2015 13:45
Generating new client key in boot2docker from a Windows host
:: see https://docs.docker.com/articles/https/
set LIBDIR=/var/lib/boot2docker/tls
b2d ssh -- sudo openssl genrsa -out %LIBDIR%/localhost_key.pem 2048
b2d ssh -- sudo OPENSSL_CONF=/usr/local/etc/ssl/openssl.cnf openssl req -subj '/CN=client' -new -key %LIBDIR%/localhost_key.pem -out %LIBDIR%/localhost_client.csr
b2d ssh -- echo extendedKeyUsage = clientAuth ^| sudo tee %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo openssl x509 -req -days 365 -in %LIBDIR%/localhost_client.csr -CA %LIBDIR%/ca.pem -CAkey %LIBDIR%/cakey.pem -CAcreateserial -out %LIBDIR%/localhost_cert.pem -extfile %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo rm %LIBDIR%/localhost_client.csr %LIBDIR%/localhost_extfile.cnf
b2d ssh -- sudo cat %LIBDIR%/localhost_key.pem > %HOME%\.boot2docker\certs\boot2docker-vm\localhost_key.pem
@tknerr
tknerr / debug_no_rsync_in_path.log
Last active August 29, 2015 14:21
Output of `bundle exec vagrant provision my_windows_server > debug.log 2>&1`, see https://github.com/tknerr/vagrant-managed-servers/pull/47
Your Gemfile lists the gem vagrant-managed-servers (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now, it could cause errors if you change the version of just one of them later.
INFO global: Vagrant version: 1.7.2
INFO global: Ruby version: 2.1.5
INFO global: RubyGems version: 2.4.4
INFO global: VAGRANT_HOME="W:\\home\\.vagrant.d"
INFO global: VAGRANT_INTERNAL_BUNDLERIZED="1"
INFO global: VAGRANT_LOG="DEBUG"
INFO global: Plugins:
@tknerr
tknerr / README.md
Last active February 11, 2019 19:42
Trying to get a minimal Vagrant with a Windows guest example to work...

Environment

If you are trying to reproduce this exactly, I'm using the following environment:

Basebox

First challenge is to get a windows basebox from somewhere. I couldn't find a good one, so built one myself from the windows/boxcutter packer templates:

@tknerr
tknerr / Vagrantfile
Created May 5, 2015 12:34
Given the below Vagrantfile the vagrant up process keeps hanging / does not return. Might have to do with the fact that `vagrant ssh -c "echo foo"` does not work either but drops us into an interactive powershell
Vagrant.configure(2) do |config|
config.vm.box = "boxcutter/eval-win7x86-enterprise-nocm"
# tell the VM to explictly use ssh and not replace keys
config.vm.communicator = :ssh
config.ssh.insert_key = false
config.vm.provision "shell", inline: "echo hello from inline"
@tknerr
tknerr / tasks.yml
Created February 26, 2015 09:27
Caching Oracle JDK Installation Packages dowloaded by WebUpd8 Oracle Java PPA via vagrant-cachier (Ansible Edition)
- name: Oracle Java 7 | Set Local Download Cache
debconf: name='oracle-java7-installer' question='oracle-java7-installer/local' value='/tmp/vagrant-cache/jdk' vtype='string'
@tknerr
tknerr / log
Created January 18, 2015 12:18
vagrant up works, but after that the shared folder is lost and vagrant provision fails
tkn@dev-box:~/vagrant-workflow-tests/playground/sample-infrastructure-repo$ vagrant up app_v1
Bringing machine 'app_v1' up with 'lxc' provider...
==> app_v1: Using top-level cookbook 'https://github.com/tknerr/sample-toplevel-cookbook'
==> app_v1: Ensuring top-level cookbook is checked out at 'v0.2.0'
==> app_v1: Installing top-level cookbook dependencies to '/home/tkn/vagrant-workflow-tests/playground/sample-infrastructure-repo/.vagrant/toplevel-cookbooks/app_v1/cookbooks'
Resolving cookbook dependencies...
Fetching 'sample-app' from source at .
Using apt (2.4.0)
Using iptables (0.13.2)
Using apache2 (1.10.4)