Memo of Linux environment construction using VirtualBox + Vagrant on Windows 10

Since I built a Linux environment using VirtualBox + Vagrant on Windows 10, it remains as a memo.

table of contents

・ Installation of VirtualBox ・ Installation of Vagrant ・ Construction of Linux environment

VirtualBox installation

-Click "Windows hosts" from VirtualBox official website to download the software. The latest version at this time is VirtualBox 6.1.4. 1.png

-Start the downloaded installer and install it according to the procedure. There are no special settings required. -Once the installation is complete, the following screen will be displayed. 2.png

This completes the VirtualBox installation.

Install Vagrant

-Select the Windows 64bit version from Vagrant official website and download it. 3.png

-Start the downloaded installer and install it according to the procedure. There are no special settings required. -After installation, restart your PC.

This completes the Vagrant installation.

Building a Linux environment

Prepare the environment to run Vagrant

In Vagrant, a virtual machine is created for each folder, so create a folder for executing "test1" here.

Example:
C:\tool\vagant\test1

Create a Vagrantfile

Open a Windows command prompt and execute the following command

㏅ C:\tool\vagant\test1

Next, create a Vagrantfile

vagrant init

4.png

This will create a file called Vagrantfile under the test1 folder.

Set Vagrantfile

Open the Vagrantfile file and modify the following two places

Correction 1
Before correction:
 config.vm.box = "base"
Revised:
  config.vm.box = "centos/7"  //Install Centos7
  config.vm.hostname= "192.168.33.10"  //Set the virtual machine IP
Correction 2 (just uncomment)
Before correction:
 # config.vm.network "private_network", ip: "192.168.33.10"
Revised:
  config.vm.network "private_network", ip: "192.168.33.10" 

Please refer to the following articles for the network that can be set with Vagrantfile. Vagrant Getting Started 04 --Vagrant Network Settings

Start a virtual machine

Initially start the virtual machine by executing the following command at the Windows command prompt.

vagrant up

The following error may occur during initial startup.

Error message:
Timed out while waiting for the machine to boot. This means that
Vagrant was unable to communicate with the guest machine within
the configured ("config.vm.boot_timeout" value) time period.

Countermeasure:
-From the administrator user, execute cmd to open a command prompt
・ "Dism.exe /Online /Disable-Feature:Microsoft-Hyper-Run the "V" command to Microsoft-Hyper-Close V

Virtual machine operation commands

After starting the virtual machine, you can operate it with the following command.

Log in to the virtual machine: vagrant ssh
Log out of the virtual machine:  exit
Stop the virtual machine: vagrant halt
Delete virtual machine: vagrant destroy

Recommended Posts

Memo of Linux environment construction using VirtualBox + Vagrant on Windows 10
Python environment construction memo on Windows 10
[Memo] Construction of cygwin environment
[Tensorflow] Tensorflow environment construction on Windows 10
Linux environment construction (on WSL environment)
Anaconda python environment construction on Windows 10
About Linux environment construction (VMware VirtualBOX)
Python environment construction memo on Mac
Memo of python + numpy/scipy/pandas/matplotlib/jupyterlab environment construction on M1 macOS (as of 2020/12/24)
Environment construction memo of pyenv + conda
Create a Linux environment on Windows 10
[Linux] Docker environment construction on Redhat
Environment construction of python3.8 on mac
Environment construction of "Tello_Video" on Ubuntu
Environment construction of TensorFlow + JupyterNotebook + Matplotlib on Windows version Anaconda (August 2017 version)
Linux environment construction
Process and result of connecting to SQL Server on windows from Linux virtual environment using JDBC driver
Environment construction procedure to operate chrome without installing python on Windows (using selenium)
python windows environment construction
Linux (WSL) on Windows
BigGorilla environment construction memo
Anaconda environment construction memo
Run Kali Linux on Windows with GUI (without VirtualBox)
[Heroku] Memo for deploying Python apps using Heroku on Windows [Python]
Cross development environment (developing programs for windows on linux)
I tried installing the Linux kernel on virtualbox + vagrant
NTP configuration memo on Linux
OpenJTalk on Windows10 (Speak Japanese with Python from environment construction)
About Linux environment construction (CentOS)
A memo on how to easily prepare a Linux exercise environment
Anaconda environment construction on CentOS7
Django development environment construction memo
First LAMP environment construction (Linux)
Prepare Chainer environment on Windows
Try using OpenCV on Windows
Build Python environment on Windows
Anaconda3 × Pycharm environment construction memo
Using Docker (Hyper-V) with PyCharm on Windows 10 (as of August 2017)
Django environment development on Windows 10
Build python environment on windows
Linux on Windows -1-: debian introduction
Python environment construction under Windows7 environment
[MEMO] [Development environment construction] Python
Environment construction of python2 & 3 (OSX)
Construction of Cortex-M development environment for TOPPERS using Raspberry Pi
Use Linux on Windows 10 (WSL2)
[MEMO] [Development environment construction] wine
A memo that reproduces the slide show (gadget) of Windows 7 on Windows 10.
I tried to create an environment of MkDocs on Amazon Linux
Environment construction of monitoring server Zabbix 4.4 on CentOS7 (Apache2.4 / PHP5.4 / MariaDB5.5)
DL Laravel environment construction method (Linux)
Environment construction of python and opencv
Start of self-made OS 1. Environment construction
(Windows10) Install Linux environment and gnuplot.
Install python2.7 on windows 32bit environment
Anaconda environment construction on Mac (2018 version)
[Django] Memorandum of environment construction procedure
Completion of docker command on Linux
[Linux] I installed CentOS on VirtualBox
[Python3] Development environment construction << Windows edition >>
Star Cluster environment construction work memo