Vagrant-环境搭建的Error(Mac环境)

Vagrant-环境搭建Error-Mac环境

  • Error1️⃣
    • Vagrant up 时的error画面
    • 解决
  • Error2️⃣
    • Vagrant ssh时的error画面
    • 问题确认
    • 解决
    • 确认

Error1️⃣

Vagrant up 时的error画面

~/work/sample-vagrant $ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'centos/7'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'centos/7' version '1905.1' is up to date...
==> default: Setting the name of the VM: sample-vagrant_default_1569332644627_82660
==> default: Clearing any previously set network interfaces...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.

Command: ["hostonlyif", "create"]

Stderr: 0%...
Progress state: NS_ERROR_FAILURE
VBoxManage: error: Failed to create the host-only adapter
VBoxManage: error: VBoxNetAdpCtl: Error while adding new interface: failed to open /dev/vboxnetctl: No such file or directory
VBoxManage: error: Details: code NS_ERROR_FAILURE (0x80004005), component HostNetworkInterfaceWrap, interface IHostNetworkInterface
VBoxManage: error: Context: "RTEXITCODE handleCreate(HandlerArg *)" at line 94 of file VBoxManageHostonly.cpp

解决

重新启动virtualbox

~/work/sample-vagrant $ sudo "/Library/Application Support/VirtualBox/LaunchDaemons/VirtualBoxStartup.sh" restart
Password:
Unloading VBoxDrv.kext
Loading VBoxDrv.kext
Loading VBoxUSB.kext
Loading VBoxNetFlt.kext
Loading VBoxNetAdp.kext
~/work/sample-vagrant $

结果正常virtual up。

Error2️⃣

Vagrant ssh时的error画面

~/work/sample-vagrant $ vagrant ssh
-bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory

问题确认

显示的是UTC时间

[vagrant@vagrantCentos1 locales]$ echo $LANG
en_US.UTF-8
[vagrant@vagrantCentos1 locales]$ date
Tue Sep 24 14:28:41 UTC 2019

解决

[vagrant@vagrantCentos1 locales]$ localectl set-locale LANG=ja_JP.UTF-8
==== AUTHENTICATING FOR org.freedesktop.locale1.set-locale ===
Authentication is required to set the system locale.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===

确认

[root@vagrantCentos1 ~]# locale
LANG=ja_JP.UTF-8
LC_CTYPE="ja_JP.UTF-8"
LC_NUMERIC="ja_JP.UTF-8"
LC_TIME="ja_JP.UTF-8"
LC_COLLATE="ja_JP.UTF-8"
LC_MONETARY="ja_JP.UTF-8"
LC_MESSAGES="ja_JP.UTF-8"
LC_PAPER="ja_JP.UTF-8"
LC_NAME="ja_JP.UTF-8"
LC_ADDRESS="ja_JP.UTF-8"
LC_TELEPHONE="ja_JP.UTF-8"
LC_MEASUREMENT="ja_JP.UTF-8"
LC_IDENTIFICATION="ja_JP.UTF-8"
LC_ALL=
[root@vagrantCentos1 ~]# date
2019年  9月 24日 火曜日 14:33:13 UTC
[root@vagrantCentos1 ~]# localectl list-locales | grep -i ja
ja_JP.utf8
[root@vagrantCentos1 ~]# echo $LANG
ja_JP.UTF-8

你可能感兴趣的:(Vagrant-环境搭建的Error(Mac环境))