2015-12-23 31 views
2

我試圖使用共享文件夾的機制,但是該目錄是由vagrant默認情況下,所有的效果很好安裝在遊民數據盤和tomcat6無法寫入。所以,我想我可以使用設置磁盤的主人在vagrantfile:如何安裝給用戶的目錄中不存在尚未遊民

config.vm.synced_folder "data/", "/data", owner: "tomcat6", group: "tomcat6" 

但tomcat的配方尚未運行tomcat6用戶尚不存在卻又如此顛沛流離的失敗:

現在
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 tomcat6`,gid=`getent group tomcat6 | cut -d: -f3` data /data 
mount -t vboxsf -o uid=`id -u tomcat6`,gid=`id -g tomcat6` data /data 

The error output from the last command was: 

stdin: is not a tty 
id: tomcat6: no such user 
id: tomcat6: no such user 
uid= requires an argument (i.e. uid==<arg>) 

我可以工作這一輪通過安裝與世界寫權限/數據,但似乎「錯誤的」,我(甚至在測試機上)。

那麼,有沒有辦法讓無業遊民爲我創建一個新用戶之前,我安裝盤或有廚師提供我一個共享磁盤以後呢?

回答

1

安裝的共享文件夾時,你可以讓車主vagrant和頂部更改用chown所有權添加一個短薄殼供應者。或者,tomcat配方可以注意設置正確的所有權本身。

+0

可悲的是,這並不工作 - CHOWN對安裝目錄下(即使你使用SSH的流浪漢做)沒有影響 –

+0

@iant啊確定。讓我檢查一下。恕我直言,使用nfs是解決方案,如果適用,它也更快。但是,也存在缺陷。我所看到的最大缺點是它需要在主機上進行額外的配置 - 對於沒有經驗的用戶來說這可能太難了(是的,見過這種情況)。此外,我不確定這是否適用於Windows主機。 – hek2mgl

相關問題