Vagrant and VirtualBox use repo from Windows 10 machine

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

Vagrant and VirtualBox use repo from Windows 10 machine

Scot Schlinger
Hi All,

Somewhat new to Vagrant and VirtualBox. 

I am running Vagrant 1.8.5, VirtualBox 5.1.10 on a Windows 10 machine.  I have installed CentOS 7.x on the VM.  This is to be a sandbox for web development.  I have everything "working" but I want to take it to the next level,  When I say working, I have copied the web files and configs to the VM and can hit a web page from the VM.  Unfortunately, the files are on the VM.  I want to use the repository of code on my Windows box within the VM.  Therefore changes to the web files in Windows 10 would change the files on the VM and the web page rendering from the VM would mirror those changes.  I was using WAMP and the production environment has changed so much that WAMP is no longer the vehicle I may use.

I have tried messing with VirgualBox extension pack (https://www.virtualbox.org/wiki/Download_Old_Builds_5_1) to get synced_folder to work.  No dice.  Below is the output from "vagrant reload"

vagrant reload
==> default: Attempting graceful shutdown of VM...
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 80 (guest) => 8391 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: password
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/user/Documents/Virtual Machines/sandbox/centos7
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attemped was:

set -e
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device


Vagrant settings are simple:
config.ssh.username = "vagrant"
  config.ssh.password = "vagrant"
  config.vm.network "private_network", ip: "192.168.56.100"
  config.vm.network :forwarded_port, guest: 80, host: 8391, auto_correct: true
config.vm.synced_folder "C:/wamp/www/access_log/", "/home/www/test", create: true, owner: "nginx", group: "nginx"

Some source used:
https://www.centos.org/forums/viewtopic.php?t=47042

I appreciate your time and assistance.


--
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/4192ed7a-6826-4b5e-817d-feb1bfe8818d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: Vagrant and VirtualBox use repo from Windows 10 machine

Alvaro Miranda Aguilera
Hello

Ensure the Virtualbox Guest additions is installed.

Pre-requirements and commands are on the virtualbox documentation.

Alvaro

On Fri, May 5, 2017 at 3:24 PM, Scot Schlinger <[hidden email]> wrote:
Hi All,

Somewhat new to Vagrant and VirtualBox. 

I am running Vagrant 1.8.5, VirtualBox 5.1.10 on a Windows 10 machine.  I have installed CentOS 7.x on the VM.  This is to be a sandbox for web development.  I have everything "working" but I want to take it to the next level,  When I say working, I have copied the web files and configs to the VM and can hit a web page from the VM.  Unfortunately, the files are on the VM.  I want to use the repository of code on my Windows box within the VM.  Therefore changes to the web files in Windows 10 would change the files on the VM and the web page rendering from the VM would mirror those changes.  I was using WAMP and the production environment has changed so much that WAMP is no longer the vehicle I may use.

I have tried messing with VirgualBox extension pack (https://www.virtualbox.org/wiki/Download_Old_Builds_5_1) to get synced_folder to work.  No dice.  Below is the output from "vagrant reload"

vagrant reload
==> default: Attempting graceful shutdown of VM...
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 80 (guest) => 8391 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: password
    default: Warning: Remote connection disconnect. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
    default: No guest additions were detected on the base box for this VM! Guest
    default: additions are required for forwarded ports, shared folders, host only
    default: networking, and more. If SSH fails on this machine, please install
    default: the guest additions and repackage the box to continue.
    default:
    default: This is not an error message; everything may continue to work properly,
    default: in which case you may ignore this message.
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/Users/user/Documents/Virtual Machines/sandbox/centos7
Vagrant was unable to mount VirtualBox shared folders. This is usually
because the filesystem "vboxsf" is not available. This filesystem is
made available via the VirtualBox Guest Additions and kernel module.
Please verify that these guest additions are properly installed in the
guest. This is not a bug in Vagrant and is usually caused by a faulty
Vagrant box. For context, the command attemped was:

set -e
mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device


Vagrant settings are simple:
config.ssh.username = "vagrant"
  config.ssh.password = "vagrant"
  config.vm.network "private_network", ip: "192.168.56.100"
  config.vm.network :forwarded_port, guest: 80, host: 8391, auto_correct: true
config.vm.synced_folder "C:/wamp/www/access_log/", "/home/www/test", create: true, owner: "nginx", group: "nginx"

Some source used:
https://www.centos.org/forums/viewtopic.php?t=47042

I appreciate your time and assistance.


--
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/4192ed7a-6826-4b5e-817d-feb1bfe8818d%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/CAHqq0ezLOro%3D%3DBX612JUovJW_TL4SiJ_Uy%2BLU27KxQ%2BWpW1JsQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.