当前位置:网站首页>Vagrant virtual machine installation, disk expansion and LAN access tutorial
Vagrant virtual machine installation, disk expansion and LAN access tutorial
2022-06-13 05:38:00 【Flying it people】
1. download vagrant as well as virtualBox
Deserve to go up vagrant,virtualBox Online download address :
vagrant Download address
virtualBox Download address
2. Start preparing to install the image file
Find the system image file that needs to be installed , Deserve to go up vagrant Mirror address :vagrant Mirror address
Open the terminal of the system , Enter the following command :
$ vagrant box add {title} {url}
$ vagrant init {title} # You need to create a separate directory to init operation , And you need to enter the current directory every time you start
$ vagrant upAfter starting , open virtualBox, You can see the following picture scene :

The above is the virtual machine configuration and startup of the default parameters , Through
$ vagrant sshYou can connect to the virtual machine .
3. To begin vagrant Expansion of the original partition and other machines in the LAN ssh Tool connection
1)vagrant Expansion of the original partition
In execution vagrant init , In the directory, a file named "Vagrantfile" The file of , After opening, configure the following parameters
Vagrant.configure("2") do |config|
config.vm.box = "envimation/ubuntu-xenial"
config.disksize.size = "30GB"
endGood configuration , In execution $ vagrant up, Will prompt
Vagrant:
* Unknown configuration section 'disksize'.Solution , perform
$ vagrant plugin install vagrant-disksizeWait for about 1 Minutes later , It will prompt that the installation is successful . At the moment , You can execute $ vagrant up.
After the virtual machine starts , After connecting the virtual machine , Input
$ df -hYou can see the following parameters

however , Before partition expansion , What you see should be the default 9.7G The capacity of .
At this moment, enter the following command to view the partition capacity :
$ fdisk /dev/sdaEnter... After the command line :p, Print area , as follows

You can see , Actually /dev/sda Has become a 30G 了 , But what you see /dev/sda1 Maybe it's just 9.3G, Don't panic at the moment , You can operate the expansion smoothly according to the following commands .
stay Commant Type in :d
Delete useless partitions , After deleting , In the input n, To create partitions .
When creating partitions , Create partition 1, Because the default partition is the partition 1, And then input w, Preservation .
If you are prompted when saving
Re-reading the partition table failed.: Device or resource busyIt may be that this partition is currently in use , Don't panic , Enter the following command
$ partprobe /dev/sda
$ e2fsck /dev/sda1
$ resize2fs /dev/sda1Now you can see that the expansion is successful .
4. Other machines in the LAN use ssh Tools to access
open Vagrantfile file , Configure the following parameters
Vagrant.configure("2") do |config|
config.vm.box = "envimation/ubuntu-xenial"
config.disksize.size = "30GB"
config.vm.network "public_network", ip: "192.168.1.2"
end
ip Address configuration , The first three digits are required to follow this computer ip The first three are consistent , The latter bit is randomly configured . Good configuration , restart vagrant That's it .
边栏推荐
- Calculate the number of days between two times (supports cross month and cross year)
- How to Algorithm Evaluation Methods
- float类型取值范围
- Small project - household income and expenditure software (2)
- Bicolor case
- 17.6 unique_ Lock details
- Integer tips
- Pychart professional edition's solution to SQL script error reporting
- Solutions to conflicts between xampp and VMware port 443
- Building Nacos 2 based on docker compose (using MySQL for persistence)
猜你喜欢

Difference between deviation and variance in deep learning

Comment procéder à l'évaluation des algorithmes

Use of natural sorting comparable

KVM virtualization management tool

Hainan University Postgraduate Entrance Examination electronic information (085400) landing experience

List collection concurrent modification exception

Qmessagebox in pyqt5

Dynamic and static libraries

Case - count the number of occurrences of each string in the string

Metartc4.0 integrated ffmpeg compilation
随机推荐
Use of mongodb
A fast week
Error: unmapped character encoding GBK
Std:: Map empty example
redis
MySQL main query and sub query
[multi thread programming] the future interface obtains thread execution result data
Unity game optimization [Second Edition] learning record 6
Compilation croisée helloworld avec cmake
19 calling subprocess (callactivity) of a flowable task
20 flowable container (event sub process, things, sub process, pool and pool)
Unity game optimization (version 2) learning record 7
Anaconda configuring the mirror source
Wampserver (MySQL) installation
MySQL log management and master-slave replication
Basic operations of MySQL auto correlation query
MySQL fuzzy query and sorting by matching degree
Solve the problem of garbled code in the MySQL execution SQL script database in docker (no need to rebuild the container)
Difference between deviation and variance in deep learning
Case - grade sorting - TreeSet set storage