vagrant mac的一些坑


環境介紹:
centtos6.5
vagrant:2.0.1
VirtualBox:5.1.30

1、添加box之后,設置了共享的目錄之后,vagrant up 會出現以下的問題

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 attempted was:

mount -t vboxsf -o uid=1000,gid=1000 vagrant /vagrant

The error output from the command was:

mount: unknown filesystem type 'vboxsf'

以上的問題是因為虛擬機沒有裝VBoxGuestAdditions,(增強組件)

ubuntu系統處理方案
sudo apt-get update
sudo apt-get install virtualbox-guest-utils

centos系統處理方案(mac版)

sudo yum update
sudo yum install gcc
sudo yum install kernel-devel

exit #退出虛擬機
vagrant halt # 關閉虛擬機

把上面的東西裝成功之后,就要把增強組件的光盤掛載進來,然后執行安裝的腳本就可以了
./VBoxLinuxAdditions.run

最后再重新執行一次 vagrant up就可以了。

--------------------------------------------------------------------------------

2、mac在文件同步之后可能會遇到文件權限的問題(mac系統就是這么的煩人)
設置方法:
config.vm.synced_folder "~/www/xcar/", "/export/home/",create:true,owner:"www",group:"www"
* 如果要是這么設置,那么在虛擬機中就一定要有這個用戶和用戶組(沒有就去建立)
groupadd www,adduser www -g www

3、不能ssh登錄的問題
首先檢查防火牆是否關閉,
看selinux的詳細狀態,如果為enable則表示為開啟
# /usr/sbin/sestatus -v

關閉selinux的方法:
/etc/sysconfig/selinux
SELINUX=disable


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM