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

转载于:https://www.cnblogs.com/hanpengyu/p/7826104.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值