无法安装VAGRANT共享文件夹-Windows 7-Vagrant 1.7.4-Ubuntu 12.04 precision64-带有来宾添加功能的VirtualBox 5.0.10 [英] VAGRANT SHARED FOLDERS DO NOT MOUNT - Windows 7 - Vagrant 1.7.4 - Ubuntu 12.04 precise64 - VirtualBox 5.0.10 with Guest Additions

查看:123
本文介绍了无法安装VAGRANT共享文件夹-Windows 7-Vagrant 1.7.4-Ubuntu 12.04 precision64-带有来宾添加功能的VirtualBox 5.0.10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 gettingstartedwithdjango.com 上的旧教程.

I'm following the old tutorials off of gettingstartedwithdjango.com.

这个系列相当老,我是Django的新手,这就是为什么我首先访问该网站的原因.这是我对Vagrant的第一个介绍.由于该系列很旧,并且现在有Django,Vagrant等的新版本,我发现仅通过第一个教程很难.这主要只是Django v1.4与当前正在运行的1.9版本之间的差距,其中包括settings.py中的一些语法差异,以及文本勘误表和我必须进行分类的视频之间的差异.如果您不熟悉这一切,这是一个非常详细的练习(我是),因此这非常具有挑战性,当经过大约12个小时的艰苦努力之后,我能够使所有工作如所描述的那样时,我感到非常兴奋在视频中,但使用了所有新版本的软件.一切设置完成并正常工作后,我将Vagrant VM暂停了一整夜,第二天早晨将其重新备份(无用)时,我发现该VM将不再挂载其共享文件夹,从本质上呈现了Vagrant VM对我无用,因为这样我就无法从VM内部运行驻留在主机(我正在运行Windows 7)上的代码(这是通过VirtualBox共享文件夹功能实现的).

This series is quite old and I'm new to Django which is why I hit that site in the first place. It became my first introduction to Vagrant. Because the series is old and there are now new versions of Django, Vagrant, etc, I've found just getting through the first tutorial was quite difficult. This was mainly just the gap between Django v1.4 and the current version 1.9 which is what I'm running, including some syntax differences in settings.py and also some discrepancies between the text errata and the video which I had to sort through. It's a pretty detailed exercise if you're completely new to all of this (which I am), so it was quite challenging, and I was thrilled when after probably 12 hours of solid effort I was able to get everything working as was being described in the video but using all new versions of software. Once I got it all set up and working, I halted my Vagrant VM for the night and when I turned it back up (vagrant up) the next morning, I found that the VM would no longer mount its shared folders, essentially rendering the Vagrant VM useless to me as I'm then unable to run code which resides on the host machine (I'm running Windows 7) from within the VM (which is accomplished via the VirtualBox shared folders feature).

不知道出了什么问题,这促使我完全重新安装了Vagrant VM.我花了大约一个小时的时间就可以成功地重新部署东西,回溯到成功完成第一个教程所采取的步骤,从而回到了我开始的那个位置(在我完成之前的步骤之前).无所事事的停顿).重新安装Vagrant VM时,我注意到消息,我的VirtualBox Guest Additions(4.2.0)与我已安装的VirtualBox版本(5.0.10)不匹配,我回想起第一次看到的情况,但被忽略了,因为它也表示这是通常这是一个问题,应该可以工作(如果不是因为运气不好,我根本就不会有运气).由于对我而言它不起作用,这使我陷入了包括SO之类的各种网站的帖子的混乱局面,最终使我更新了Vagrant VM,下载/安装/构建/安装了新版本的VirtualBox Guest Additions,以及重新加载我的Vagrant VM只能在同一条船上结束.共享文件夹仍然无法使用!

Not knowing what was wrong, this prompted me to completely reinstall my Vagrant VM. I was able to get things redeployed successfully with about one hour worth of effort, backtracking through steps I had taken to successfully complete the first tutorial in the first place, in order to back to the same point where I started (before I did the previous vagrant halt). When reinstalling the Vagrant VM I noticed messages that my VirtualBox Guest Additions (4.2.0) did not match the version of VirtualBox I have installed (5.0.10), which I recalled seeing the first time but ignored because it also said this isn't usually a problem and should work (if it weren't for bad luck, I'd have no luck at all). Since for me it didn't work, this led me down a whole rabbit hole of posts from various websites including SO, which ultimately had me updating my Vagrant VM, downloading/mounting/building/installing a new version of VirtualBox Guest Additions, and reloading my Vagrant VM only to wind up in the same boat. Shared folders were still not working!

具体来说,这或多或少是我根据许多网站上的信息尝试过的:

To be very specific, this is more or less what I tried based on information from many websites:

cd /home/vagrant
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install dkms build-essential linux-headers-generic
sudo apt-get install linux-headers-3.2.0-23-generic
# mounted VBoxGuestAdditions_5.0.10.iso to Vagrant VM
cd /media/cdrom
sudo sh ./VBoxLinuxAdditions.run
sudo reboot
sudo /etc/init.d/vboxadd setup
sudo reload
c:\VAGRANT\vagrant plugin install vagrant-vbguest
c:\VAGRANT\vagrant reload

我完全确信这将解决问题,但是没有.

I was utterly convinced this was going to resolve the issue but it didn't.

推荐答案

然后我发现了这个宝石:

Then I found this gem:

http://ddelizia.blogspot.com/2011/02/how-to-share-folder-on-virtual-box-with.html

这显示了如何在Vagrant VM中将共享文件夹安装回Windows 7主机.具体来说,这是我发现事情又恢复正常的时候所做的事情:

This shows how to, from within the Vagrant VM, mount the shared folders back to your Windows 7 host. To be specific, here's what I did when I found things were working again:

cd /vagrant
ls -la
<this yielded nothing>
sudo mount.vboxsf vagrant /vagrant # see your VirtualBox Shared Folders settings
cd ~ # /home/vagrant
cd - # /vagrant
ls -la
# this yielded the expected folders from my Win7 host

在上面的mount.vboxsf命令中,第一个无业游民(不带/)来自我的VirtualBox共享文件夹设置中的名称"列.在本质上,这是一个别名,用于引用Win7主机上的实际路径,在我的情况下为:C:/VAGRANT.该命令中的第二个流浪者(带有/)是流浪者VM(Linux)上的/vagrant文​​件夹.

In the mount.vboxsf command above, the first vagrant (without the /) came from the Name column in my VirtualBox shared folders settings. This is essentially an alias which is used to refer to the actual path on the Win7 host, in my case: C:/VAGRANT. The second vagrant (with the /) in that command is the /vagrant folder on the Vagrant VM (linux).

鉴于我今天大部分时间都在处理此问题,所以我认为有很多人会遇到相同或相关的问题,我想我会尽力帮助您并节省很多时间.祝你好运.

Given that I spent most of today messing with this and I figure there are plenty of people who are going to run into this same or related problem, I thought I would try to help out and save you all a bunch of time. Good luck.

这篇关于无法安装VAGRANT共享文件夹-Windows 7-Vagrant 1.7.4-Ubuntu 12.04 precision64-带有来宾添加功能的VirtualBox 5.0.10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆