LoginSignup
21
23

More than 5 years have passed since last update.

vagrantメモ

Last updated at Posted at 2013-10-02

boxes の管理

box一覧表示

$ vagrant box list

box追加

$ vagrant box add 

VM起動して接続

$ vagrant up
$ vagrant ssh

Tips

VMが使用するCPUコア数を設定

Vagrantfile で以下のように "--cpus", "2" を設定

    # Use VBoxManage to customize the VM. For example to change memory:
    vb.customize ["modifyvm", :id, "--memory", "2048", "--cpus", "2"]

sandbox モードを活用する

プラグインのインストール

vagrant plugin install sahara

使い方は、jedi4ever/sahara を参照。

Guest Additions を自動的に更新

プラグインのインストール

$ vagrant plugin install vagrant-vbguest

ssh コマンドで接続する

vagrant ssh-config コマンドで接続情報を確認する。

[Vagrant] VirtualBoxのバージョンとGuest additionsのバージョンが合わない場合の対処法 - Code Life

bundler が異常に遅い

/etc/resolv.conf に以下を追加

options single-request-reopen

参考:

同期フォルダをNFSマウント

Vagrantfile の修正、:private_network での固定IPアドレスの設定と、 synced_folder での :nfs => true の設定。

  config.vm.network :private_network, ip: "192.168.33.10"
  config.vm.synced_folder "./working", "/share", :nfs => true

参考:

21
23
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
21
23