Skip to content

Instantly share code, notes, and snippets.

@wakamsha
Last active October 11, 2021 01:40
Show Gist options
  • Star 25 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wakamsha/087d5f95c8dbe07b9591 to your computer and use it in GitHub Desktop.
Save wakamsha/087d5f95c8dbe07b9591 to your computer and use it in GitHub Desktop.
VirtualBox 内のゲスト OS からホスト OS にアクセスしたい

VirtualBox仮想マシンのネットワークはデフォルトでNATとなっている。 VirtualBox の場合、NAT ネットワークアダプタには 10.0.2.0/24 の IP アドレスが割り当てられ、ゲスト OS から見える ホスト OS の IP アドレスには 10.0.2.2 が設定される仕様。

したがってホストOS上に建てたサーバーにゲストOSからアクセスしたい場合は、http://10.0.2.2とアクセスすれば普通に見ることができる。

参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment