Este contenido no está disponible en el idioma seleccionado.

Chapter 3. Interacting with Running Vagrant Boxes


To use a Vagrant box that is up and running, first change to the directory from which you started that box. For example, on Microsoft Windows, run:

C:\> cd %USERPROFILE%\cdk\components\rhel\rhel-ose
Copy to Clipboard Toggle word wrap

On Linux or Mac OS X, run:

$ cd ~/cdk/components/rhel/rhel-ose
Copy to Clipboard Toggle word wrap

From that location, you can run different vagrant commands to use or manage the box in different ways.

List the subcommands available to use with your vagrant command:

$ vagrant list-commands
Copy to Clipboard Toggle word wrap

Log into your Container Development Kit Vagrant box using SSH. This automatically logs you into the Red Hat Enterprise Linux virtual machine as the vagrant user:

$ vagrant ssh
Copy to Clipboard Toggle word wrap

To exit the SSH session without affecting the Vagrant box, type exit in the virtual machine.

To stop the Vagrant box from the system, execute:

$ vagrant halt
Copy to Clipboard Toggle word wrap

To delete the created VM and free virtualization resources, use the vagrant destroy command. Your Vagrantfile and the box image in the .vagrant.d directory in your home directory will remain, allowing you to recreate a fresh version of the environment with a subsequent vagrant up command.

$ vagrant destroy
Copy to Clipboard Toggle word wrap
Note

Do not delete the .vagrant subdirectory where Vagrant keeps its per-machine state without first using the vagrant destroy command to free virtualization (libvirt or Virtualbox) resources.

If you no longer have the .vagrant subdirectory on a system using libvirt, you will need to use libvirt tools, such as virt-manager (GUI) or virsh (CLI), to manually delete the resources that were created by Vagrant before you can again start a Vagrant box with the same name. On a system using Virtualbox for virtualization, use the Virtualbox GUI to delete the resources you created with Vagrant.

After vagrant destroy, you will be able to bring the Vagrant box up again in its original, clean state.

To view the status of all Vagrant boxes on your system and verify that your box was properly stopped, use:

$ vagrant global-status
Copy to Clipboard Toggle word wrap
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat