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 3 years have passed since last update.

vagrantでUbuntuの環境構築をしよう

Posted at

自己紹介

むちゃんです。
関西を拠点に活動しているフロントエンドエンジニアです。

HAL大阪の2回生です:boy_tone2: (2020.7.5現在)

イベントなど回っているので是非大阪辺りの方は会いましょう!

Vagrantの環境構築

※色々な方法で環境構築ができるので是非試してみてください。

セットアップの手順

  1. VirtualBoxをインストール
    https://www.virtualbox.org/

  2. Vagrantをインストールする
    https://www.vagrantup.com/

流れ

  1. 仮想マシンのイメージをダウンロード
  2. 仮想マシンを扱うための作業ディレクトリを用意
  3. 登録したイメージを指定して、仮装マシンの設定ファイルを作成
  4. 仮想マシンの起動
  5. 仮想マシンのログイン

作成編

[ここからは実際にコマンドを入力していきます。]

Ubuntu 18.04 LTSの仮想マシンのイメージをダウンロード
   ※サイズが大きいので少し時間がかかります。

$ vagrant box add ubuntu/bionic64

登録したboxの確認

$ vagrant box add list

仮想マシンを扱うための作業ディレクトリを用意しそのディレクトリ内に入ります。

 $ mkdir [ディレクトリ名]
 $ cd [ディレクトリ名]

登録したイメージを指定して、仮装マシンの設定ファイルを作成しましょう。

 $ vagrant init ubuntu/bionic64

 $ls
 Vagrantfile

起動、ログイン

仮想マシンの起動
※設定ファイルと同じディレクトリで行ってください

 $ vagrant up

仮想マシンにログイン

 $ vagrant ssh

ログアウト、シャットダウン

仮想マシンからログアウト

 $ vagrant exit

シャットダウン

 $ vagrant halt

あとがき

今回は自分なりにubuntuの環境構築についてまとめてみした:thumbsup_tone2:
是非使ってあげてください。

Twitter @HomgMuchan ぜひフォロー待っています❗️

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?