From 1d844bc92036acf7be0f85f5363cd49f04b0102f Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Sun, 2 Mar 2014 15:32:17 +0400 Subject: [PATCH 01/10] README.md: added 'Gem Version' bage --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 58f5f4af..287ace8b 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Vagrant Parallels Provider +[![Gem Version](https://badge.fury.io/rb/vagrant-parallels.png)](http://badge.fury.io/rb/vagrant-parallels) [![Build Status](https://travis-ci.org/Parallels/vagrant-parallels.png?branch=master)](https://travis-ci.org/Parallels/vagrant-parallels) [![Code Climate](https://codeclimate.com/github/Parallels/vagrant-parallels.png)](https://codeclimate.com/github/Parallels/vagrant-parallels) From dd5965275462c8497564ae7b7037c22c23f12465 Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Sun, 2 Mar 2014 15:32:36 +0400 Subject: [PATCH 02/10] README.md: globally updated. --- README.md | 121 ++++++++++++++++++++++++++++++++++-------------------- 1 file changed, 76 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 287ace8b..f045bd40 100644 --- a/README.md +++ b/README.md @@ -3,25 +3,39 @@ [![Build Status](https://travis-ci.org/Parallels/vagrant-parallels.png?branch=master)](https://travis-ci.org/Parallels/vagrant-parallels) [![Code Climate](https://codeclimate.com/github/Parallels/vagrant-parallels.png)](https://codeclimate.com/github/Parallels/vagrant-parallels) -This is a [Vagrant](http://www.vagrantup.com) 1.3+ plugin that adds a [Parallels Desktop](http://www.parallels.com/products/desktop/) -provider to Vagrant, allowing Vagrant to control and provision machines using Parallels Desktop instead of the default Virtualbox. +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/). -## Note +### Requirements +- Parallels Desktop for Mac 8 or 9 +- Vagrant v1.4 or higher -This project is still in active development and not all vagrant features have been developed, so please report any issues you might find. -Almost all features are available except for exporting/packaging VM's. This will be available soon. +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. -We look forward to hearing from you with any issues or features. Thank you! +## Features +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. ## Installation -The latest version of this provider is supporting **only Vagrant 1.4 or higher**. -If you are still using Vagrant 1.3.*, please, specify the plugin version '0.0.9': +First of all 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. -- For Vagrant 1.4 or higher execute `vagrant plugin install vagrant-parallels`. -- For Vagrant 1.3.x execute `vagrant plugin install vagrant-parallels --plugin-version 0.0.9`. +Since Parallels provider is a Vagrant plugin, installing is so easy: + +``` +$ vagrant plugin install vagrant-parallels +``` ## Usage -After installing, then do a `vagrant up` and specify the `parallels` provider. An example is shown below. +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 +providers. + +The value to use for the `--provider` flag is `parallels`: ``` $ vagrant init @@ -29,43 +43,47 @@ $ 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 coming section for instructions. +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. ### Default Provider -When using parallels as your vagrant provider after almost every command you will need to append `--provider=parallels`. To simplify this you can set your default vagrant provider as **parallels** - -If you're using BASH +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. ``` -# Append to bash -echo "export VAGRANT_DEFAULT_PROVIDER=parallels" | tee -a ~/.bashrc -source ~/.bashrc +export VAGRANT_DEFAULT_PROVIDER=parallels ``` -If you're using ZSH +You can also add this command to your `~/.bashrc` file +(or `~/.zshrc` if your shell is Zsh) to make this setting permanent. -``` -# Append to zsh -echo "export VAGRANT_DEFAULT_PROVIDER=parallels" | tee -a ~/.zshrc -source ~/.zshrc -``` +## Boxes + +Every provider in Vagrant must introduce a custom box format. -## Box Format +As with every provider, Parallels provider has a custom box format. +There is a list of popular base boxes for Parallels provider: -Every provider in Vagrant must introduce a custom box format. This -provider introduces `parallels` boxes. You can download one using this [link](http://download.parallels.com/desktop/vagrant/precise64.box). +- Ubuntu 12.04 x86_64: +[http://download.parallels.com/desktop/vagrant/precise64.box] +(http://download.parallels.com/desktop/vagrant/precise64.box) -Download the box file, then use vagrant to add the downloaded box using this command. Remember to use `bundle exec` before `vagrant` command if you are in development mode +- Ubuntu 13.10 x86_64: +[http://download.parallels.com/desktop/vagrant/saucy64.box] +(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) + +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 ``` -The box format is basically just the required `metadata.json` file -along with a `Vagrantfile` that does default settings for the -provider-specific configuration for this provider. - ## Networking By default Vagrant Parallels provider uses the basic Vagrant networking approach. Initially VM has one adapter assigned to the 'Shared' network @@ -115,7 +133,7 @@ end ## Development -To work on the `vagrant-parallels` plugin, clone this repository out +To work on the `vagrant-parallels` plugin development, clone this repository: ``` $ git clone https://github.com/Parallels/vagrant-parallels @@ -136,14 +154,14 @@ $ 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 -creating a `Vagrantfile` in the top level of this directory (it is gitignored) +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" ``` -You need to have a compatible box file installed, refer to box file section +You need to have a compatible box file installed, refer to the *Boxes* section Use bundler to execute Vagrant: @@ -151,29 +169,42 @@ Use bundler to execute Vagrant: $ bundle exec vagrant up --provider=parallels ``` -After testing you can also build a gem-package by yourself and then install it as a plugin: -(if you have 'vagrant-parallels' plugin already installed, delete it first) +###Installing Parallels Provider From Source + +If you want to globally install your locally built plugin from source, use the following method: ``` -$ git clone https://github.com/Parallels/vagrant-parallels $ cd vagrant-parallels -$ rake build +$ bundle install ... -$ vagrant plugin install ./pkg/vagrant-parallels-.gem +$ 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 `vagrant plugin list` +So, now that you have your own plugin installed, check it with the command +`vagrant plugin list` + +## Contributing + +1. Fork it. +2. Create a branch (`git checkout -b my-new-feature`) +3. Commit your changes (`git commit -am "Added a sweet feature"`) +4. Push to the branch (`git push origin my-new-feature`) +5. Create a pull request from your `my-new-feature` branch into master + -## Contributors +## Credits +Great thanks to *Youssef Shahin* `@yshahin` for having initiated the development +of this provider. You've made a great job, Youssef! -A great thanks to the people who helping this project stand on its feet, thank you +Also, thanks to the people who helping this project stand on its feet, thank you -* Youssef Shahin `@yshahin` - plugin's author * Mikhail Zholobov `@legal90` * Kevin Kaland `@wizonesolutions` * Konstantin Nazarov `@racktear` * Dmytro Vasylenko `@odi-um` * Thomas Koschate `@koschate` -and to all the people who are using and testing this provider +and to all the people who are using and testing this provider. From 53065e98271d5d09fcf2f28ea3402543eaa20ff5 Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Sun, 2 Mar 2014 12:59:10 +0400 Subject: [PATCH 03/10] action/network refactoring. Deprecated 'bound_to' argument --- lib/vagrant-parallels/action/network.rb | 18 ++++++------- lib/vagrant-parallels/driver/pd_8.rb | 27 +++++++++---------- lib/vagrant-parallels/driver/pd_9.rb | 27 +++++++++---------- .../unit/support/shared/pd_driver_examples.rb | 22 +++++++-------- 4 files changed, 42 insertions(+), 52 deletions(-) diff --git a/lib/vagrant-parallels/action/network.rb b/lib/vagrant-parallels/action/network.rb index 34ba910d..90164559 100644 --- a/lib/vagrant-parallels/action/network.rb +++ b/lib/vagrant-parallels/action/network.rb @@ -153,9 +153,9 @@ def bridged_adapter(config) # Search for a matching bridged interface bridgedifs.each do |interface| - if [interface[:name].downcase, interface[:bound_to]].include? config[:bridge].downcase + if interface[:name].downcase == config[:bridge].downcase @logger.debug("Specific bridge found as configured in the Vagrantfile. Using it.") - chosen_bridge = interface + chosen_bridge = interface[:name] break end end @@ -174,7 +174,7 @@ def bridged_adapter(config) if !chosen_bridge if bridgedifs.length == 1 # One bridgable interface? Just use it. - chosen_bridge = bridgedifs[0] + chosen_bridge = bridgedifs[0][:name] @logger.debug("Only one bridged interface available. Using it by default.") else # More than one bridgable interface requires a user decision, so @@ -196,18 +196,17 @@ def bridged_adapter(config) choice = choice.to_i end - chosen_bridge = bridgedifs[choice - 1] + chosen_bridge = bridgedifs[choice - 1][:name] end end - @logger.info("Bridging adapter #{config[:adapter]} to #{chosen_bridge[:name]} (#{chosen_bridge[:bound_to]})") + @logger.info("Bridging adapter #{config[:adapter]} to #{chosen_bridge}") # Given the choice we can now define the adapter we're using return { :adapter => config[:adapter], :type => :bridged, - :bridge => chosen_bridge[:name], - :bound_to => chosen_bridge[:bound_to], + :bridge => chosen_bridge, :mac_address => config[:mac], :nic_type => config[:nic_type] } @@ -321,7 +320,6 @@ def hostonly_adapter(config) return { :adapter => config[:adapter], :hostonly => interface[:name], - :bound_to => interface[:bound_to], :mac => config[:mac], :nic_type => config[:nic_type], :type => :hostonly @@ -392,7 +390,7 @@ def assign_interface_numbers(networks, adapters) end # This determines the next free network name - def next_network_name + def next_network_id # Get the list of numbers net_nums = [] @env[:machine].provider.driver.read_virtual_networks.each do |net| @@ -416,7 +414,7 @@ def next_network_name # This creates a host only network for the given configuration. def hostonly_create_network(config) options = { - :name => next_network_name, + :network_id => next_network_id, :adapter_ip => config[:adapter_ip], :netmask => config[:netmask], } diff --git a/lib/vagrant-parallels/driver/pd_8.rb b/lib/vagrant-parallels/driver/pd_8.rb index 30eef64d..181f3675 100644 --- a/lib/vagrant-parallels/driver/pd_8.rb +++ b/lib/vagrant-parallels/driver/pd_8.rb @@ -41,7 +41,7 @@ def clear_shared_folders def create_host_only_network(options) # Create the interface - execute(:prlsrvctl, "net", "add", options[:name], "--type", "host-only") + execute(:prlsrvctl, "net", "add", options[:network_id], "--type", "host-only") # Configure it args = ["--ip", "#{options[:adapter_ip]}/#{options[:netmask]}"] @@ -51,16 +51,15 @@ def create_host_only_network(options) "--ip-scope-end", options[:dhcp][:upper]]) end - execute(:prlsrvctl, "net", "set", options[:name], *args) + execute(:prlsrvctl, "net", "set", options[:network_id], *args) # Determine interface to which it has been bound - net_info = json { execute(:prlsrvctl, 'net', 'info', options[:name], '--json', retryable: true) } - bound_to = net_info['Bound To'] + net_info = json { execute(:prlsrvctl, 'net', 'info', options[:network_id], '--json', retryable: true) } + iface_name = net_info['Bound To'] # Return the details return { - :name => options[:name], - :bound_to => bound_to, + :name => iface_name, :ip => options[:adapter_ip], :netmask => options[:netmask], :dhcp => options[:dhcp] @@ -123,15 +122,15 @@ def enable_adapters(adapters) args.concat(["--device-add", "net"]) end - if adapter[:hostonly] or adapter[:bridge] + if adapter[:type] == :hostonly # Oddly enough, but there is a 'bridge' anyway. # The only difference is the destination interface: # - in host-only (private) network it will be bridged to the 'vnicX' device # - in real bridge (public) network it will be bridged to the assigned device - args.concat(["--type", "bridged", "--iface", adapter[:bound_to]]) - end - - if adapter[:type] == :shared + args.concat(["--type", "bridged", "--iface", adapter[:hostonly]]) + elsif adapter[:type] == :bridge + args.concat(["--type", "bridged", "--iface", adapter[:bridge]]) + elsif adapter[:type] == :shared args.concat(["--type", "shared"]) end @@ -199,8 +198,7 @@ def read_bridged_interfaces info = {} ifconfig = execute(:ifconfig, iface['Bound To']) # Assign default values - info[:name] = iface['Network ID'].gsub(/\s\(.*?\)$/, '') - info[:bound_to] = iface['Bound To'] + info[:name] = iface['Bound To'] info[:ip] = "0.0.0.0" info[:netmask] = "0.0.0.0" info[:status] = "Down" @@ -235,8 +233,7 @@ def read_host_only_interfaces info = {} net_info = json { execute(:prlsrvctl, 'net', 'info', iface['Network ID'], '--json') } # Really we need to work with bounded virtual interface - info[:name] = net_info['Network ID'] - info[:bound_to] = net_info['Bound To'] + info[:name] = net_info['Bound To'] info[:ip] = net_info['Parallels adapter']['IP address'] info[:netmask] = net_info['Parallels adapter']['Subnet mask'] # Such interfaces are always in 'Up' diff --git a/lib/vagrant-parallels/driver/pd_9.rb b/lib/vagrant-parallels/driver/pd_9.rb index ee24a904..e7176d56 100644 --- a/lib/vagrant-parallels/driver/pd_9.rb +++ b/lib/vagrant-parallels/driver/pd_9.rb @@ -41,7 +41,7 @@ def clear_shared_folders def create_host_only_network(options) # Create the interface - execute(:prlsrvctl, "net", "add", options[:name], "--type", "host-only") + execute(:prlsrvctl, "net", "add", options[:network_id], "--type", "host-only") # Configure it args = ["--ip", "#{options[:adapter_ip]}/#{options[:netmask]}"] @@ -51,16 +51,15 @@ def create_host_only_network(options) "--ip-scope-end", options[:dhcp][:upper]]) end - execute(:prlsrvctl, "net", "set", options[:name], *args) + execute(:prlsrvctl, "net", "set", options[:network_id], *args) # Determine interface to which it has been bound - net_info = json { execute(:prlsrvctl, 'net', 'info', options[:name], '--json', retryable: true) } - bound_to = net_info['Bound To'] + net_info = json { execute(:prlsrvctl, 'net', 'info', options[:network_id], '--json', retryable: true) } + iface_name = net_info['Bound To'] # Return the details return { - :name => options[:name], - :bound_to => bound_to, + :name => iface_name, :ip => options[:adapter_ip], :netmask => options[:netmask], :dhcp => options[:dhcp] @@ -123,15 +122,15 @@ def enable_adapters(adapters) args.concat(["--device-add", "net"]) end - if adapter[:hostonly] or adapter[:bridge] + if adapter[:type] == :hostonly # Oddly enough, but there is a 'bridge' anyway. # The only difference is the destination interface: # - in host-only (private) network it will be bridged to the 'vnicX' device # - in real bridge (public) network it will be bridged to the assigned device - args.concat(["--type", "bridged", "--iface", adapter[:bound_to]]) - end - - if adapter[:type] == :shared + args.concat(["--type", "bridged", "--iface", adapter[:hostonly]]) + elsif adapter[:type] == :bridge + args.concat(["--type", "bridged", "--iface", adapter[:bridge]]) + elsif adapter[:type] == :shared args.concat(["--type", "shared"]) end @@ -199,8 +198,7 @@ def read_bridged_interfaces info = {} ifconfig = execute(:ifconfig, iface['Bound To']) # Assign default values - info[:name] = iface['Network ID'].gsub(/\s\(.*?\)$/, '') - info[:bound_to] = iface['Bound To'] + info[:name] = iface['Bound To'] info[:ip] = "0.0.0.0" info[:netmask] = "0.0.0.0" info[:status] = "Down" @@ -235,8 +233,7 @@ def read_host_only_interfaces info = {} net_info = json { execute(:prlsrvctl, 'net', 'info', iface['Network ID'], '--json') } # Really we need to work with bounded virtual interface - info[:name] = net_info['Network ID'] - info[:bound_to] = net_info['Bound To'] + info[:name] = net_info['Bound To'] info[:ip] = net_info['Parallels adapter']['IP address'] info[:netmask] = net_info['Parallels adapter']['Subnet mask'] # Such interfaces are always in 'Up' diff --git a/test/unit/support/shared/pd_driver_examples.rb b/test/unit/support/shared/pd_driver_examples.rb index 16d13058..7fe02972 100644 --- a/test/unit/support/shared/pd_driver_examples.rb +++ b/test/unit/support/shared/pd_driver_examples.rb @@ -34,7 +34,7 @@ let(:hostonly_iface) {'vnic12'} it "creates host-only NIC with dhcp server configured" do vnic_opts = { - :name => 'vagrant_vnic8', + :network_id => 'vagrant_vnic8', :adapter_ip => '11.11.11.11', :netmask => '255.255.252.0', :dhcp => { @@ -45,12 +45,12 @@ } subprocess.should_receive(:execute). - with("prlsrvctl", "net", "add", vnic_opts[:name], + with("prlsrvctl", "net", "add", vnic_opts[:network_id], "--type", "host-only", an_instance_of(Hash)). and_return(subprocess_result(exit_code: 0)) subprocess.should_receive(:execute). - with("prlsrvctl", "net", "set", vnic_opts[:name], + with("prlsrvctl", "net", "set", vnic_opts[:network_id], "--ip", "#{vnic_opts[:adapter_ip]}/#{vnic_opts[:netmask]}", "--dhcp-ip", vnic_opts[:dhcp][:ip], "--ip-scope-start", vnic_opts[:dhcp][:lower], @@ -59,40 +59,38 @@ interface = subject.create_host_only_network(vnic_opts) - interface.should include(:name => vnic_opts[:name]) interface.should include(:ip => vnic_opts[:adapter_ip]) interface.should include(:netmask => vnic_opts[:netmask]) interface.should include(:dhcp => vnic_opts[:dhcp]) - interface.should include(:bound_to => hostonly_iface) - interface[:bound_to].should =~ /^(vnic(\d+))$/ + interface.should include(:name => hostonly_iface) + interface[:name].should =~ /^(vnic(\d+))$/ end it "creates host-only NIC without dhcp" do vnic_options = { - :name => 'vagrant_vnic3', + :network_id => 'vagrant_vnic3', :adapter_ip => '22.22.22.22', :netmask => '255.255.254.0', } subprocess.should_receive(:execute). - with("prlsrvctl", "net", "add", vnic_options[:name], + with("prlsrvctl", "net", "add", vnic_options[:network_id], "--type", "host-only", an_instance_of(Hash)). and_return(subprocess_result(exit_code: 0)) subprocess.should_receive(:execute). - with("prlsrvctl", "net", "set", vnic_options[:name], + with("prlsrvctl", "net", "set", vnic_options[:network_id], "--ip", "#{vnic_options[:adapter_ip]}/#{vnic_options[:netmask]}", an_instance_of(Hash)). and_return(subprocess_result(exit_code: 0)) interface = subject.create_host_only_network(vnic_options) - interface.should include(:name => vnic_options[:name]) interface.should include(:ip => vnic_options[:adapter_ip]) interface.should include(:netmask => vnic_options[:netmask]) interface.should include(:dhcp => nil) - interface.should include(:bound_to => hostonly_iface) - interface[:bound_to].should =~ /^(vnic(\d+))$/ + interface.should include(:name => hostonly_iface) + interface[:name].should =~ /^(vnic(\d+))$/ end end From 3009419ef24195cb8b7d5c2d3c1c49e3155728ef Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Tue, 4 Mar 2014 15:50:26 +0400 Subject: [PATCH 04/10] README.md: 'Getting help' section added --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f045bd40..bc5544c7 100644 --- a/README.md +++ b/README.md @@ -140,7 +140,7 @@ $ git clone https://github.com/Parallels/vagrant-parallels $ cd vagrant-parallels ``` -Use [Bundler](http://gembundler.com) to get the dependencies: +Use [Bundler](http://gembundler.com) to get the dependencies (Ruby 2.0 is needed): ``` $ bundle @@ -193,6 +193,12 @@ So, now that you have your own plugin installed, check it with the command 4. Push to the branch (`git push origin my-new-feature`) 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: +[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 [IssueTracker](https://github.com/Parallels/vagrant-parallels). ## Credits Great thanks to *Youssef Shahin* `@yshahin` for having initiated the development From 11d9f4acb7e6d4e0d7540ad86f34ff8231c0ecdd Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Wed, 5 Mar 2014 18:19:27 +0400 Subject: [PATCH 05/10] README.md: Fixed mistakes --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index bc5544c7..0a8206b9 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ First of all make sure that you have [Parallels Desktop for Mac](http://www.para 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 so easy: +Since Parallels provider is a Vagrant plugin, installing is easy: ``` $ vagrant plugin install vagrant-parallels @@ -198,11 +198,11 @@ Having problems while using our 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 [IssueTracker](https://github.com/Parallels/vagrant-parallels). +there - please, report it on [Issue Tracker](https://github.com/Parallels/vagrant-parallels). ## Credits Great thanks to *Youssef Shahin* `@yshahin` for having initiated the development -of this provider. You've made a great job, Youssef! +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 From 141f5fd02fef768b968cad91a9158d7878acb8e9 Mon Sep 17 00:00:00 2001 From: racktear Date: Thu, 6 Mar 2014 00:31:50 +0400 Subject: [PATCH 06/10] Fix centos 6.5 box file name and add centos 5.9 box --- README.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0a8206b9..48f1da99 100644 --- a/README.md +++ b/README.md @@ -75,8 +75,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/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] +(http://download.parallels.com/desktop/vagrant/CentOS-5.9-x86_64.box) + You can add one of these boxes using the next command: From 9d39a1481624f51993fc800f63814ff2abf1fa61 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Thu, 6 Mar 2014 21:12:20 +0100 Subject: [PATCH 07/10] update i18n-tasks to 0.3.9 --- Rakefile | 3 --- vagrant-parallels.gemspec | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index eebfa718..a23801c8 100644 --- a/Rakefile +++ b/Rakefile @@ -4,9 +4,6 @@ require 'rubygems' require 'bundler/setup' require 'rspec/core/rake_task' -#Load i18-tasks -load 'tasks/i18n-tasks.rake' - # Immediately sync all stdout so that tools like buildbot can # immediately load in the output. $stdout.sync = true diff --git a/vagrant-parallels.gemspec b/vagrant-parallels.gemspec index 6cb4cf52..95c8d084 100644 --- a/vagrant-parallels.gemspec +++ b/vagrant-parallels.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency "bundler", "~> 1.5.2" spec.add_development_dependency "rake" spec.add_development_dependency "rspec", "~> 2.14.0" - spec.add_development_dependency "i18n-tasks", "~> 0.2.21" + spec.add_development_dependency "i18n-tasks", "~> 0.3.9" # The following block of code determines the files that should be included # in the gem. It does this by reading all the files in the directory where From b9a2399e148be7660c51501da2015e31b96914cb Mon Sep 17 00:00:00 2001 From: racktear Date: Fri, 7 Mar 2014 00:33:12 +0400 Subject: [PATCH 08/10] Use 'shell_expand_guest_path' guest capability to expand "~/" in shared folder mounts This was copied from the official NFS mount capability --- .../linux/mount_parallels_shared_folder.rb | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb b/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb index 0479467f..9f7cc963 100644 --- a/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb +++ b/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb @@ -4,25 +4,29 @@ module GuestLinuxCap class MountParallelsSharedFolder def self.mount_parallels_shared_folder(machine, name, guestpath, options) + # Expand the guest path so we can handle things like "~/vagrant" + expanded_guest_path = machine.guest.capability( + :shell_expand_guest_path, guestpath) + machine.communicate.tap do |comm| # clear prior symlink - if comm.test("test -L \"#{guestpath}\"", :sudo => true) - comm.sudo("rm \"#{guestpath}\"") + if comm.test("test -L \"#{expanded_guest_path}\"", :sudo => true) + comm.sudo("rm \"#{expanded_guest_path}\"") end # clear prior directory if exists - if comm.test("test -d \"#{guestpath}\"", :sudo => true) - comm.sudo("rm -Rf \"#{guestpath}\"") + if comm.test("test -d \"#{expanded_guest_path}\"", :sudo => true) + comm.sudo("rm -Rf \"#{expanded_guest_path}\"") end # create intermediate directories if needed - intermediate_dir = File.dirname(guestpath) + intermediate_dir = File.dirname(expanded_guest_path) if !comm.test("test -d \"#{intermediate_dir}\"", :sudo => true) comm.sudo("mkdir -p \"#{intermediate_dir}\"") end # finally make the symlink - comm.sudo("ln -s \"/media/psf/#{name}\" \"#{guestpath}\"") + comm.sudo("ln -s \"/media/psf/#{name}\" \"#{expanded_guest_path}\"") end end end From 86ef7d7224b8639fb600d89706f92bad58992e28 Mon Sep 17 00:00:00 2001 From: racktear Date: Fri, 7 Mar 2014 00:38:38 +0400 Subject: [PATCH 09/10] Emit event for Upstart configs when shared folders are mounted This was copied from NFS and Virtualbox implementation. We try to send a special 'vagrant-mounted' event to upstart so that services that specially subscribe to it can do a 'reload' For instance, if nginx to start serving content of a freshly mounted directory, it needs to be 'pinged'. --- .../guest_cap/linux/mount_parallels_shared_folder.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb b/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb index 9f7cc963..84cf30be 100644 --- a/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb +++ b/lib/vagrant-parallels/guest_cap/linux/mount_parallels_shared_folder.rb @@ -27,6 +27,12 @@ def self.mount_parallels_shared_folder(machine, name, guestpath, options) # finally make the symlink comm.sudo("ln -s \"/media/psf/#{name}\" \"#{expanded_guest_path}\"") + + # Emit an upstart event if we can + if comm.test("test -x /sbin/initctl") + comm.sudo( + "/sbin/initctl emit --no-wait vagrant-mounted MOUNTPOINT=#{expanded_guest_path}") + end end end end From c023644bb75ba5571fb15fbb081ae7b405f035be Mon Sep 17 00:00:00 2001 From: Mikhail Zholobov Date: Fri, 7 Mar 2014 01:23:42 +0400 Subject: [PATCH 10/10] Version bumped to 0.2.2 --- 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 ae1917f2..2aedf734 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.rc1" + VERSION = "0.2.2" end end