CentOS7をVagrantで動かしたい


CentOS7をVagrantで動かしたい | Bamboo lath 日々の記録CentOS7をVagrantで動かしたい。

CentOS7の練習のために環境が欲しい。

$ vagrant box add CentOS7_minimal https://f0fff3908f081cb6461b407be80daf97f07ac418.googledrive.com/host/0BwtuV7VyVTSkUG1PM3pCeDJ4dVE/centos7.box                                                  
Downloading or copying the box...
Extracting box...ate: 9955k/s, Estimated time remaining: --:--:--)
Successfully added box 'CentOS7_minimal' with provider 'virtualbox'!

初期化。

$ vagrant init CentOS7_minima

VagrantfileでIPの指定してから起動

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
[default] Importing base box 'CentOS7_minimal'...
[default] Matching MAC address for NAT networking...
[default] Setting the name of the VM...
[default] Clearing any previously set forwarded ports...
[default] Creating shared folders metadata...
[default] Clearing any previously set network interfaces...
[default] Preparing network interfaces based on configuration...
[default] Forwarding ports...
[default] -- 22 => 2222 (adapter 1)
[default] Booting VM...
[default] Waiting for machine to boot. This may take a few minutes...
[default] Machine booted and ready!
[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!

ARPCHECK=no /sbin/ifup eth1 2> /dev/null

Stdout from the command:



Stderr from the command:

エラー出た。

■[Sy] 【解決した】VagrantでCentOS7のVMを作ったらネットワーク設定でコケた(固定IP割り当てに失敗)
http://www.utano.jp/entry/2014/11/vagrant_centos7_network_error

上記サイトを参考にvagrantを新しくしてみる。

https://www.vagrantup.com/downloads.html

# rpm -Uvh vagrant_1.7.2_x86_64.rpm
# vagrant -v
Vagrant 1.7.2

CentOS7を起動してみる。

$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> 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: bridged
==> default: Forwarding ports...
    default: 22 => 2222 (adapter 1)
==> 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 its present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => /home/takeuchi/fujita_cent7
Failed to mount folders in Linux guest. This is usually because
the "vboxsf" file system is not available. Please verify that
the guest additions are properly installed in the guest and
can work properly. The command attempted was:

mount -t vboxsf -o uid=`id -u vagrant`,gid=`getent group vagrant | cut -d: -f3` vagrant /vagrant
mount -t vboxsf -o uid=`id -u vagrant`,gid=`id -g vagrant` vagrant /vagrant

The error output from the last command was:

/sbin/mount.vboxsf: mounting failed with the error: No such device

共有フォルダのマウントで失敗している模様。

■vagrant起動で”Failed to mount folders in Linux guest”のエラーが出た件
http://l-light-note.hatenablog.com/entry/2015/04/04/212648

以下をやってみた。

$ vagrant plugin install vagrant-vbguest
Installing the 'vagrant-vbguest' plugin. This can take a few minutes...
Installed the plugin 'vagrant-vbguest (0.10.0)'!

一旦落として。

$ vagrant halt

再度起動。

$ vagrant up

起動できた。

そもそも共有フォルダ使ってないから使わないようにしたらよいかも。
ついでにVirtualBoxのアップデートもした。

■参考URL

[Sy] 【解決した】VagrantでCentOS7のVMを作ったらネットワーク設定でコケた(固定IP割り当てに失敗)
http://www.utano.jp/entry/2014/11/vagrant_centos7_network_error

VirtualBoxとVagrantをバージョンアップする
http://qiita.com/mashumashu/items/557dcb805e77315004b1

vagrant起動で”Failed to mount folders in Linux guest”のエラーが出た件
http://l-light-note.hatenablog.com/entry/2015/04/04/212648

Failed to mount folders in Linux guest. This is usually because the “vboxsf” file system is not available.を直す方法
http://qiita.com/DQNEO/items/2375dd8002a831268cb5

Vagrant で CentOS 6.5 を使っていたら Guest Additions の更新に失敗してハマった
http://qiita.com/a-suenami/items/3b04151ce6e7d5b72a3e

Vagrantでフォルダがmountできないエラーが出たときの対応
http://qiita.com/kazu69/items/812b236e84fee1db3900


コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です