Vagrant开发环境碰壁

安装教程

安装参考
迁移默认box文件位置
迁移box文件出现问题

安装宝塔出现登录不了
image.png
解决

安装宝塔默认IP地址是打开不了的,可以手机配置一个私有网络地址进行访问

image.png
访问:
http://192.168.33.20:8888/eae656d3
配置私有地址:
config.vm.network "private_network", ip: "192.168.33.20"
vagrant+centos7 安装报错

vagrant+centos7 安装报错传送门

设置同步映射文件路径报错
config.vm.synced_folder "D:/vagrant/centos/", "/var/www"
报错以下:

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 var_www /var/www
The error output from the command was:
mount: unknown filesystem type 'vboxsf'
解决:有时需要进行降版本处理
vagrant plugin install vagrant-vbguest
vagrant reload --provision
线上服务器上传本地项目访问没有找到文件(前提已购买域名 并绑定到购买服务器上)
image.png
忘记查看宝塔登录端口URL
宝塔登录端口URL
共享目录失败无法和服务器进行同步更新

The configured shell (config.ssh.shell) is invalid and unable解决文章


vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: password
The configured shell (config.ssh.shell) is invalid and unable
to properly execute commands. The most common cause for this is
using a shell that is unavailable on the system. Please verify
you're using the full path to the shell and that the shell is
executable by the SSH user.
安装插件:
vagrant plugin install vagrant-vbguest
vagrant reload
或者
配置文件加上这个
  config.vm.box = "centos"
  config.ssh.shell =  'sh'
 #The configured shell (config.ssh.shell) is invalid and unable 错误解决
  config.ssh.username = "vagrant"
  config.ssh.password = "vagrant"
  config.vm.network "private_network", ip: "192.168.33.110"
  config.vm.synced_folder ".","/vagrant",disabled:true #先禁止默认共享目录文件
  config.vm.synced_folder   
 "D:/vagrant/centos/www/html","/www/wwwroot/"

你可能感兴趣的:(Vagrant开发环境碰壁)