How to inject shell commands before Vagrant is mounting shared folders

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to inject shell commands before Vagrant is mounting shared folders

Vitaly
In my guest machine (Ubuntu 14.04) I need to add certain things into Linux boot sequence in order to mount Virtualbox  "vagrat" shared folder.
Obviously, it doesn't work  during VM  1st start, and "vagrant up" fails with "error: Vagrant was unable to mount VirtualBox shared folders."
"vagrant reload"  after that works fine.
How I can run certain shell commands in guest  *before* Vargant is trying to mount share folder for mounting it on the 1st boot?

TIA,
Vitaly

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to inject shell commands before Vagrant is mounting shared folders

Alvaro Miranda Aguilera
Hello

You can't.

Those need to be part of the base box if you want to use the share folder.

the best is to fix the box and create a new base box, or just create a fixed box.

in vagrant you can export a box with vagrant package,

with packer.io you can create a new Vagrant box.

alvaro.

On Wed, Nov 1, 2017 at 2:13 PM, Vitaly <[hidden email]> wrote:
In my guest machine (Ubuntu 14.04) I need to add certain things into Linux boot sequence in order to mount Virtualbox  "vagrat" shared folder.
Obviously, it doesn't work  during VM  1st start, and "vagrant up" fails with "error: Vagrant was unable to mount VirtualBox shared folders."
"vagrant reload"  after that works fine.
How I can run certain shell commands in guest  *before* Vargant is trying to mount share folder for mounting it on the 1st boot?

TIA,
Vitaly

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ey%2Bn68F%3DB9dV8Vbsy4NBeFo5EQiF3JiDDNLAmHrHAB5iQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to inject shell commands before Vagrant is mounting shared folders

Vitaly
Alvaro, thank you!

I'll try to explain my working flow.
I'm building my Vagrantfile for using with Chef-Test-Kitchen.
It's based on pre-packaged box image with Virtualbox tools installed.
I'm using vagrant-vbguest plugin.
I prefer to use "config.vbguest.auto_update = false" in order to launch new test instance fast. 
For some reason with "config.vbguest.auto_update = false" my guest machine faults to mount shared folder.
Workaround I found it's adding "vboxsf" into /etc/modules and mounting "/vagrant" into /etc/rc.local; and this workaround works great but not on the 1st boot.

Long story short - I want launch my Linux VM with "/vagrant" folder without wasting time for upgrading Virtualbox guest tools for each new guest.
I don't want to rebuild my .box image every time when Oracle releases new Virtualbox version.


On Wednesday, November 1, 2017 at 3:22:02 PM UTC+2, Alvaro Miranda Aguilera wrote:
Hello

You can't.

Those need to be part of the base box if you want to use the share folder.

the best is to fix the box and create a new base box, or just create a fixed box.

in vagrant you can export a box with vagrant package,

with <a href="http://packer.io" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpacker.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9z5BjHlcVSOqvLDYevZFfvBY5dQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpacker.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9z5BjHlcVSOqvLDYevZFfvBY5dQ&#39;;return true;">packer.io you can create a new Vagrant box.

alvaro.

On Wed, Nov 1, 2017 at 2:13 PM, Vitaly <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="-cKksF4jBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vitaly....@...> wrote:
In my guest machine (Ubuntu 14.04) I need to add certain things into Linux boot sequence in order to mount Virtualbox  "vagrat" shared folder.
Obviously, it doesn't work  during VM  1st start, and "vagrant up" fails with "error: Vagrant was unable to mount VirtualBox shared folders."
"vagrant reload"  after that works fine.
How I can run certain shell commands in guest  *before* Vargant is trying to mount share folder for mounting it on the 1st boot?

TIA,
Vitaly

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="-cKksF4jBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/915ca8f7-75d9-4a8e-8008-7165ed8546ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to inject shell commands before Vagrant is mounting shared folders

Alvaro Miranda Aguilera
hello

you don't need to upgrade virtualbox tools on new versions. they are backward compatible.

Create a new box using that base box.

add config.ssh.insert_key=false

make it boot
vagrant ssh

fix what need to fixed

do vagrant halt

review vagrant package

and create a new base box with the fix.

That will be the quickest way.

Or just use a box that works from vagrant up.

Alvaro.

On Wed, Nov 1, 2017 at 2:53 PM, Vitaly <[hidden email]> wrote:
Alvaro, thank you!

I'll try to explain my working flow.
I'm building my Vagrantfile for using with Chef-Test-Kitchen.
It's based on pre-packaged box image with Virtualbox tools installed.
I'm using vagrant-vbguest plugin.
I prefer to use "config.vbguest.auto_update = false" in order to launch new test instance fast. 
For some reason with "config.vbguest.auto_update = false" my guest machine faults to mount shared folder.
Workaround I found it's adding "vboxsf" into /etc/modules and mounting "/vagrant" into /etc/rc.local; and this workaround works great but not on the 1st boot.

Long story short - I want launch my Linux VM with "/vagrant" folder without wasting time for upgrading Virtualbox guest tools for each new guest.
I don't want to rebuild my .box image every time when Oracle releases new Virtualbox version.


On Wednesday, November 1, 2017 at 3:22:02 PM UTC+2, Alvaro Miranda Aguilera wrote:
Hello

You can't.

Those need to be part of the base box if you want to use the share folder.

the best is to fix the box and create a new base box, or just create a fixed box.

in vagrant you can export a box with vagrant package,

with packer.io you can create a new Vagrant box.

alvaro.

On Wed, Nov 1, 2017 at 2:13 PM, Vitaly <[hidden email]> wrote:
In my guest machine (Ubuntu 14.04) I need to add certain things into Linux boot sequence in order to mount Virtualbox  "vagrat" shared folder.
Obviously, it doesn't work  during VM  1st start, and "vagrant up" fails with "error: Vagrant was unable to mount VirtualBox shared folders."
"vagrant reload"  after that works fine.
How I can run certain shell commands in guest  *before* Vargant is trying to mount share folder for mounting it on the 1st boot?

TIA,
Vitaly

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/915ca8f7-75d9-4a8e-8008-7165ed8546ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0ez153ZSD_BQcM9AdcvV-V06XF_qvFxoWLncwWRekcs1sQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to inject shell commands before Vagrant is mounting shared folders

Vitaly
Alvaro, many thanks  (and shame on me!).
For some stupid reason I was sure that problem is Vagrant-specific and missed out the trivial point - that my original box had broken virtualbox toools setup.
After I re-imaged my box with working virtualbox everything work!

On Wednesday, November 1, 2017 at 4:00:32 PM UTC+2, Alvaro Miranda Aguilera wrote:
hello

you don't need to upgrade virtualbox tools on new versions. they are backward compatible.

Create a new box using that base box.

add config.ssh.insert_key=false

make it boot
vagrant ssh

fix what need to fixed

do vagrant halt

review vagrant package

and create a new base box with the fix.

That will be the quickest way.

Or just use a box that works from vagrant up.

Alvaro.

On Wed, Nov 1, 2017 at 2:53 PM, Vitaly <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="QFgpn3glBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vitaly....@...> wrote:
Alvaro, thank you!

I'll try to explain my working flow.
I'm building my Vagrantfile for using with Chef-Test-Kitchen.
It's based on pre-packaged box image with Virtualbox tools installed.
I'm using vagrant-vbguest plugin.
I prefer to use "config.vbguest.auto_update = false" in order to launch new test instance fast. 
For some reason with "config.vbguest.auto_update = false" my guest machine faults to mount shared folder.
Workaround I found it's adding "vboxsf" into /etc/modules and mounting "/vagrant" into /etc/rc.local; and this workaround works great but not on the 1st boot.

Long story short - I want launch my Linux VM with "/vagrant" folder without wasting time for upgrading Virtualbox guest tools for each new guest.
I don't want to rebuild my .box image every time when Oracle releases new Virtualbox version.


On Wednesday, November 1, 2017 at 3:22:02 PM UTC+2, Alvaro Miranda Aguilera wrote:
Hello

You can't.

Those need to be part of the base box if you want to use the share folder.

the best is to fix the box and create a new base box, or just create a fixed box.

in vagrant you can export a box with vagrant package,

with <a href="http://packer.io" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpacker.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9z5BjHlcVSOqvLDYevZFfvBY5dQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fpacker.io\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNF9z5BjHlcVSOqvLDYevZFfvBY5dQ&#39;;return true;">packer.io you can create a new Vagrant box.

alvaro.

On Wed, Nov 1, 2017 at 2:13 PM, Vitaly <[hidden email]> wrote:
In my guest machine (Ubuntu 14.04) I need to add certain things into Linux boot sequence in order to mount Virtualbox  "vagrat" shared folder.
Obviously, it doesn't work  during VM  1st start, and "vagrant up" fails with "error: Vagrant was unable to mount VirtualBox shared folders."
"vagrant reload"  after that works fine.
How I can run certain shell commands in guest  *before* Vargant is trying to mount share folder for mounting it on the 1st boot?

TIA,
Vitaly

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - <a href="https://www.hashicorp.com/community-guidelines.html" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fwww.hashicorp.com%2Fcommunity-guidelines.html\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGHa_CaKfZaJiwbkUndUQbVGlQCDw&#39;;return true;">https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: <a href="https://github.com/mitchellh/vagrant/issues" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fgithub.com%2Fmitchellh%2Fvagrant%2Fissues\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHxcA5DuHlQlPInMi_k1Pz4pMNqNw&#39;;return true;">https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="QFgpn3glBwAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vagrant-up+...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/vagrant-up/915ca8f7-75d9-4a8e-8008-7165ed8546ae%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/915ca8f7-75d9-4a8e-8008-7165ed8546ae%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/vagrant-up/915ca8f7-75d9-4a8e-8008-7165ed8546ae%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/vagrant-up/915ca8f7-75d9-4a8e-8008-7165ed8546ae%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/4e43749c-d3ce-4e90-ae1c-0bb13844a1fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: How to inject shell commands before Vagrant is mounting shared folders

Alvaro Miranda Aguilera
not a problem!

happy to help

Alvaro

On Wed, Nov 1, 2017 at 5:40 PM, Vitaly <[hidden email]> wrote:
Alvaro, many thanks  (and shame on me!).
For some stupid reason I was sure that problem is Vagrant-specific and missed out the trivial point - that my original box had broken virtualbox toools setup.
After I re-imaged my box with working virtualbox everything work!

On Wednesday, November 1, 2017 at 4:00:32 PM UTC+2, Alvaro Miranda Aguilera wrote:
hello

you don't need to upgrade virtualbox tools on new versions. they are backward compatible.

Create a new box using that base box.

add config.ssh.insert_key=false

make it boot
vagrant ssh

fix what need to fixed

do vagrant halt

review vagrant package

and create a new base box with the fix.

That will be the quickest way.

Or just use a box that works from vagrant up.

Alvaro.

On Wed, Nov 1, 2017 at 2:53 PM, Vitaly <[hidden email]> wrote:
Alvaro, thank you!

I'll try to explain my working flow.
I'm building my Vagrantfile for using with Chef-Test-Kitchen.
It's based on pre-packaged box image with Virtualbox tools installed.
I'm using vagrant-vbguest plugin.
I prefer to use "config.vbguest.auto_update = false" in order to launch new test instance fast. 
For some reason with "config.vbguest.auto_update = false" my guest machine faults to mount shared folder.
Workaround I found it's adding "vboxsf" into /etc/modules and mounting "/vagrant" into /etc/rc.local; and this workaround works great but not on the 1st boot.

Long story short - I want launch my Linux VM with "/vagrant" folder without wasting time for upgrading Virtualbox guest tools for each new guest.
I don't want to rebuild my .box image every time when Oracle releases new Virtualbox version.


On Wednesday, November 1, 2017 at 3:22:02 PM UTC+2, Alvaro Miranda Aguilera wrote:
Hello

You can't.

Those need to be part of the base box if you want to use the share folder.

the best is to fix the box and create a new base box, or just create a fixed box.

in vagrant you can export a box with vagrant package,

with packer.io you can create a new Vagrant box.

alvaro.

On Wed, Nov 1, 2017 at 2:13 PM, Vitaly <[hidden email]> wrote:
In my guest machine (Ubuntu 14.04) I need to add certain things into Linux boot sequence in order to mount Virtualbox  "vagrat" shared folder.
Obviously, it doesn't work  during VM  1st start, and "vagrant up" fails with "error: Vagrant was unable to mount VirtualBox shared folders."
"vagrant reload"  after that works fine.
How I can run certain shell commands in guest  *before* Vargant is trying to mount share folder for mounting it on the 1st boot?

TIA,
Vitaly

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email]m.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/1aac91f3-15b0-47e2-833e-b26c114a79d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/915ca8f7-75d9-4a8e-8008-7165ed8546ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/4e43749c-d3ce-4e90-ae1c-0bb13844a1fb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Alvaro

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/mitchellh/vagrant/issues
IRC: #vagrant on Freenode
---
You received this message because you are subscribed to the Google Groups "Vagrant" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/CAHqq0exLxQFrFXYiS73TRdTpOnPZZLFyoYvSepZWcV0OJs8zxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.