mac vagrant virturebox
1.vagrant init centos/7
Vagrant.configure("2") do |config|
(2..5).each do |i|
config.vm.define "node#{i}" do |node|
# VirtaulBox相關(guān)配置
node.vm.provider "virtualbox" do |v|
# 設(shè)置虛擬機(jī)的名稱
v.name = "node#{i}"
# 設(shè)置虛擬機(jī)的內(nèi)存大小
v.memory = 1536
# 設(shè)置虛擬機(jī)的CPU個(gè)數(shù)
v.cpus = 1
end
node.vm.box = "centos/7"
node.vm.hostname = "node#{i}"
node.vm.network :private_network, ip: "192.168.56.#{i}",:mac => "5254004D77D3"
end
end
end
2.vagrant up
3.修改Vagrantfile網(wǎng)絡(luò)host-only,如果是windows,設(shè)置與virtual box網(wǎng)卡地址同一網(wǎng)段地址(如192.168.56.10)
如果是mac如下設(shè)置
config.vm.network "private_network", ip: "192.168.56.10", :mac => "5254004D77D3"
ruby - Vagrant: Setting a VM's MAC address in a private_network (hostonly) - Stack Overflow
4.修改 /etc/ssh/sshd_config中,PasswordAuthentication yes
然后還需要重啟service sshd restart,不然無法通過ssh連接
默認(rèn)賬號(root/vagrant)
5.ip address(centos 7中不支持ifconfig) 查看centos ip地址信息,并以ip地址+22端口遠(yuǎn)程連接ssh
warn:
mac的virtualbox創(chuàng)建虛擬機(jī),啟動(dòng)報(bào)錯(cuò):Kernel driver not installed (rc=-1908)
??????mac的virtualbox創(chuàng)建虛擬機(jī),啟動(dòng)報(bào)錯(cuò):Kernel driver not installed (rc=-1908)_狂瘋碼打中的博客-CSDN博客
VirtualBox+Vagrant快速搭建虛擬機(jī)集群_小凈的博客-CSDN博客
總結(jié)
以上是生活随笔為你收集整理的mac vagrant virturebox的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: IT企业薪酬结构一览
- 下一篇: 硬盘LBA 和CHS的关系(转)