0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Vagrant mount errorが出てきた!!

Posted at

#Vagrantでハマったメモ
参考にしている本

ちなみに、virsionが古いので下の公式サイトと併用することがいいと思います。

vagrant 様

Vagrant by HashiCorp.png

#ディレクトリ構成
$.tree
 |-dev
 |-vagrant
  |-Vagarantfile
  |-provision.sh

#中身
##Vagrantfile[$/vagrant/Vagrantfile]

config.vm.box = "hashicorp/precise64
config.vm.define 'web' do |web|
    web.vm.synced_folder "../dev" , "/vagrant_dev"
    web.vm.network "forwarded_port", guest:80, host:8080
    web.vm.provision :shell, path: "provision.sh"
    web.vm.network "private_network" , ip:"192.168.33.10"
  end

  config.vm.define "db" do |db|
    db.vm.network "private_network" , ip:"192.168.33.11"
  end
provision.sh
#!/usr/bin/env bash

echo "Installing Apache and setting it up..."
apt-get update >dev/null 2>&1
apt-get install -y apache2 >/dev/null 2>&1
rm -rf /var/www
In -fs /vagrant_dev /var/www

#vagrant up時に吐かれた忌まわしきエラー
##error log on terminal

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:

stdin: is not a tty
/sbin/mount.vboxsf: mounting failed with the error: No such device

はい、英語わからないから適当に意訳

Linux guest のファルダーにマウントできません。
" vboxsf "ファイルシステムがないこよによう原因がほぼほぼの原因。
guest-additionに関するものいれて動く状況になったらこい!!
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
上が吐かれた時のコマンドは
stdin: is not a tty
/sbin/mount.vboxsf: mounting failed with the error: No such device

ゲストアディションが原因なのかい??
ってことでjQueryいじらされてからのプラグイン恐怖症になった自分が
Virtual box のプラグインいれる。

#vagrant-vbguestのプラグインをいれる
とりあえず解消できたので、プラグインなしの変更手段を整えたいのですがいつか。
ターミナルコマンドを開いてい下記コマンド

$ vagrant plugin install vagrant-vbguest

おわったら

$  vagrant up

動いた!!

最後にping送って確認。(一応やれといっていたので。)

$ vagrant ssh web
$ ping 192.188.33.11

うごいた!!

って感じでとりあえず動きました!!

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?