首页 > 系统服务 > 详细

vagrant mac的一些坑

时间:2017-11-13 15:34:01      阅读:408      评论:0      收藏:0      [点我收藏+]

环境介绍:
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

vagrant mac的一些坑

原文:http://www.cnblogs.com/hanpengyu/p/7826104.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!