nathany/vagrant-gopher


A Vagrantfile for running Go VMs

https://nathany.com/go-testing-toolbox/

License: BSD-2-Clause

Keywords: freebsd, golang, linux, solaris, vagrantfile, virtualbox


Vagrant Gopher

A Vagrantfile for running Go VMs (Linux and BSD). While cross-compilation works great in Go, having actual VMs can be useful to run tests or debug programs under other operating systems.

Requirements

Vagrant, VirtualBox and a Go workspace.

Usage

Copy this Vagrantfile to src/Vagrantfile:

src:~$ curl -O https://raw.githubusercontent.com/nathany/vagrant-gopher/master/Vagrantfile

Then run vagrant up from any subfolder.

This will mount your src folder as a shared folder inside the Linux/BSD VMs, while creating new bin/pkg folders to avoid collisions (particularly bin).

Use vagrant ssh linux or vagrant ssh bsd to login and look around, or run a single command like vagrant ssh linux -c 'go help'.

You will likely need to change directories. CDPATH is configured for the major source code hosts to save a few keystrokes, eg.

vagrant ssh linux -c 'cd nathany/looper; go test ./...'

Use vagrant halt to shutdown or vagrant destroy to free up disk space.

See the Vagrant Command Line documentation for details.

Notes

  • Currently this shares the src/ folder into $HOME/src on the virtual machine ($HOME/go/src did not work).
  • It would be nice to have a wrapper/plugin around the ssh command that runs commands based on the current folder.
  • Shared folders aren't compatible with tools that watch files inside the VM using fsnotify.
  • 64-bit boxes are used to support the Go race detector.
  • The BSD box does not support Windows hosts.

Project Statistics

Sourcerank 6
Repository Size 27.3 KB
Stars 36
Forks 2
Watchers 1
Open issues 4
Dependencies 0
Contributors 1
Tags 1
Created
Last updated
Last pushed

Top Contributors See all

Nathan Youngman

Recent Tags See all

v0.1.0 September 29, 2013

Something wrong with this page? Make a suggestion

Last synced: 2017-11-24 20:00:17 UTC

Login to resync this repository