vagrant创建虚拟机配置内存、硬盘、网络

文章讲述了如何在Vagrant环境中通过安装vagrant-disksize插件来指定虚拟机的磁盘大小。首先,需要安装插件,然后初始化Vagrant并编辑配置文件以设置磁盘大小。接着,配置文件中还包含了虚拟机的其他设置,如主机名、内存大小和CPU数量。最后,通过`vagrantup`启动虚拟机,并能使用`vagrantssh`进行连接。此外,还提到了修改SSH配置以允许root用户登录。

参考文章
指定磁盘大小需要安装插件
stackoverflow指定磁盘大小失效

vagrant plugin install vagrant-disksize

初始化后生成配置文件

vagrant init 
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值