centos - "systemctl: command not found"在新的 CentOS 6.5 安装上带有 vagrant

标签 centos vagrant vagrantfile

我正在创建新的 vagrant box,它使用我安装的 CentOS 6.5 的 virtualbox 图像。内部一切正常,但从外部我无法访问 80 端口

当我编辑 Vagrantfile 并添加固定 IP 时: config.vm.network "private_network", ip: "10.10.10.10" 然后我运行 vagrant up,我得到了“找不到 systemctl 命令”。

我认为它试图设置网络接口(interface),但失败了,因为它使用了 systemctl,我认为它在这个版本或发行版中不可用。 有没有办法添加它,或者手动配置 IP/网络接口(interface)?以便 vagrant 连接到它?

==> default: Attempting graceful shutdown of VM...
==> 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: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!

systemctl stop etcd
ifconfig 10.10.10.10 netmask 255.255.255.0
mv /tmp/etcd-cluster.service /media/state/units/
systemctl restart local-enable.service

# Restart default etcd
systemctl start etcd


Stdout from the command:



Stderr from the command:

bash: line 3: systemctl: command not found
SIOCSIFNETMASK: No such device
SIOCGIFADDR: No such device
SIOCSIFBROADCAST: No such device
mv: cannot move `/tmp/etcd-cluster.service' to `/media/state/units/': No such file or directory
bash: line 6: systemctl: command not found
bash: line 9: systemctl: command not found

最佳答案

不确定这是否是原因,但罪魁祸首可能是 SELinux。也许它阻止了连接或权限。稍后开始工作:

setenforce Permissive
nano /etc/sysconfig/selinux
#setting SELINUX=disabled

关于centos - "systemctl: command not found"在新的 CentOS 6.5 安装上带有 vagrant,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39786877/

相关文章:

vagrant - 在 Vagrantfile 中声明的多台机器是否必须基于相同的基盒?

email - 强制 Exim 使用 ipv4 ip

java - CentOS 上的多个 Java 版本

php - Centos 6.9 和 Phalcon 2.0.13

php - 使用 Xdebug 共享相同代码库的两个应用程序中的断点

python-2.7 - NoSuchModuleError : Can't load plugin: sqlalchemy. 方言 :redshift. psycopg2

python - 使用 python 收集远程服务器 (linux) 指标

vagrant - 如何在 kitchen.yml 中进行多重配置?

mysql - Vagrant,如何在主机上访问/同步 phpmyadmin

vagrant 不会启动虚拟机 - (Errno::EADDRNOTAVAIL)