1
3

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

windowsでVagrant + MobaXtermをパッと起動する

1
Posted at

インストール

環境

  • Windows 7

用意するもの

以上をそれぞれインストール

事前準備

  1. VirtualBoxを起動し環境設定からデフォルトの仮想マシンフォルダーを肥大しても問題ないフォルダに変更する
  2. 環境変数VAGRANT_HOMEを設定する
    boxファイルを置く場所になるのでこれも肥大化しても問題ない場所へ
  3. Vagrantfileを作る
  4. コマンドプロンプトを開きVagrantfileを作りたいファルダへ移動
  5. 環境変数VAGRANT_HOMEが適用されているか確認すること
  6. vagrant init centos/7
  7. VirtualBoxを使う場合ついでにvagrant plugin install vagrant-vbguestも実行しておくとよい
  8. vagrant upで起動のテスト
  9. vagrant sshでログインのテスト
  10. vagrant haltで停止

Vagrantを起動してMobaXtermで接続 さらには切断したら自動でhaltまでしてほしい

@echo off
@rem Vagrantfileのあるフォルダを指定
cd /d F:\DEV\VM\centos7
vagrant up
vagrant ssh-config > vagrant-ssh-config
cmd /c ""C:\Program Files (x86)\Mobatek\MobaXterm\MobaXterm.exe"^
  -exec "ssh -A -F `cygpath %cd:\=/%/vagrant-ssh-config` default""

@rem MobaXterm終了時にhaltする
vagrant halt
1
3
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
1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?