Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the advanced skills of Vagrant in Pycharm

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly introduces "what are the advanced skills of Vagrant in Pycharm". In daily operation, I believe that many people have doubts about the advanced skills of Vagrant in Pycharm. The editor consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "what are the advanced skills of Vagrant in Pycharm?" Next, please follow the editor to study!

1. Theme

This paper introduces the advanced skills of using Vagrant in Pycharm.

2. Use built-in SSH to connect to a Vagrant

Built-in SSH terminal

3. Start connecting

Use Tools → Start SSH session... Main menu commands:

The configured Vagrant machine has been automatically added to the list. Click Connect. The Edit credentials... here Menu items are for users to enter connection information manually, we only use virtual box here.

4. Use SSH

After Vagrant is selected, Pycharm uses SSH to connect to the Vagrant and displays the relevant information on the local terminal:

The following operations can be done at the SSH terminal:

Use the arrow keys to browse the history command

Use the clipboard function

5. Use shared folders

Pycharm allows folders to be shared between host and Vagrant.

6. Add a mapping path

Open the Vagrantfile file Open Vagrantfile for editing and add a mapping path configuration parameter:

7. Reload Vagrant

You can use the Tools → Vagrant → Reload main menu command to reload Vagrantfile:

Once the Vagrant is reloaded, a new mapping path becomes available. For example, after we connect to Vagrant using the built-in terminal of SSH, we see that Pycharm maps the contents of the / vagrant folder to the local project folder. Note that if you delete the files in a folder, the folders on both sides will delete the corresponding files.

8. Specify the Vagrant instance folder

By default, Vagrant-related files are placed in the root directory of the project, and we can change them in the Vagrant page of the project settings window:

9. Manage the Vagrant plug-in in the settings window

You can manage the relevant plug-ins in the Vagrant settings, and on the Plugins page, use the install / uninstall / update plug-in buttons to manage them. For example, the VMWare Fusion Provider plug-in allows us to run Vagrant in a VMWare environment.

10. Supplier support

Vagrant works with Oracle VirtualBox by default. Here we can change the vendor platform, such as VMWare and Amazon EC2. For more information, please see supplier list Vagrant plugins list.

Pycharm automatically binds the vendor name to the command line to facilitate the use of Vagrant. After selecting a vendor that is installed and set up on your computer, all Vagrant commands will be executed through it:

11. Replace vendor support

Tools → Vagrant → Provision is used to switch vendor settings without shutting down the virtual machine.

Using the Tools → Vagrant menu command, run provisioning on a running environment:

12. Environmental variable function

Environment variables have the following functions:

Setting the Puppet node setting the Puppet environment setting custom facts setting AWS keys... set project-related environment variables on the Vagrant page:

Once set, these environment variables are added to Vagrantfile in the form of # {ENV ['name_of_variable']}:

At this point, the study of "what are the advanced skills of Vagrant in Pycharm" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report