Socket
Book a DemoInstallSign in
Socket

vagrant-host-path

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vagrant-host-path

1.4.0
bundlerRubygems
Version published
Maintainers
1
Created
Source

Vagrant Host Path

This plugin creates an environment variable (VAGRANT_HOST_PATH by default) with the path to the project's root dir on your host machine. You can just replace /vagrant prefix of any file in your VM with the value of VAGRANT_HOST_PATH and you'll get the path to that same file on the host.

Installation

If you're using Vagrant with ruby's gem:

$ gem install vagrant-host-path

Or if you installed it with an installer:

$ vagrant plugin install vagrant-host-path

Usage

$ vagrant up
[default] VM already created. Booting if it's not already running...
...
[default] Host Path set!
...
$ vagrant ssh  # or any other way you connect to the VM

And after that you can use the env var within your VM:

Welcome to Ubuntu 12.04 LTS (GNU/Linux 3.2.0-23-generic-pae i686)

 * Documentation:  https://help.ubuntu.com/
Welcome to your Vagrant-built virtual machine.
Last login: Tue Feb 26 23:22:00 2013 from 10.0.2.2
vagrant@precise32:~$ echo $VAGRANT_HOST_PATH
C:/Users/MOZGIII/Desktop/vagrant-host-path/test

Configuration

Vagrant::Config.run do |config|

  if Vagrant.has_plugin?("vagrant-host-path")
    # Enable or disable plugin (enabled by default)
    config.host_path.enabled = true
    
    # The environment key to set
    config.host_path.env_key = "VAGRANT_HOST_PATH"

    # Temp file to save path to
    config.host_path.path_file = "/tmp/.vagrant-host-path"

    # Profile script path
    config.host_path.profile_path = "/etc/profile.d/vagrant-host-path.sh"
  end

end

Have in mind that both the files get overwritten on every VM start.

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 18 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.