12343


`vagrant up` をすると  
`hostnamectl: command not found` と怒られてしまいます。  
どこを修正していけばいいのでしょうか…。

情報が足りない部分ありましたら、ご指摘していただけますとありがたいです。

[code]

    $ vagrant up
    Bringing machine 'default' up with 'virtualbox' provider...
    ==> default: Importing base box 'ubuntu12.04'...
    ==> default: Matching MAC address for NAT networking...
    ==> default: Setting the name of the VM: ietty_default_1436859130223_77096
    ==> 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: 3000 => 3000 (adapter 1)
        default: 22 => 2222 (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: Warning: Connection timeout. Retrying...
        default:
        default: Vagrant insecure key detected. Vagrant will automatically replace
        default: this with a newly generated keypair for better security.
        default:
        default: Inserting generated public key within guest...
        default: Removing insecure key from the guest if it's present...
        default: Key inserted! Disconnecting and reconnecting using new SSH key...
    ==> default: Machine booted and ready!
    ==> default: Checking for guest additions in VM...
        default: The guest additions on this VM do not match the installed version of
        default: VirtualBox! In most cases this is fine, but in rare cases it can
        default: prevent things such as shared folders from working properly. If you see
        default: shared folder errors, please make sure the guest additions within the
        default: virtual machine match the version of VirtualBox you have installed on
        default: your host and reload your VM.
        default:
        default: Guest Additions Version: 4.2.10
        default: VirtualBox Version: 5.0
    ==> default: Setting hostname...
    The following SSH command responded with a non-zero exit status.
    Vagrant assumes that this means the command failed!
    
    hostnamectl set-hostname 'ubuntu-VirtualVox'
    
    Stdout from the command:
    
    
    
    Stderr from the command:
    
    stdin: is not a tty
    bash: line 2: hostnamectl: command not found
    
[/code]

`hostnamectl` に関する部分を調べていてもあまり理解できず解決せずです…。

`vagrant provision` をすると

[code]

    $ vagrant provision
    ==> default: Running provisioner: ansible...
    
    PLAY [vagrant] ****************************************************************
    
    GATHERING FACTS ***************************************************************
    fatal: [192.168.33.10] => SSH Error: ssh: connect to host 192.168.33.10 port 22: Operation timed out
        while connecting to 192.168.33.10:22
    It is sometimes useful to re-run the command using -vvvv, which prints SSH debug output to help diagnose the issue.
    
    TASK: [ubuntu | install essential packages] ***********************************
    FATAL: no hosts matched or all hosts have already failed -- aborting
    
    
    PLAY RECAP ********************************************************************
               to retry, use: --limit @/Users/ietty/provision_vagrant.retry
    
    192.168.33.10              : ok=0    changed=0    unreachable=1    failed=0
    
    Ansible failed to complete successfully. Any error output should be
    visible above. Please fix these errors and try again
    
[/code]

となってしまいます。  
よろしくお願いします。


CC BY-SA 3.0
2015-07-14T07:40:31.223
12338
2015-07-14T10:23:37.927
2015-07-14T10:23:30.203
8000
9617
question
ubuntu vagrant
ubuntu12.04 の box を立ち上げる際 hostnamectl: command not found


これですね。

[Unable to set hostname in 12.04 · Issue #5934 ·
mitchellh/vagrant](https://github.com/mitchellh/vagrant/issues/5934)

Ubuntu 13.04 から `hostnamectl` コマンドを使ってホスト名を設定するようになり、15.04 で旧来の `hostname`
サービスによる設定が使えなくなりました。 [Vagrant でも 1.7.3
から新しい設定方法に対応した](https://github.com/mitchellh/vagrant/issues/5673)ものの、 Ubuntu
のバージョンを見て設定方法を切り替えるコードにバグがあったようです。

前述の Issue は既に修正が行われており、 Vagrant 1.7.4 でリリースされる予定です。

  * 1.7.4 を待つ
  * 1.7.3 にダウングレードする
  * とりあえずパッチを手動で適用してしまう（[`return` を書き足すだけ](https://github.com/aidanhs/vagrant/commit/13e2dbaf9d1a63ebbb7d11b4e844cab2f36d5bfc)）

あたりが対処法になるかと思います。


CC BY-SA 3.0
2015-07-14T10:23:37.927
12343
2015-07-14T10:23:37.927
8000
12338
answer