DEV Community

Seijiro Ozawa
Seijiro Ozawa

Posted on

2

ローカル開発環境にVirtualBoxを使用する

経緯

DockerDesktop(Windows)、WSLとの戦いに敗れた.
プロジェクト単位での仮想環境というより適当に使えるローカル開発環境が欲しかった。

やったこと

  1. VirtualBoxのインストール
  2. Debian10(Buster)のイメージのDL
  3. HostOnlyNetworkの設定

1の手順

https://www.virtualbox.org/wiki/Downloads

2の手順

https://www.debian.org/distrib/

3の手順

ホストOS側でホストオンリーネットワークを設定.

ゲストOSで下記の設定を追加

"/etc/systemd/network/enp0s8.network" というファイルを作り,次のように記入する.
[Match]
enp0s8

[Network]
Address=192.168.151.100
DNS=192.168.151.1

sudo service networkservice restart

以上.

以下の記事を参考にしました。
https://qiita.com/Yoshiki-Takahashi/items/7274dff15dbafee5b118

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Discover a treasure trove of wisdom within this insightful piece, highly respected in the nurturing DEV Community enviroment. Developers, whether novice or expert, are encouraged to participate and add to our shared knowledge basin.

A simple "thank you" can illuminate someone's day. Express your appreciation in the comments section!

On DEV, sharing ideas smoothens our journey and strengthens our community ties. Learn something useful? Offering a quick thanks to the author is deeply appreciated.

Okay