Vagrant + VirtualBox + CentOS7 + WindTerm build a local Linux development environment in 5 minutes
Vagrant + VirtualBox + CentOS7 + WindTerm build a local Linux development environment in 5 minutes
1. Preparation stage
- Download the tools and files needed to build the environment (if you can’t find it on the page, please refer to the Tips section)
Vagrant
Version: vagrant_2.2.18_x86_64.msi
Link:[ https://developer.hashicorp.com/vagrant/downloads](https://github.com/kingToolbox/WindTerm/releases)
VirtualBox
Version: VirtualBox -6.1.46-158378-Win.exe
Link: https://www.virtualbox.org/wiki/Download_Old_Builds
CentOS7 image file
Version: CentOS-7-x86_64- Vagrant -1601_01.VirtualBox.box
link: https://cloud.centos.org/centos/7/vagrant/x86_64/images/
WindTerm
Version: WindTerm_2.6.0
Link: https://github.com/kingToolbox/WindTerm/releases
2. Installation stage
- Install Vagarant, Virtual, WindTerm
- CentOS7 image ready for download
- Specify a Vagrant configuration path and initialize Vagrant configuration
D:\CentOS7\VmConfig\Linux01>vagrant init
D:\CentOS7\VmConfig\Linux01>vagrant
as the picture shows:
- Modify the Vagrantfile file and update the IP and configuration as needed
Vagrant.configure("2") do |config|
config.vm.box = "linux01"
config.vm.network "public_network", ip: "192.168.2.101"
config.vm.provider "virtualbox" do |vb|
vb.memory = "3000"
vb.name = "docker-centos7-01"
vb.cpus = 2
end
end
- Install CentOS7 image
D:\CentOS7\VmConfig\Linux01>vagrant box add linux01 D:\CentOS7\CentOS7.box
D:\CentOS7\VmConfig\Linux01>vagrant up
as the picture shows:
- Log in to the Linux system to change the password and default account password: root/vagrant
D:\CentOS7\VmConfig\Linux01>vagrant ssh
[vagrant@192 ~]$ sudo -i
[root@192 ~]# su root
[root@192 ~]# passwd
as the picture shows:
- Modify the password login method: PasswordAuthentication yes
[root@192 ~]# vi /etc/ssh/sshd_config
[root@192 ~]# service sshd restart
as the picture shows:
- Remote login through WindTerm
3. Summary
Download the tools and images = > Enter key instructions ==> Client login
// 初始化vagrant配置
vagrant init
vagrant
// 加载镜像
vagrant box add [name] [path]\CentOS7.box
vagrant up
// 修改登陆密码
vagrant ssh
sudo -i
su root
passwd
// 设置登陆方式为密码登陆
vi /etc/ssh/sshd_config
service sshd restart
Tips: Please refer to the tool download
- Vagrant
- VirtualBox
- CentOS07
- WindTerm