Running vagrant up as admin (in Windows cmd)

39 views
Skip to first unread message

French Fry

unread,
Dec 15, 2018, 2:25:25 PM12/15/18
to Vagrant
I'm attempting to run vagrant up in a cmd window on my host (Windows).  Here is the problem I'm encountering - I have a number of network drives mapped to the host.  Windows assigns a drive letter to the drive so in Windows explorer it looks like this:

MyFolder(\\PC1)(U:)   Network Drive

In my Vagrantfile I have this line:
config.vm.synced_folder "W:/", "/vagrant/dev/officedrive", mount_options: ["dmode=777", "fmode=666"]

Which gives me a folder in vagrant/dev called officedrive.  This is all well and works without a problem except when I try to run vagrant  in host as admin.  Then I get this message:
There are errors in the configuration of this machine. Please fix
the following errors and try again:

vm:
* The host path of the shared folder is missing: U:/

Any idea when this would be a problem?

Jordan Borean

unread,
Dec 16, 2018, 4:03:21 PM12/16/18
to Vagrant
In Windows mapped drives are mapped per logon session and when you have a split token (limited vs admin), each token is in a unique logon session. This means that drives that have been mapped in a limited logon session, like in Windows explorer, will not be seen in the admin session and vice versa.

You can prove this by running ‘net use’ in a normal command prompt versus an elevated command prompt. You have a few options;

* set the EnableLinkedConnections registry property https://support.microsoft.com/en-au/help/3035277/mapped-drives-are-not-available-from-an-elevated-prompt-when-uac-is-co which shares the drives between a split token
* manually map the drive with net use before running vagrant up
* don’t use mapped drives altogether as you will probably come across another issue, especially if you start trying to run this non interactively

Thanks

Jordan

French Fry

unread,
Dec 17, 2018, 10:35:59 AM12/17/18
to vagra...@googlegroups.com
Excellent, thank you Jordan.  I'll probably go with EnableLinkedConnections.  I'm using the admin terminal just to have successful NPM installs without symlink failures.  For what I'm doing staying in admin would be just fine. 

Up till now I haven't had an issues using the mapped drives which are just being used as storage devices (i.e. non system / application).

--
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 a topic in the Google Groups "Vagrant" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vagrant-up/iTkbwHpuHT8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vagrant-up+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vagrant-up/6d0fab41-3710-4030-bf6d-6b9eb039de3d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages