| ページ一覧 | ブログ | twitter |  書式 | 書式(表) |

MyMemoWiki

差分

ナビゲーションに移動 検索に移動
80 バイト追加 、 2020年2月16日 (日) 04:33
編集の要約なし
==[[Vagrant]]==
{{amazon|B00F418SQ8}}
====初期化====
*Vagrantfileが生成される[[Vagrant]]fileが生成される
$ vagrant init centos/7
A `Vagrantfile[[Vagrant]]file` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment[[vi]]rtual en[[vi]]ronment! Please read the comments in the Vagrantfile [[Vagrant]]file as well as documentation on `vagrantup.com` for more information on using [[Vagrant]].
====起動====
*Hyper-v で起動
**Poershell を管理者で実行
PS> vagrant up --providerpro[[vi]]der=hyperv
*以下のエラーの場合のトラブルシュート
\import_vm_xml.ps1 : パラメーター名 'switchid' に一致するパラメーターが見つかりません。発生場所 行:1 文字:327
+ ... achines/default/hyperv/Virtual Hard Disks/disk.vhd' -switchid 'c08cb7 ...
+ 2020年2月15日 2020年2月16日 () 0804:39 33 (UTC)[[利用者:Piroto|Piroto]] ([[利用者・トーク:Piroto|トーク]]) 2020年2月15日 2020年2月16日 () 0804:39 33 (UTC)
+ CategoryInfo : InvalidArgument: (:) [import_vm_xml.ps1]、ParameterBindingException
+ FullyQualifiedErrorId : NamedParameterNotFound,import_vm_xml.ps1
=====起動時のパラメータ(--provider=hyperv)をVagrantfileに記述を[[Vagrant]]fileに記述===== config.vm.provider pro[[vi]]der "hyperv" do |vb|
# Customize the amount of memory on the VM:
vb.memory = "1024"
====net work====
*ネットワークを公開
*Vagrantfile[[Vagrant]]file
config.vm.network :public_network
====シャットダウン ====
====GNOME GUI====
*https://mseeeen.msen.jp/centos7-gnome-desktop-with-vagrant/
config.vm.provider pro[[vi]]der "virtualbox[[vi]]rtualbox" do |vb| # Display the [[VirtualBox ]] GUI when booting the machine
vb.gui = true
vb.memory = "2048"
end
config.vm.provision pro[[vi]]sion "shell", inline: <<-SHELL
sudo yum -y groupinstall "GNOME Desktop"
sudo yum -y install epel-release
>vagrant box list
centos/7 (hyperv, 1804.02)
centos7db2 (virtualbox[[vi]]rtualbox, 0)
====Boxを利用可能に====
>vagrant init centos7db2
====Boxを削除====
>vagrant box remove centos7db2
===[[Tips]]===
====proxy====
=====Vagrant自体に設定するには、環境変数に以下を設定[[Vagrant]]自体に設定するには、環境変数に以下を設定=====
*http_proxy
*https_proxy
=====ゲストOSにプロキシーを適用するには、上記設定をした上で以下のプラグインを導入ゲストOSにプロキシーを適用するには、上記設定をした上で以下の[[プラグイン]]を導入=====
*https://qiita.com/kota344@github/items/304979feaf965afffb1a
> vagrant plugin install vagrant-proxyconf
*Vagrantfileに追記[[Vagrant]]fileに追記
if Vagrant.has_plugin?("vagrant-proxyconf") && ENV['http_proxy']
puts '- Proxy Setting ----------------------------------'

案内メニュー