それはどのような浮浪者?
浮浪者は、仮想マシン・ツールである
、仮想マシンを管理するためのコマンドと設定ファイルによってすぐに完全な開発環境を展開することができるようになります、とスプレッド、統一された開発環境をパッケージ化するだけでなく、問題の再構成可能な環境を解決することができます。
メリットVargant
1.統合開発環境。
こうした「コーディングの問題」、「ミッシングモジュール」、によって引き起こされる「異なるプロファイル」の問題などの問題に対処構成パッケージ、統一チームのメンバーに配布し、チーム統一開発環境、。
2.重複したセットアップに開発環境を避けてください。
新入社員は、無駄な時間のコストを削減し、開発者はすぐに追加、セットアップに開発環境を、時間を無駄にしてはいけません。
3.複数の独立した開発環境。
異なる言語でのボックスで実行、またはコンパイルして、同じ言語の異なるバージョンをインストールし、迅速かつ簡単にアンロードする際にも非常にクリアされた複数の独立した開発環境を設定することはできません。
手順のwin7 / win10システムを使用して
1、VirtualBoxは、放浪の2つのソフトウェアをインストールします
直接ダウンロードする公式サイトに、次のように公式サイトをインストールします。
https://www.virtualbox.org
https://www.vagrantup.com
範囲の公式ウェブサイトは遅く、ソフトウェアの2つの異なるバージョンは、つまり、互換性の問題を引き起こす可能性がありますあなたの浮浪者はそれにいくつかの奇妙な問題が発生する場合がありますので、インストールの2つのバージョンを開発するのが最善です。
win10のバージョン:
VirtualBoxの-5.2.12-122591-win.exeという
vagrant_2.2.7_x86_64.msi
2、画像ファイルボックスをダウンロード
放浪アドオンのインストールが自動的にダウンロードしてインストールしますが、国の公式のダウンロード速度与え、遅すぎるの観点で非常に強いだろう場合、Linuxのミラーイメージである画像ファイルは、(実際には、あなたが直接、公式ミラーの名前を指定することができますダウンロードするボックスの必要性をインストールした後最初のサンダーのようなツールは、ダウンロードを加速して、ローカルにインストールされている)で
、以下のアドレスに公式サイトをダウンロード:
https://app.vagrantup.com/boxes/search
:あなたはCentOSのをインストールしている場合は、下の直接のリンクをクリックして
HTTPS://アプリケーション。 vagrantup.com/centos/boxes/7
図3に示すように、画像は、容器内に装填され、放浪
次のコマンドを実行します。
vagrant box add -name [虚拟机名称] [box放置的位置]
指定しない場合は、ルートディレクトリに戻ってダウンロードした後に直接書かれた場所にボックスの最後のCentOSの/ 7の仮想マシン名は、デフォルトは公式サイトからダウンロードしただろうことができ
放浪ボックスの追加-name「CentOSの/:など 7 「[ボックス配置位置]
ここに私自身の位置に置か習慣があります:
$ vagrant box add xuni CentOS20200119.box
4、仮想マシンを初期化します
$ vagrant init xuni
放浪initコマンドは、最初のワードのコマンドである
xuniがボックスの名前である(第3の工程である[仮想マシン名]位置という)
5、仮想マシンを起動
初期の後、あなたは、次のコマンドを実行し、仮想マシンを起動するために始めることができます。
$ vagrant up
D:\>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Importing base box 'xuni'...
==> default: Matching MAC address for NAT networking...
==> default: Setting the name of the VM: _default_1583637544209_19565
Vagrant is currently configured to create VirtualBox synced folders with
the `SharedFoldersEnableSymlinksCreate` option enabled. If the Vagrant
guest is not trusted, you may want to disable this option. For more
information on this option, please refer to the VirtualBox manual:
https://www.virtualbox.org/manual/ch04.html#sharedfolders
This option can be disabled globally with an environment variable:
VAGRANT_DISABLE_VBOXSYMLINKCREATE=1
or on a per folder basis within the Vagrantfile:
config.vm.synced_folder '/host/path', '/guest/path', SharedFoldersEnableSymlinksCreate: false
==> default: Vagrant has detected a configuration issue which exposes a
==> default: vulnerability with the installed version of VirtualBox. The
==> default: current guest is configured to use an E1000 NIC type for a
==> default: network adapter which is vulnerable in this version of VirtualBox.
==> default: Ensure the guest is trusted to use this configuration or update
==> default: the NIC type using one of the methods below:
==> default:
==> default: https://www.vagrantup.com/docs/virtualbox/configuration.html#default-nic-type
==> default: https://www.vagrantup.com/docs/virtualbox/networking.html#virtualbox-nic-type
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter 1: nat
default: Adapter 2: hostonly
==> default: You are trying to forward to privileged ports (ports <= 1024). Most
==> default: operating systems restrict this to only privileged process (typically
==> default: processes running as an administrative user). This is a warning in case
==> default: the port forwarding doesn't work. If any problems occur, please try a
==> default: port higher than 1024.
==> default: Forwarding ports...
default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
default: SSH address: 127.0.0.1:2222
default: SSH username: vagrant
default: SSH auth method: password
default: Warning: Connection reset. Retrying...
default: Warning: Connection aborted. Retrying...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
default: /vagrant => D:/
説明では、仮想マシンが正しく完成インストールされている起動このコンテンツを参照してください!
6、接続されている仮想マシン
接続は基本イメージを変更する場合は、公式始まりROMを使用し、そして、あなたは、configure sshのに次のコマンドを入力して設定を変更する必要があります
1、修正sshd_configの設定
仮想マシンに、ログインアカウントのパスワードは、次のとおりです。浮浪者
のフォルダにの/ etc / sshを、設定ファイルのsshd_config変更
CDをの/ etc / SSH
VIのsshd_config
再起動sshd.serviceサービス
systemctl restart sshd.service
仮想マシンを接続Xshellローカルでの使用には、次のコマンドを実行します。
ssh 127.0.0.1 2200
ポップアップウィンドウで、仮想マシンを入力するユーザー名とパスワードを入力します。sshコマンドは、コマンド場合の出力接続、127.0.0.1 2200は放浪アップを見つけることができ表します。
7、仮想マシンを接続するためのツールを使用してxshell
また、直接sshコマンドの公式サイトで直接接続することができますが、勝利にはあまり便利なの将来の開発でsshコマンドまたはCMDウィンドウとの接続には、最良のツールは、接続されているxshellです。
デフォルトのアカウントとパスワードは、直接、次のとおりです。放浪缶、(アカウントのrootログイン、パスワードや浮浪者への個別)
これは、コンピュータの問題を提示し、それは(削減に相当)のキーに直接取り付けることができ、その後、他のコンピュータまたは仮想マシンでの将来の使用のために、直接、自分のイメージにパッケージが完了した後のようにミラーの詳細と調整し、結論
方法を梱包詳細な独自のボックスを私もブログを持ってチュートリアルhttp://tiance.club/post/299409888.html
著者:xingguang
リンク:オリジナルリンク:https://www.tiance.club/post/2370098709.html