2015-06-20 37 views
3

好的,所以這裏是我的問題: 我用VirtualBox的vagrant。主機是Windows 8.1,客戶機是Ubuntu(64位)。我試圖使用由鏈接創建的鏈接的Windows文件夾在vagrant和virtualbox中安裝一個符號鏈接的文件夾

mklink /j somefolder someotherfolder 

作爲同步文件夾中的流浪漢。在我Vagrantfile我有

# disable the default synced folder 
config.vm.synced_folder ".", "/vagrant", disabled: true 
# sync my desired folder 
config.vm.synced_folder "./somefolder", "/vagrant" 

不幸的是,這並不工作,但提供了以下錯誤:

Failed to mount folders in Linux guest. This is usually because 
the "vboxsf" file system is not available. Please verify that 
the guest additions are properly installed in the guest and 
can work properly. The command attempted was: 

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 last command was: 

stdin: is not a tty 
/sbin/mount.vboxsf: mounting failed with the error: Invalid argument 

你問前:客戶附加安裝和安裝常規文件夾完美的作品。

有沒有一種方法使用符號鏈接的目錄作爲同步文件夾在流浪與vbox?

感謝您的幫助!

+0

/j創建一個連接,它與符號鏈接不同,/ d創建符號鏈接。這可能會對你的情況產生影響,我不知道。除此之外,確保someOtherFolder是一個絕對路徑,並且它在Windows資源管理器和/或cmd.exe中是可見/可訪問的,獨立於使用junction/symlink創建junction/symlink之後。 –

+0

我試過/ d和/ j。不幸的是它沒有區別。 我找到了一種方法來完成這項工作,雖然我不確定我喜歡它。當我將文件夾與SMB同步時(config.vm.synced_folder「./somefolder」,「/ vagrant」,鍵入:「smb」),似乎可以工作。流浪的文檔說,中小企業的支持仍然有點粗糙的邊緣,雖然... –

+0

謝謝,這個問題幫助我意識到符號鏈接對我來說是一個問題。切換到在原始目錄中運行'vagrant up'解決了我的問題。 (雖然我想這對你的情況沒有幫助。) – Ajedi32

回答

0

我有類似的問題。我無法讓Symlinks與流浪漢一起工作,但是Hardlink Clone做到了。我試圖讓我的Dev文件夾與Google Drive同步,但不想重新定位文件夾。

我的解決方案:硬連接克隆

  1. 下載並安裝Linkshell的Windows(與上市必備包)direct Link to actual file I downloaded | direct link to prerequisite package I downloaded]直接鏈接好於Windows XP64, 的Windows Vista64上, 的Windows Server, 2003/2008/20012 64位, 視窗10年7月8日64
  2. 源文件夾(在我的情況下,一個我複製到右鍵谷歌驅動器),然後選擇挑選鏈接源

pick link source context option

  • 在位置,你希望你的「符號鏈接」,右鍵單擊並選擇應聲而落 - >硬連接克隆
  • hardlink clone context option

    那什麼了,我得到它與流浪漢的工作。我最初試圖作爲象徵性的鏈接沒有成功。

    +0

    你在這裏描述的只是複製文件。與其結束編輯原始文件的鏈接,您會得到需要單獨維護的每個文件的完整副本。 –

    0

    將文件夾從VM中剪切到需要的位置,然後在原始位置創建交接點(或符號鏈接)。

    相關問題