1
2

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/VirtualBox上のローカルのWebサイトをスマホで実機確認をつまづいたけどできた話。

Last updated at Posted at 2016-07-27

「Vagrant/VirtualBox上にたてたWebサイトの実機確認をiPhone/iPadからおこなう 」
このqiitaの記事を参考に進めたけど、ローカルの内容をスマホから確認できない・・・。

元の記事では以下のようになっていたところを
config.vm.network :public_network, ip: '192.168.2.ZZZ', bridge: 'en0: Wi-Fi (AirPort)'
以下のようにしてみました。
config.vm.network :public_network

vagrant upした時にbridgeどれにしますか?的な問いが来るので、
僕の場合は、覗きたいローカルがあるPCとスマホが共通して使ってるwifiで繋がりたかったので以下のようにしました。
'en0: Wi-Fi (AirPort)'

こうすることで、ipを自動で設定してくれて、スマホからローカルにアクセスできるようになりました。
原因の検証できていないですが、指定した固定ipが埋まっていたのかもしれません。

参考先の「Vagrant/VirtualBox上にたてたWebサイトの実機確認をiPhone/iPadからおこなう 」は最高に参考になる記事でした。ありがとうございました。

1
2
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
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?