vagrant启动错误踩坑解决

> default: Forcing shutdown of VM...
==> default: Destroying VM and associated drives...
D:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/io.rb:32:in `encode': "\xAE\xE4" from GBK to UTF-8 (Encoding::UndefinedConversionError)
        from D:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/io.rb:32:in `read_until_block'        from D:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/subprocess.rb:194:in `block in execute'
        from D:/HashiCorp/Vagrant/embedded/gems/2.2.5/gems/vagrant-2.2.5/lib/vagrant/util/subprocess.rb:192:in `each'
  

以上是错误信息,查了很多文章,有说根据日志提示更改rb文件的,用了之后说我没有权限,不知道是否具体可行。

解决方法:

Vagrantfile中添加代码  Encoding.default_external = 'UTF-8'

1

2

3

4

5

6

7

8

9

10

11

Vagrant.configure("2"do |config|

  # The most common configuration options are documented and commented below.

  # For a complete reference, please see the online documentation at

  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for

  # boxes at https://vagrantcloud.com/search.

  config.vm.box = "centos/7"

  Encoding.default_external = 'UTF-8'

  # Disable automatic box update checking. If you disable this, then

  # boxes will only be checked for updates when the user runs

你可能感兴趣的:(vagrant,p2p,运维)