Skip to content

Instantly share code, notes, and snippets.

@safizn
Last active January 10, 2017 17:27
Show Gist options
  • Save safizn/0a4506b45f6ea2dbece8d83155ae0120 to your computer and use it in GitHub Desktop.
Save safizn/0a4506b45f6ea2dbece8d83155ae0120 to your computer and use it in GitHub Desktop.
# initialize inside a directory a vm from vagrantcloud respiratory
vagrant init 3scale/docker
# start vm up
vagrant up
# start all associated VMs
vagrant up --provision
# ssh into the vm
vagrant ssh
# stop vm
vagrant halt
# delete completely
vagrant destroy
# check vms running
vagrant status
# reload
vagrant reload
# Prerequisites
# PATHS to add to windows enviroment variables:
• Install on windows VBoxManage commange, after installing oracle virtualbox, add to system PATH the directory “C:\Program Files\Oracle\VirtualBox;
Then the command VBoxManage should work.
• # For ssh to work
set PATH=%PATH%;”C:\Program Files\Git\usr\bin”
• http://superuser.com/questions/850357/how-to-fix-extremely-slow-virtualbox-network-download-speed
# For Vt-x problem virtualization CPU required, should be solved either with:
• Uncheck PAE/NX in virtualbox settings for the vm
• https://blindcoder.wordpress.com/2013/12/10/virtualbox-error-vt-x-is-disabled-in-the-bios-verr_vmx_msr_vmxon_disabled/
○ VBoxManage modifyvm "My Guest VM Name" --longmode off
# STUCK when creating vm: when machine is waiting and stuck, which is caused usually from vm waiting for input. Send “enter” key to vm to allow it to continue setup. (Sending command in new shell. (This didn’t solve the problem but using vagrant on another computer did).
http://stackoverflow.com/questions/22575261/vagrant-stuck-connection-timeout-retrying
VBoxManage list runningvms
VBoxManage list vms
VBoxManage controlvm projects_1234567890 keyboardputscancode 1c
# OR other solution is to enable userinterface for vm, by adding this to vagrantfile:
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
# for ssh problem
http://stackoverflow.com/questions/27768821/ssh-executable-not-found-in-any-directories-in-the-path
#vagrant boxes to use for docker
# ubuntu machine without docker but is ready for to be used after docker installaiton:
https://atlas.hashicorp.com/bento/boxes/ubuntu-16.04
https://github.com/phusion/open-vagrant-boxes
dduportal/boot2docker
# includding docker compose
https://atlas.hashicorp.com/kwilczynski/boxes/ubuntu-16.04-docker
https://github.com/leighmcculloch/vagrant-docker-compose
https://atlas.hashicorp.com/minimum/boxes/ubuntu-trusty64-docker
# GUI for vm :
config.vm.provider :virtualbox do |vb|
vb.gui = true
end
# Forward ports
# https://github.com/simono/vm-examples/blob/master/docker-host/Vagrantfile
# http://stackoverflow.com/questions/17623528/how-can-vagrant-forward-multiple-ports-on-the-same-machine
for i in 80..89
config.vm.network :forwarded_port, guest: i, host: i
end
for i in 8080..8089
config.vm.network :forwarded_port, guest: i, host: i
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment