Commit Graph

140 Commits

Author SHA1 Message Date
David Gageot ac45f88ce3 Don't create the VM if no hardware virtualization
Signed-off-by: David Gageot <david@gageot.net>
2015-12-18 12:27:04 +01:00
David Gageot 42ad416c0a FIX #2479 Warn on VirtualBox version
Signed-off-by: David Gageot <david@gageot.net>
2015-12-10 16:10:52 +01:00
David Gageot 52128128fd Detect Yet Another Virtualization issue
Signed-off-by: David Gageot <david@gageot.net>
2015-12-08 17:43:39 +01:00
Joe Friedl b2c9366245 Add the --virtualbox-host-dns-resolver flag
Signed-off-by: Joe Friedl <joe@joefriedl.net>
2015-12-01 21:03:51 -05:00
Jean-Laurent de Morlhon b7b767aafe Allow virtualbox DNSProxy override
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-12-01 16:02:20 +01:00
David Gageot 515bdad0f6 Remove redundant log
Signed-off-by: David Gageot <david@gageot.net>
2015-11-27 09:33:21 +01:00
Jean-Laurent de Morlhon 84a40bcc06 Refactor OS Specific code
And introduce Per-OS testing

Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-11-24 16:03:41 +01:00
David Gageot 8d47fe746e Reject VirtualBox version<=3
Signed-off-by: David Gageot <david@gageot.net>
2015-11-20 18:57:26 +01:00
David Gageot 35b2b042e1 Merge pull request #2374 from dgageot/more-vb-tests
Add more tests to the VirtualBox driver
2015-11-20 18:47:20 +01:00
Jean-Laurent de Morlhon ade5911b32 Fixes #2372, add test for #2356
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-11-20 17:48:53 +01:00
David Gageot 53c5198a5a Use the passed VBoxManager
This makes the code easier to test.

Signed-off-by: David Gageot <david@gageot.net>
2015-11-20 15:01:55 +01:00
Daehyeok Mun 02da868c08 VirtualBox: Delete machine in 'PAUSED' state
Signed-off-by: Daehyeok Mun <daehyeok@gmail.com>
2015-11-20 02:30:50 -07:00
David Gageot 79563b1972 Move VT-X check to PreCreateCheck
Signed-off-by: David Gageot <david@gageot.net>
2015-11-19 11:51:56 +01:00
David Gageot b586b94b13 Cosmetics
Signed-off-by: David Gageot <david@gageot.net>
2015-11-19 11:51:56 +01:00
David Gageot 620b2ed418 Add missing ENV for import-boot2docker-vm flag
Signed-off-by: David Gageot <david@gageot.net>
2015-11-19 11:51:55 +01:00
David Gageot df7212df95 Add missing ENV for no-share flag
Signed-off-by: David Gageot <david@gageot.net>
2015-11-19 11:51:55 +01:00
David Gageot d56d0dc495 Remove unused constants
Signed-off-by: David Gageot <david@gageot.net>
2015-11-19 11:11:07 +01:00
David Gageot eb42133a06 Merge pull request #2122 from chantra/mount_linux
Add shared folder and virtualization check for Linux.
2015-11-18 10:12:56 +01:00
Olivier Gambier 89d9854943 Another pass at linting
Signed-off-by: Olivier Gambier <olivier@docker.com>
2015-11-10 16:58:14 +01:00
David Gageot fb986b23e0 Merge pull request #2207 from jeanlaurent/1737-virtualbox-installation-path
Fix #1737 - Detect non default VirtualBox Installation Path
2015-11-10 10:02:38 +01:00
Jean-Laurent de Morlhon b6ca1035bd Fix for #1737 - Better detect non default VirtualBox Installation Path
Signed-off-by: Jean-Laurent de Morlhon <jeanlaurent@morlhon.net>
2015-11-10 09:52:38 +01:00
Nathan LeClaire ad757310fb Fix boot2docker import regression
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-11-06 17:10:41 -08:00
Todor Minchev 36ca9c6063 Fix DHCP server and host-only adapter IP address clash
When setting up a host-only network we need to pass the IP address
of the host adapter (e.g 192.168.99.1) to the getRandomIPinSubnet function.
Passing the network address (e.g 192.168.1.0) can result in bypassing the IP
clash check and having the same address assigned to both the DHCP server
and the host-only network interface.

Signed-off-by: Todor Minchev <todor.minchev@linux.intel.com>
2015-11-03 11:26:31 -08:00
David Gageot 0176f05db8 FIX #2127 Detect that HW virtualization is not supported
Signed-off-by: David Gageot <david@gageot.net>
2015-10-30 16:19:38 +01:00
Emmanuel Bretelle 42f1dbb964 virtualbox: support linux host
Fixes #2110

Signed-off-by: Emmanuel Bretelle <chantr4@gmail.com>
2015-10-29 20:21:10 -07:00
David Gageot 970c630fd3 FIX #2093 warn in case we think VT-X is not enabled.
Signed-off-by: David Gageot <david@gageot.net>
2015-10-28 22:22:04 +01:00
Fabian Ruff 5021ffd2e7 support github enterprise urls for b2d downloads
This commit allows downloading boot2docker releases not only from the official releases url (https://api.github.com/repos/boot2docker/boot2docker/releases) but from arbitrary github repositories that publish releases with a boot2docker.iso artifact. It also supports downloading from github enterprise.

Signed-off-by: Fabian Ruff <fabian@progra.de>
2015-10-22 16:12:21 +02:00
Chris Abernethy 6a7c8c2a25 Additional validation on virtualbox-hostonly-cidr
Check that the CIDR provided for a virtualbox host only CIDR is specified as a host IP and netmask, e.g., 192.168.100.1/24, and not a network IP and netmask, e.g., 192.168.100.0/24. This will help prevent confusion like #1383

Signed-off-by: Chris Abernethy <cabernet@chrisabernethy.com>

Signed-off-by: David Gageot <david@gageot.net>
2015-10-21 20:46:13 +02:00
Dave Henderson e2856e36f4 Adding support for darwin to IsVTXDisabled
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-10-20 21:20:40 -04:00
David Gageot 94361315a8 Add tests to virtualbox driver
Signed-off-by: David Gageot <david@gageot.net>
2015-10-20 19:08:18 +02:00
David Gageot 4a33fabe8b Check that VT-X/AMD-v is enabled
Signed-off-by: David Gageot <david@gageot.net>
2015-10-20 09:56:43 +02:00
Dave Henderson 2a6e3dbf40 Fix log.* method calls which meant to be log.*f
Stuff like `log.Debug("foo bar: %s", baz)` really wants to be
`log.Debugf("foo bar: %s", baz)`...

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-10-17 15:59:25 -04:00
Nathan LeClaire c8edb33ecd Move towards using external binaries / RPC plugins
- First RPC steps

- Work on some flaws in RPC model

- Remove unused TLS settings from Engine and Swarm options

- Add code to correctly encode data over the network

- Add client driver for RPC

- Rename server driver file

- Start to make marshal make sense

- Fix silly RPC method args and add client

- Fix some issues with RPC calls, and marshaling

- Simplify plugin main.go

- Move towards 100% plugin in CLI

- Ensure that plugin servers are cleaned up properly

- Make flag parsing for driver flags work properly

Includes some work carried from @dmp42 updating the build process and
tests to use the new method.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-16 16:34:56 -07:00
Nathan LeClaire f0ebeab041 Move VBox detection to Precreate and print version
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-10-07 20:41:26 -07:00
Nathan LeClaire 9453df4859 Fix Docker daemon wait
Also, a few various cleanups are bundled:

1. Only call GetDriver() once to get the object in provision/utils.go
2. SSH command wrapper will return the error and let the consumer decide
   what to do with it instead of bailing automatically on non-255

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-09-23 15:19:25 -07:00
Nathan LeClaire b5927f10c4 Make libmachine usable by outside world
- Clear out some cruft tightly coupling libmachine to filestore

- Comment out drivers other than virtualbox for now

- Change way too many things

- Mostly, break out the code to be more modular.

- Destroy all traces of "provider" in its current form.  It will be
brought back as something more sensible, instead of something which
overlaps in function with both Host and Store.

- Fix mis-managed config passthru

- Remove a few instances of state stored in env vars

- This should be explicitly communicated in Go-land, not through the
shell.

- Rename "store" module to "persist"

- This is done mostly to avoid confusion about the fact that a concrete
instance of a "Store" interface is oftentimes referred to as "store" in
the code.

- Rip out repetitive antipattern for getting store

- This replaces the previous repetive idiom for getting the cert info, and
consequently the store, with a much less repetitive idiom.

- Also, some redundant methods in commands.go for accessing hosts have
either been simplified or removed entirely.

- First steps towards fixing up tests

- Test progress continues

- Replace unit tests with integration tests

- MAKE ALL UNIT TESTS PASS YAY

- Add helper test files

- Don't write to disk in libmachine/host

- Heh.. coverage check strikes again

- Fix remove code

- Move cert code around

- Continued progress: simplify Driver

- Fixups and make creation work with new model

- Move drivers module inside of libmachine

- Move ssh module inside of libmachine

- Move state module to libmachine

- Move utils module to libmachine

- Move version module to libmachine

- Move log module to libmachine

- Modify some constructor methods around

- Change Travis build dep structure

- Boring gofmt fix

- Add version module

- Move NewHost to store

- Update some boring cert path infos to make API easier to use

- Fix up some issues around the new model

- Clean up some cert path stuff

- Don't use shady functions to get store path :D

- Continue artifact work

- Fix silly machines dir bug

- Continue fixing silly path issues

- Change up output of vbm a bit

- Continue work to make example go

- Change output a little more

- Last changes needed to make create finish properly

- Fix config.go to use libmachine

- Cut down code duplication and make both methods work with libmachine

- Add pluggable logging implementation

- Return error when machine already in desired state

- Update example to show log method

- Fix file:// bug

- Fix Swarm defaults

- Remove unused TLS settings from Engine and Swarm options

- Remove spurious error

- Correct bug detecting if migration was performed

- Fix compilation errors from tests

- Fix most of remaining test issues

- Fix final silly bug in tests

- Remove extraneous debug code

- Add -race to test command

- Appease the gofmt

- Appease the generate coverage

- Making executive decision to remove Travis coverage check

In the early days I thought this would be a good idea because it would
encourage people to write tests in case they added a new module.  Well,
in fact it has just turned into a giant nuisance and made refactoring
work like this even more difficult.

- Move Get to Load
- Move HostListItem code to CLI

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-09-23 12:30:15 -07:00
Evan Hazlett 3c712ae30a
change debug env var to MACHINE_DEBUG
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-09-05 08:57:03 -04:00
Evan Hazlett b8f7c3446b Merge pull request #1674 from csakoda/fix-VBox-getRandomIPinSubnet
Fix VirtualBox DHCPServer always uses x.x.x.1, despite getRandomIPinSubnet()
2015-08-28 18:29:01 -04:00
Palanivelrajan Balasubramanian 5f362aca6b added support for configuring nictype and nicpromise mode in virtualbox
Signed-off-by: Palanivelrajan Balasubramanian <praveen12bnitt@gmail.com>
2015-08-19 16:49:42 -04:00
Chuck Sakoda c2c942411b Assign the last octet of random subnet IP to a random value, instead of always 1
Signed-off-by: Chuck Sakoda <cms235@gmail.com>
2015-08-12 13:20:58 -07:00
David McKay 07e7604f0e * Added option to disable virtualbox vbfs user home directory mount
* Updated documentation with new option
* Updated flag name

Signed-off-by: David McKay <david@rawkode.com>
2015-08-12 20:37:06 +01:00
Nathan LeClaire 8ba5a57072 Revert "Merge pull request #1552 from ehazlett/b2d-next"
This reverts commit 736ebb14fb, reversing
changes made to c6660bf62c.

Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-08-03 14:46:52 -07:00
Evan Hazlett cb80c434ac b2d: use direct urls until release; devicemapper for engine opts tests
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

b2d-ng: use driver names for iso versions

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:07:01 -04:00
Evan Hazlett c6e9849783 vbox: restrict regex matching for msys translated paths
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: remove tar loading from virtual disk creation

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

tests: use btrfs instead of overlay for custom option test

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:07:01 -04:00
Evan Hazlett e09f2fdd9c vbox: change to get latest released iso instead of pre-release
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: fix windows share dir for homedir

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: update tests for b2d

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-24 09:07:01 -04:00
Evan Hazlett ab31d52165 update vbox driver to work with new b2d
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: lock down shared folders to user home dir

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

use env var for user for cross platform

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

vbox: remove sudo from setting ssh key for user

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>

wip: use homedir for share

Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2015-07-23 19:40:07 -04:00
Nathan LeClaire 8089e222c3 Remove synthcpu flag for Virtualbox 5 support
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-07-09 10:42:46 -07:00
Evan Hazlett 69dc9fd7f3 Merge pull request #1273 from hairyhenderson/default-driver-impl
refactor: Extracting a base Driver struct
2015-07-09 01:59:05 -06:00
Nathan LeClaire 9053ee24c7 Fix choke when starting from Saved state
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
2015-07-07 14:36:21 -07:00
Dave Henderson 3d002187fe Refactoring drivers to embed drivers.DefaultDriver
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
2015-07-07 11:24:00 -04:00