In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly shows you "how to install Vagrant under Linux", the content is simple and easy to understand, clear organization, I hope to help you solve doubts, let Xiaobian lead you to study and learn "how to install Vagrant under Linux" this article bar.
Vagrant is a Ruby-based tool for creating and deploying virtualized development environments. It uses Oracle's open source VirtualBox virtualization system, using Chef to create automated virtual environments
Install Vagrant
You can download the zip file of Vagrant from the Download page. Unzip to find the application image. Make it executable and operational.
Alternatively, you can install it through the distribution's code repository:
Ubuntu/Debian/Ubuntu-based distros: sudo apt install vagrant
Fedora on:
sudo dnf install vagrant
Fig. 1
Vagrant is compatible with Hyper-V, VMWare, Parallels, VirtualBox and libvirt. In this tutorial, I will use libvir because it is a hypervisor built into the Linux kernel.
To install the Vagrant libvirt provider, use one of the following commands:
sudo apt install vagrant-libvirt
or
vagrant plugin install vagrant-libvirt
Fig. 2
Turn on your first Vagrant device
To get Vagrant up and running, you add a device, create a directory for the virtual machine, and then run two Vagrant commands: one to initialize the system and one to start the virtual machine.
First, add a device to the system:
vagrant box add centos/7 –provider=libvirt
Be sure to add a provider as a flag.
Next, create a directory and go to it:
mkdir vagrant-test cd vagrant-test
Now, initialize Vagrant:
vagrant init centos/7
As part of the initialization phase, Vagrant will create a file named "Vagrantfile"(e.g. vagrant-test1) in the current working directory. You can create any number of directories and initialize Vagrant. Each directory and Vagrantfile represents a virtual machine. These different virtual machines can be based on the same device (such as precise32) or different devices.
To start the virtual machine, run:
vagrant up
After booting, the virtual machine runs in peripheral less mode (no monitor or virtual screen) and you can only connect to it via SSH. This can be done from any other computer on your network through a normal SSH client or using the built-in ssh command. If you want to use another SSH client, note that the correct IP address is the IP address of the host (PC running Vagrant and provider), but on a different port. During startup, Vagrant will show how to forward port 22(for SSH). It may be forwarded to port 2222.
To use the built-in ssh command, type:
vagrant ssh
You are now connected to the virtual machine. To exit the SSH connection, type "exit" or press Ctrl +D.
Stop your first vagrant device
To stop a running virtual machine, use:
vagrant ssh
To delete a virtual machine, use:
vagrant destroy
After destroying the VM, the base operating system (from the.box file) remains stored inside Vagrant and other VMs can be started if needed without Vagrant having to redownload the.box file.
With just two commands (vagrant init and vagrant up), Vagrant lets you start a fully functional Linux virtual machine that can be accessed via SSH. Advanced configuration can be done via Vagrantfile.
The above is "How to install Vagrant under Linux" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.