From 307b69b1d2e0d195315b85a1563180430277a66a Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Sat, 8 Mar 2014 01:17:58 +0400 Subject: [PATCH 1/7] Compatibility with Vagrant 1.5 --- Gemfile | 8 +++++--- lib/vagrant-parallels/action.rb | 3 ++- lib/vagrant-parallels/action/check_guest_tools.rb | 2 +- lib/vagrant-parallels/action/network.rb | 4 ++-- lib/vagrant-parallels/synced_folder.rb | 11 ++++++----- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/Gemfile b/Gemfile index 5ebdb1bd..096cf3a5 100644 --- a/Gemfile +++ b/Gemfile @@ -1,11 +1,13 @@ source 'http://rubygems.org' -# Specify your gem's dependencies in vagrant-parallels.gemspec -gemspec +group :plugins do + # Specify your gem's dependencies in vagrant-parallels.gemspec + gemspec +end group :development do # We depend on Vagrant for development, but we don't add it as a # gem dependency because we expect to be installed within the # Vagrant environment itself using `vagrant plugin`. - gem 'vagrant', :git => 'git://github.com/mitchellh/vagrant.git', :tag => 'v1.4.3' + gem 'vagrant', :git => 'git://github.com/mitchellh/vagrant.git' end diff --git a/lib/vagrant-parallels/action.rb b/lib/vagrant-parallels/action.rb index 4f9ddcb3..b9937557 100644 --- a/lib/vagrant-parallels/action.rb +++ b/lib/vagrant-parallels/action.rb @@ -203,6 +203,7 @@ def self.action_start Vagrant::Action::Builder.new.tap do |b| b.use CheckParallels b.use ConfigValidate + b.use BoxCheckOutdated b.use Call, IsRunning do |env, b2| # If the VM is running, then our work here is done, exit if env[:result] @@ -252,7 +253,7 @@ def self.action_up # works fine. b.use Call, Created do |env, b2| if !env[:result] - b2.use HandleBoxUrl + b2.use HandleBox end end diff --git a/lib/vagrant-parallels/action/check_guest_tools.rb b/lib/vagrant-parallels/action/check_guest_tools.rb index ac313dd7..5ff15433 100644 --- a/lib/vagrant-parallels/action/check_guest_tools.rb +++ b/lib/vagrant-parallels/action/check_guest_tools.rb @@ -13,7 +13,7 @@ def call(env) return @app.call(env) end - env[:ui].info(I18n.t("vagrant_parallels.parallels.checking_guest_tools")) + env[:ui].output(I18n.t("vagrant_parallels.parallels.checking_guest_tools")) tools_version = env[:machine].provider.driver.read_guest_tools_version if !tools_version diff --git a/lib/vagrant-parallels/action/network.rb b/lib/vagrant-parallels/action/network.rb index d9ff70c3..90164559 100644 --- a/lib/vagrant-parallels/action/network.rb +++ b/lib/vagrant-parallels/action/network.rb @@ -99,9 +99,9 @@ def call(env) if !adapters.empty? # Enable the adapters @logger.info("Enabling adapters...") - env[:ui].info(I18n.t("vagrant.actions.vm.network.preparing")) + env[:ui].output(I18n.t("vagrant.actions.vm.network.preparing")) adapters.each do |adapter| - env[:ui].info(I18n.t( + env[:ui].detail(I18n.t( "vagrant_parallels.parallels.network_adapter", adapter: adapter[:adapter].to_s, type: adapter[:type].to_s, diff --git a/lib/vagrant-parallels/synced_folder.rb b/lib/vagrant-parallels/synced_folder.rb index d15b33a8..6f2c465b 100644 --- a/lib/vagrant-parallels/synced_folder.rb +++ b/lib/vagrant-parallels/synced_folder.rb @@ -36,14 +36,15 @@ def enable(machine, folders, _opts) end # Go through each folder and mount - machine.ui.info(I18n.t("vagrant.actions.vm.share_folders.mounting")) + machine.ui.output(I18n.t("vagrant.actions.vm.share_folders.mounting")) folders.each do |id, data| if data[:guestpath] id = Pathname.new(id).to_s.split('/').drop_while{|i| i.empty?}.join('_') # Guest path specified, so mount the folder to specified point - machine.ui.info(I18n.t("vagrant.actions.vm.share_folders.mounting_entry", - :guest_path => data[:guestpath])) + machine.ui.detail(I18n.t("vagrant.actions.vm.share_folders.mounting_entry", + guestpath: data[:guestpath], + hostpath: data[:hostpath])) # Dup the data so we can pass it to the guest API data = data.dup @@ -58,8 +59,8 @@ def enable(machine, folders, _opts) :mount_parallels_shared_folder, id, data[:guestpath], data) else # If no guest path is specified, then automounting is disabled - machine.ui.info(I18n.t("vagrant.actions.vm.share_folders.nomount_entry", - :host_path => data[:hostpath])) + machine.ui.detail(I18n.t("vagrant.actions.vm.share_folders.nomount_entry", + :hostpath => data[:hostpath])) end end end From c2e279b5a491b8319d19f78f125b8d62a2d29572 Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Sat, 8 Mar 2014 01:36:52 +0400 Subject: [PATCH 2/7] i18n-tasks: skip checking of 'providers_hyperv' and 'synced_folder_smb' locales --- config/i18n-tasks.yml.erb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/i18n-tasks.yml.erb b/config/i18n-tasks.yml.erb index b9933744..d858f7b5 100644 --- a/config/i18n-tasks.yml.erb +++ b/config/i18n-tasks.yml.erb @@ -1,3 +1,8 @@ +base_locale: en + +# skip checking 'providers_hyperv' and 'synced_folder_smb' locales +locales: [] + search: paths: - "lib/" From 2c0d87048bcd70980d914cdbf68568774437fadc Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Sun, 9 Mar 2014 12:31:38 +0400 Subject: [PATCH 3/7] README.md: fixed grammar --- README.md | 81 +++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 42 deletions(-) diff --git a/README.md b/README.md index 48f1da99..dacfc34e 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ [![Code Climate](https://codeclimate.com/github/Parallels/vagrant-parallels.png)](https://codeclimate.com/github/Parallels/vagrant-parallels) This is a plugin for [Vagrant](http://www.vagrantup.com), -allowing to power virtual machines by -[Parallels Desktop for Mac](http://www.parallels.com/downloads/desktop/). +allowing to power [Parallels Desktop for Mac](http://www.parallels.com/downloads/desktop/) +based virtual machines. ### Requirements - Parallels Desktop for Mac 8 or 9 @@ -15,16 +15,18 @@ If you're just getting started with Vagrant, it is highly recommended that you read the official [Vagrant documentation](http://docs.vagrantup.com/v2/) first. ## Features -Parallels provider supports all basic Vagrant features, except one: **"Forwarded ports" configuration is not available yet**. +The Parallels provider supports all basic Vagrant features, except one: +**"Forwarded ports" configuration is not available yet**. -It might be implemented in the future, after the next release of Parallels Desktop for Mac. +It might be implemented in the future, after the next release of Parallels +Desktop for Mac. ## Installation -First of all make sure that you have [Parallels Desktop for Mac](http://www.parallels.com/products/desktop/) +First, make sure that you have [Parallels Desktop for Mac](http://www.parallels.com/products/desktop/) and [Vagrant](http://www.vagrantup.com/downloads) properly installed. We recommend that you use the latest versions of these products. -Since Parallels provider is a Vagrant plugin, installing is easy: +Since the Parallels provider is a Vagrant plugin, installing it is easy: ``` $ vagrant plugin install vagrant-parallels @@ -43,28 +45,28 @@ $ vagrant up --provider=parallels ... ``` -You need to have a parallels compatible box specified in your `Vagrantfile` -before doing a `vagrant up`, please refer to the *Boxes* section for instructions. +You need a Parallels compatible box specified in your `Vagrantfile` +before doing `vagrant up`, please refer to the *Boxes* section for instructions. ### Default Provider -You can use `VAGRANT_DEFAULT_PROVIDER` environmental variable to specify the -default provider. Just set it to `parallels` and then it wont be necessary -to add `--provider` flag to vagrant commands. +You can use `VAGRANT_DEFAULT_PROVIDER` environment variable to specify the +default provider. Just set it to `parallels` and then it will not be necessary +to add the `--provider` flag to vagrant commands. ``` export VAGRANT_DEFAULT_PROVIDER=parallels ``` -You can also add this command to your `~/.bashrc` file +You can also add this command to the `~/.bashrc` file (or `~/.zshrc` if your shell is Zsh) to make this setting permanent. ## Boxes Every provider in Vagrant must introduce a custom box format. -As with every provider, Parallels provider has a custom box format. -There is a list of popular base boxes for Parallels provider: +As with every provider, the Parallels provider has a custom box format. +The following base boxes for Parallels provider are available: - Ubuntu 12.04 x86_64: [http://download.parallels.com/desktop/vagrant/precise64.box] @@ -75,14 +77,13 @@ There is a list of popular base boxes for Parallels provider: (http://download.parallels.com/desktop/vagrant/saucy64.box) - CentOS 6.5 x86_64:- -[http://download.parallels.com/desktop/vagrant/CentOS-6.5-x86_64.box] -(http://download.parallels.com/desktop/vagrant/CentOS-6.5-x86_64.box) +[http://download.parallels.com/desktop/vagrant/centos64.box] +(http://download.parallels.com/desktop/vagrant/centos64.box) - CentOS 5.9 x86_64:- [http://download.parallels.com/desktop/vagrant/CentOS-5.9-x86_64.box] (http://download.parallels.com/desktop/vagrant/CentOS-5.9-x86_64.box) - You can add one of these boxes using the next command: ``` @@ -90,12 +91,12 @@ $ vagrant box add --provider=parallels precise64 http://download.parallels.com/d ``` ## Networking -By default Vagrant Parallels provider uses the basic Vagrant networking -approach. Initially VM has one adapter assigned to the 'Shared' network +By default, The Parallels provider uses the basic Vagrant networking +approach. Initially, a virtual machine has one adapter assigned to the 'Shared' network in Parallels Desktop. -But you can also add `:private_network` and `:public_network` adapters. -These features are working by the same way as in the basic Vagrant: +In addition, you can add `:private_network` and `:public_network` adapters. +These features are working the same way as in the basic Vagrant: - [Private Networks] (http://docs.vagrantup.com/v2/networking/private_network.html) - [Public Networks] @@ -103,12 +104,12 @@ These features are working by the same way as in the basic Vagrant: ## Provider Specific Configuration -Parallels Desktop has a `prlctl` utility that can be used to make modifications -to Parallels virtual machines from the command line. +Parallels Desktop has the `prlctl` command-line utility that can be used to make modifications +to Parallels virtual machines. -Parallels provider exposes a way to call any command against *prlctl* just prior -to booting the machine: +The Parallels provider allows to execute the prlctl command with any of avialable options just prior +to starting a virtual machine: ```ruby config.vm.provider "parallels" do |v| @@ -117,17 +118,13 @@ config.vm.provider "parallels" do |v| end ``` -In the example above, the VM is modified to have a specified iso image attached -to it's virtual media device (cdrom). Some details: - -* The `:id` special parameter is replaced with the ID of the virtual - machine being created, so when a *prlctl* command requires an ID, you - can pass this special parameter. +In the example above, the virtual machine is modified to have a specified ISO image mounted +on it's virtual media device (cdrom). The `:id` parameter is replaced with the actual virtual machine ID. -* Multiple `customize` directives can be used. They will be executed in the - order given. +Multiple `customize` directives can be used. They will be executed in the +given order. -There are some convenience shortcuts for memory and CPU settings: +The virtual machine memory and CPU settings can be modified easily: ```ruby config.vm.provider "parallels" do |v| @@ -157,8 +154,8 @@ Once you have the dependencies, verify the unit tests pass with `rake`: $ bundle exec rake ``` -If those pass, you're ready to start developing the plugin. You can test -the plugin without installing it into your Vagrant environment by just +If they pass, you're ready to start developing the plugin. You can test +the plugin without installing it into your Vagrant environment by simply creating a `Vagrantfile` in the top level of this directory (it is added to *.gitignore*) and add the following line to your `Vagrantfile` @@ -166,7 +163,7 @@ and add the following line to your `Vagrantfile` Vagrant.require_plugin "vagrant-parallels" ``` -You need to have a compatible box file installed, refer to the *Boxes* section +You need a compatible box file installed. Refer to the *Boxes* section. Use bundler to execute Vagrant: @@ -187,7 +184,7 @@ $ bundle exec rake build $ vagrant plugin install pkg/vagrant-parallels-.gem ... ``` -So, now that you have your own plugin installed, check it with the command +Now that you have your own plugin installed, check it with the command `vagrant plugin list` ## Contributing @@ -199,17 +196,17 @@ So, now that you have your own plugin installed, check it with the command 5. Create a pull request from your `my-new-feature` branch into master ## Getting help -Having problems while using our provider? Ask your question to our mailing list: +Having problems while using the provider? Ask your question to our mailing list: [Google Group](https://groups.google.com/group/vagrant-parallels) -If you've got a strange error while using Parallels provider, or found a bug -there - please, report it on [Issue Tracker](https://github.com/Parallels/vagrant-parallels). +If you get an error while using the Parallels provider or discover a bug, +please report it on the [IssueTracker](https://github.com/Parallels/vagrant-parallels). ## Credits Great thanks to *Youssef Shahin* `@yshahin` for having initiated the development of this provider. You've done a great job, Youssef! -Also, thanks to the people who helping this project stand on its feet, thank you +Also, thanks to the people who are helping this project stand on its feet, thank you * Mikhail Zholobov `@legal90` * Kevin Kaland `@wizonesolutions` From 87110c712ce4be66030417c3c45c69dd6612d39f Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Mon, 10 Mar 2014 16:14:46 +0300 Subject: [PATCH 4/7] Update README.md Centos link fixed --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dacfc34e..8937ff54 100644 --- a/README.md +++ b/README.md @@ -77,8 +77,8 @@ The following base boxes for Parallels provider are available: (http://download.parallels.com/desktop/vagrant/saucy64.box) - CentOS 6.5 x86_64:- -[http://download.parallels.com/desktop/vagrant/centos64.box] -(http://download.parallels.com/desktop/vagrant/centos64.box) +[http://download.parallels.com/desktop/vagrant/CentOS-6.5-x86_64.box] +(http://download.parallels.com/desktop/vagrant/CentOS-6.5-x86_64.box) - CentOS 5.9 x86_64:- [http://download.parallels.com/desktop/vagrant/CentOS-5.9-x86_64.box] From 9a76441f47799adcd41f42d5c6f2171e043c0583 Mon Sep 17 00:00:00 2001 From: racktear Date: Mon, 10 Mar 2014 22:41:32 +0400 Subject: [PATCH 5/7] Bump version to 1.0.0 --- lib/vagrant-parallels/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vagrant-parallels/version.rb b/lib/vagrant-parallels/version.rb index 2aedf734..5e4757dd 100644 --- a/lib/vagrant-parallels/version.rb +++ b/lib/vagrant-parallels/version.rb @@ -1,5 +1,5 @@ module VagrantPlugins module Parallels - VERSION = "0.2.2" + VERSION = "1.0.0" end end From 520be9990f7ce0896d89bfd24d31f4c59038f7ec Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Mon, 10 Mar 2014 22:53:19 +0400 Subject: [PATCH 6/7] Changed Vagrant version requirement --- lib/vagrant-parallels/plugin.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vagrant-parallels/plugin.rb b/lib/vagrant-parallels/plugin.rb index a4c5946d..89e19f29 100644 --- a/lib/vagrant-parallels/plugin.rb +++ b/lib/vagrant-parallels/plugin.rb @@ -6,8 +6,8 @@ # This is a sanity check to make sure no one is attempting to install # this into an early Vagrant version. -if Vagrant::VERSION < "1.4.0" - raise "The Vagrant Parallels plugin is only compatible with Vagrant 1.4+" +if Vagrant::VERSION < "1.5.0" + raise "The Vagrant Parallels plugin is only compatible with Vagrant 1.5+" end module VagrantPlugins From 2100c337c19af34a8c53838bb34d013886acdd99 Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Mon, 10 Mar 2014 23:23:07 +0400 Subject: [PATCH 7/7] README.md: Added info about Vagrant 1.5 & backward compatibility --- README.md | 53 ++++++++++++++++++++++++++++------------------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index 8937ff54..56f34aaa 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ based virtual machines. ### Requirements - Parallels Desktop for Mac 8 or 9 -- Vagrant v1.4 or higher +- Vagrant v1.5 or higher If you're just getting started with Vagrant, it is highly recommended that you read the official [Vagrant documentation](http://docs.vagrantup.com/v2/) first. @@ -32,6 +32,15 @@ Since the Parallels provider is a Vagrant plugin, installing it is easy: $ vagrant plugin install vagrant-parallels ``` +#### Compatibility with Vagrant 1.4 +We recommend that you to use the latest version of [Vagrant](http://www.vagrantup.com/downloads.html). +If for any reason you want to use a previous version of Vagrant (1.4.x), you +should install a compatible version of the Parallels provider as described below: + +``` +$ vagrant plugin install vagrant-parallels --plugin-version 0.2.2 +``` + ## Usage Parallels provider is used just like any other provider. Please read the general [basic usage](http://docs.vagrantup.com/v2/providers/basic_usage.html) page for @@ -68,32 +77,24 @@ Every provider in Vagrant must introduce a custom box format. As with every provider, the Parallels provider has a custom box format. The following base boxes for Parallels provider are available: -- Ubuntu 12.04 x86_64: -[http://download.parallels.com/desktop/vagrant/precise64.box] -(http://download.parallels.com/desktop/vagrant/precise64.box) +- Ubuntu 12.04 x86_64: `parallels/ubuntu-12.04` -- Ubuntu 13.10 x86_64: -[http://download.parallels.com/desktop/vagrant/saucy64.box] -(http://download.parallels.com/desktop/vagrant/saucy64.box) +- Ubuntu 13.10 x86_64: `parallels/ubuntu-13.10` -- CentOS 6.5 x86_64:- -[http://download.parallels.com/desktop/vagrant/CentOS-6.5-x86_64.box] -(http://download.parallels.com/desktop/vagrant/CentOS-6.5-x86_64.box) +- CentOS 6.5 x86_64: `parallels/centos-5.9` -- CentOS 5.9 x86_64:- -[http://download.parallels.com/desktop/vagrant/CentOS-5.9-x86_64.box] -(http://download.parallels.com/desktop/vagrant/CentOS-5.9-x86_64.box) +- CentOS 5.9 x86_64: `parallels/centos-6.5` You can add one of these boxes using the next command: ``` -$ vagrant box add --provider=parallels precise64 http://download.parallels.com/desktop/vagrant/precise64.box +$ vagrant box add parallels/centos-6.5 ``` ## Networking By default, The Parallels provider uses the basic Vagrant networking -approach. Initially, a virtual machine has one adapter assigned to the 'Shared' network -in Parallels Desktop. +approach. Initially, a virtual machine has one adapter assigned to the 'Shared' +network in Parallels Desktop. In addition, you can add `:private_network` and `:public_network` adapters. These features are working the same way as in the basic Vagrant: @@ -104,12 +105,12 @@ These features are working the same way as in the basic Vagrant: ## Provider Specific Configuration -Parallels Desktop has the `prlctl` command-line utility that can be used to make modifications -to Parallels virtual machines. +Parallels Desktop has the `prlctl` command-line utility that can be used to make +modifications to Parallels virtual machines. -The Parallels provider allows to execute the prlctl command with any of avialable options just prior -to starting a virtual machine: +The Parallels provider allows to execute the prlctl command with any of +avialable options just prior to starting a virtual machine: ```ruby config.vm.provider "parallels" do |v| @@ -118,8 +119,9 @@ config.vm.provider "parallels" do |v| end ``` -In the example above, the virtual machine is modified to have a specified ISO image mounted -on it's virtual media device (cdrom). The `:id` parameter is replaced with the actual virtual machine ID. +In the example above, the virtual machine is modified to have a specified ISO +image mounted on it's virtual media device (cdrom). The `:id` parameter is +replaced with the actual virtual machine ID. Multiple `customize` directives can be used. They will be executed in the given order. @@ -156,8 +158,8 @@ $ bundle exec rake If they pass, you're ready to start developing the plugin. You can test the plugin without installing it into your Vagrant environment by simply -creating a `Vagrantfile` in the top level of this directory (it is added to *.gitignore*) -and add the following line to your `Vagrantfile` +creating a `Vagrantfile` in the top level of this directory (it is added +to *.gitignore*) and add the following line to your `Vagrantfile` ```ruby Vagrant.require_plugin "vagrant-parallels" @@ -173,7 +175,8 @@ $ bundle exec vagrant up --provider=parallels ###Installing Parallels Provider From Source -If you want to globally install your locally built plugin from source, use the following method: +If you want to globally install your locally built plugin from source, use the +following method: ``` $ cd vagrant-parallels