8000 vic/machines/devbox at networking · hmahmood/vic · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
 
 

devbox

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

Vagrant Dev Box

Overview

This box is an Ubuntu 15.04 VM with the following setup by default:

  • Docker daemon with port forwarded to the Fusion/Workstation host at localhost:12375

  • Go toolchain

  • Additional tools (lsof, strace, etc)

Requirements

Provisioning

All files matching provision*.sh in this directory will be applied by the Vagrantfile, you can symlink custom scripts if needed. The scripts are not Vagrant specific and can be applied to a VM running on ESX for example.

Fusion/Workstation host usage

The following commands can be used from your Fusion or Workstation host.

Shared Folders

By default your GOPATH is shared with the same path as the host. This is useful if your editor runs on the host, then errors on the guest with filename:line info have the same path. For example, when running the following command within the top-level project directory:

vagrant ssh -- make -C $PWD all

Create the VM

vagrant up

SSH Access

vagrant ssh

Docker Access

DOCKER_HOST=localhost:12375 docker ps

Stop the VM

vagrant halt

Restart the VM

vagrant reload

Provision

After you've done a vagrant up, the provisioning can be applied without reloading via:

vagrant provision

Delete the VM

vagrant destroy

VM guest usage

To open a bash term in the VM, use vagrant ssh.

The following commands can be used from devbox VM guest.

cd $GOPATH/src/github.com/vmware/vic

Local Drone CI test

drone exec -trusted -cache

Devbox on ESX

The devbox can be deployed to ESX, the same provisioning scripts are applied:

./deploy-esx.sh

SSH access

ssh-add ~/.vagrant.d/insecure_private_key
vmip=$(govc vm.ip $USER-ubuntu1504-docker)
ssh vagrant@$vmip

Shared folders

You can share your folder by first exporting via NFS:

echo "$HOME/vic $(govc vm.ip $USER-ubuntu1504-docker) -alldirs -mapall=$(id -u):$(id -g)" | sudo tee -a /etc/exports
sudo nfsd restart

Then mount within the ubuntu VM:

ssh vagrant@$vmip sudo mkdir -p $HOME/vic
ssh vagrant@$vmip sudo mount $(ipconfig getifaddr en1):$HOME/vic $HOME/vic

You can also mount your folder within ESX:

govc datastore.create -type nfs -name nfsDatastore -remote-host $(ipconfig getifaddr en1) -remote-path $HOME/vic
esxip=$(govc host.info -json | jq -r '.HostSystems[].Config.Network.Vnic[] | select(.Device == "vmk0") | .Spec.Ip.IpAddress')
ssh root@$esxip mkdir -p $HOME
ssh root@$esxip /vmfs/volumes/nfsDatastore $HOME/vic

Add $esxip to /etc/exports and restart nfsd again.

0