-
Notifications
You must be signed in to change notification settings - Fork 0
VagrantでUbuntu 18.04の開発環境を用意する
ShinyaKato edited this page May 20, 2018
·
3 revisions
VitualBox: https://www.virtualbox.org/
Vagrant: https://www.vagrantup.com/
vagrant init bento/ubuntu-18.04
以下自分がやっていた設定を参考までに。
private IPアドレスは固定する方が楽。
後でブラウザからアクセスするときはこのIPでアクセスできる。
参考: https://www.vagrantup.com/docs/networking/private_network.html
メモリは少し増やした方がいいと思う。
メモリ少ないとWebpackのトランスパイルでこけることがあった。
自分は2048MBにしていた。
あと、お好みでsshのforward agentを設定をすると仮想マシンの中からホストの秘密鍵を使える。
GitHubに新しく鍵を追加しなくて良いので便利。
Macならssh-add -K ~/.ssh/id_rsa
でssh agentに鍵を追加できる。
# コメントインする
config.vm.network "private_network", ip: "192.168.33.10"
# コメントインする
config.vm.provider "virtualbox" do |vb|
# Display the VirtualBox GUI when booting the machine
# vb.gui = true
# Customize the amount of memory on the VM:
vb.memory = "2048"
end
# 追記する
config.ssh.forward_agent = true
vagrant up
vagrant ssh