Vagrant使用指南:Vagrant命令使用简介

本文是Vagrant使用指南的一部分,主要介绍了Vagrant的几个关键命令,包括status、suspend、halt、reload、port及box的相关操作,帮助开发者更好地理解和管理虚拟开发环境。
摘要由CSDN通过智能技术生成

这里写图片描述

Vagrant是用ruby写的一个工具, 它的出现是为了更加容易的解决开发环境的一致性问题. 我们将会在本系列教程中学习到如何使用vagrant。在上一篇文章中我们使用了vagrant version/init/up/ssh等命令, 在本篇中对一些常用命令将做简单介绍.

命令一览

以下是vagrant1.8.5的命令一览。

命令 详细解释
box manages boxes: installation, removal, etc.
connect connect to a remotely shared Vagrant environment
destroy stops and deletes all traces of the vagrant machine
global-status outputs status Vagrant environments for this user
halt stops the vagrant machine
help shows the help for a subcommand
init initializes a new Vagrant environment by creating a Vagrantfile
login log in to HashiCorp’s Atlas
package packages a running vagrant environment into a box
plugin manages plugins: install, uninstall, update, etc.
port displays information about guest port mappings
powershell connects to machine via powershell remoting
provision provisions the vagrant machine
push deploys code in this environment to a configured destination
rdp connects to machine via RDP
reload restarts vagrant machine, loads new Vagrantfile configuration
resume resume a suspended vagrant machine
share share your Vagrant environment with anyone in the world
snapshot manages snapshots: saving, restoring, etc.
ssh connects to machine via SSH
ssh-config outputs OpenSSH valid configuration to connect to the machine
status outputs status of the vagrant machine
suspend suspends the machine
up starts and provisions the vagrant environment
version prints current and latest Vagrant version

vagrant status

使用status命令可以确认当前vagrant的状态

[root@host31 ~]# vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to sim
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值