2016-09-30 760 views
1

我創建了新的vagrant框,使用我安裝的CentOS 6.5的virtualbox映像。內部一切看起來不錯,但從外部我不能訪問80端口「systemctl:命令未找到」與新鮮的CentOS 6.5安裝vagrant的

當我編輯我Vagrantfile並增加固定IP: config.vm.network 「private_network」 IP: 「10.10.10.10」 ,我跑了無業遊民了,我得到了 「沒有發現systemctl命令」。

我認爲這是它試圖設置網絡接口,但因爲它使用systemctl而失敗,我認爲這個版本或發行版不可用。 有沒有辦法添加它,或手動配置IP /網絡接口?讓流浪漢連接到它?

==> 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 
+0

'systemctl'是新centos7的一部分,它在centos65上不可用 - 您是從provision腳本運行此命令還是如何運行? –

+0

不,這是由vagrant在更改Vagrantfile並添加固定IP時生成的: config.vm.network「private_network」,ip:「10.10.10.10」 –

+0

sytemd不是Centos6的init系統,因此無法進行systemctl可用。 –

回答

0

不知道這是否是原因,但罪魁禍首可能是SELinux的。也許它阻止了連接或權限。以後工作​​吧:

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