I installed CentOS 8 on Windows 10 using VirtualBox and Vagrant

Introduction

The site was using VirtualBox and Vagrant

reference

Introducing CentOS 8 virtual environment with VirtualBox and Vagrant (Windows 10)

Installation

I didn't have any particular problems How to install VirtualBox Vagrant installation procedure (Windows 10, CentOS 7.2, Vagrant 1.9.5, VirtualBox 5.1.22)

Pycharm The console usually uses Pycharm. PowerShell is specified

The folder I usually use for the development environment is "dev", so "cd" to that point. There are already ".vagrant" and "Vagrantfile", but this is the result screen. From now on, these two files will be created. image.png

I think CentOS download will take about 8 minutes


dev> vagrant box add generic/CentOS8
  1) docker
  2) hyperv
  3) libvirt
  4) parallels
  5) virtualbox
  6) vmware_desktop

  Enter your choice: 5
dev> vagrant init generic/CentOS8

Make vim available

Does Windows have vi ... and does it have "vi" ... How to use the text editor "Vim" on Windows

Editing Vagrantfile

Major changes Uncomment config.vm.network" forwarded_port ", guest: 80, host: 8080, host_ip:" 127.0.0.1 " Changed to config.vm.network" private_network ", ip:" 127.0.0.1 " Uncomment config.vm.synced_folder" ../ data "," / vagrant_data " Changed to config.vm.synced_folder"./ "," / var / www " config.vm.provider "virtualbox" do |vb|And a few lines downendUncomment Uncomment vb.memory =" 1024 "`` vb.memory = "2048"

dev> vim Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :

# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
  # The most common configuration options are documented and commented below.
  # For a complete reference, please see the online documentation at
  # https://docs.vagrantup.com.

  # Every Vagrant development environment requires a box. You can search for
  # boxes at https://vagrantcloud.com/search.
  config.vm.box = "generic/CentOS8"

  # Disable automatic box update checking. If you disable this, then
  # boxes will only be checked for updates when the user runs
  # `vagrant box outdated`. This is not recommended.
  # config.vm.box_check_update = false

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine. In the example below,
  # accessing "localhost:8080" will access port 80 on the guest machine.
  # NOTE: This will enable public access to the opened port
  # config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a forwarded port mapping which allows access to a specific port
  # within the machine from a port on the host machine and only allow access
  # via 127.0.0.1 to disable public access
  config.vm.network "private_network", ip: "127.0.0.1"

  # Create a private network, which allows host-only access to the machine
  # using a specific IP.
  # config.vm.network "private_network", ip: "192.168.33.10"

  # Create a public network, which generally matched to bridged network.
  # Bridged networks make the machine appear as another physical device on
  # your network.
  # config.vm.network "public_network"

  # Share an additional folder to the guest VM. The first argument is
  # the path on the host to the actual folder. The second argument is
  # the path on the guest to mount the folder. And the optional third
  # argument is a set of non-required options.
  config.vm.synced_folder "./", "/var/www"

  # Provider-specific configuration so you can fine-tune various
  # backing providers for Vagrant. These expose provider-specific options.
  # Example for VirtualBox:
  #
  config.vm.provider "virtualbox" do |vb|
  #   # Display the VirtualBox GUI when booting the machine
  #   vb.gui = true
 
    # Customize the amount of memory on the VM:
    vb.memory = "2048"
  end
  #
  # View the documentation for the provider you are using for more
  # information on available options.

  # Enable provisioning with a shell script. Additional provisioners such as
  # Ansible, Chef, Docker, Puppet and Salt are also available. Please see the
  # documentation for more information about their specific syntax and use.
  # config.vm.provision "shell", inline: <<-SHELL
  #   apt-get update
  #   apt-get install -y apache2
  # SHELL
end

Confirmation

Oh! I wanted to go. You can see the Python directory properly. I'm happy that I don't have to change the existing directory structure (there is no rule to put it in the vagrant directory)

Console


dev> vagrant up
dev> vagrant ssh
[vagrant@CentOS8 ~]$ cd /var/www
[vagrant@CentOS8 www]$ ls
  Arduino  Gas  Php  Portfolio  Python  Qgis  Vagrantfile  Vba

Japanese locale

How to add Japanese locale to CentOS 7 Vagrant box of v1801.01 date hasn't changed for some reason

[root@CentOS8 vagrant]# localectl set-locale LANG=ja_JP.UTF-8
[root@centos8 vagrant]# localectl status
   System Locale: LANG=ja_JP.UTF-8
       VC Keymap: us
      X11 Layout: n/a

[root@CentOS8 vagrant]# date
  Sat Oct 10 05:22:38 UTC 2020 (* Currently Sat Oct 10 14:23:00)

Change to Python command

python3 → python

Console


[root@centos8 vagrant]# python3 --version
  Python 3.6.8

(* Select 2)
[root@centos8 vagrant]# alternatives --config python
  There are 2 programs which provide 'python'.
    Selection    Command
  -----------------------------------------------
  *+ 1           /usr/libexec/no-python
     2           /usr/bin/python3
  Enter to keep the current selection[+], or type selection number: 2

[root@centos8 vagrant]# python --version
  Python 3.6.8

[root@centos8 vagrant]#

Change to pip command

(* There is no pip)
[root@centos8 vagrant]# pip --version
  bash: pip: command not found
[root@centos8 vagrant]# which pip
  /usr/bin/which: no pip in (/sbin:/bin:/usr/sbin:/usr/bin)

(* Pip3 is annoying)
[root@centos8 vagrant]# which pip3
  /bin/pip3

(* Change alias)
[root@centos8 vagrant]# sudo ln -s /usr/bin/pip3 /usr/bin/pip

(* Come out with pip)
[root@centos8 vagrant]# pip --version
  pip 9.0.3 from /usr/lib/python3.6/site-packages (python 3.6)

[root@centos8 vagrant]#

Apache (Web server)

Installation

Console


[root@centos8 vagrant]# dnf -y install httpd httpd-devel gcc

Displaying line numbers in vi


:set number

httpd.conf

Console


# vi /etc/httpd/conf/httpd.conf

#Line 89: Specify administrator address
ServerAdmin [email protected]
#Line 98: Uncomment and specify server name
ServerName 127.0.0.1:8000
#Line 147: Change(Remove Indexes)
Options FollowSymLinks
#Line 154: Change
AllowOverride All
#Line 167: Added if necessary(File name index that can be accessed only by directory name.php etc)
DirectoryIndex index.html
#Line 319: Confirmation (UTF)-I think it's 8, but if it's not, change it)
AddDefaultCharset UTF-8

#Added to the last line
#Server response header
ServerTokens Prod
#Keepalive on
KeepAlive On

Apply settings


[root@centos8 vagrant]# systemctl enable --now httpd
  Created symlink /etc/systemd/system/multi-user.target.wants/httpd.service → /usr/lib/sy
stemd/system/httpd.service.

Django3

Installation

Console


# pip install django==3.0
# django-admin --version
  3.0

MySQL8

Installation

(It seems that you can only enter if you are root)

Console


# dnf module -y install mysql:8.0
# vi /etc/my.cnf.d/mysql-server.cnf

my.cnf (Addition to the bottom line results in[mysqld]Will be written in the section)


character-set-server=utf8
[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqldump]
default-character-set=utf8

Console (MySQL will start after a reboot)


# systemctl enable --now mysqld

Console


# firewall-cmd --add-service=mysql --permanent
  success
# firewall-cmd --reload
  success

Recommended Posts

I installed CentOS 8 on Windows 10 using VirtualBox and Vagrant
Install Java 9 on windows 10 and CentOS 7
I installed F-Revo CRM 7.3 on CentOS 7.7
I installed Docker on EC2 and started it
How to share on the host side (windows) and guest side (CentOS 7) with VirtualBox
I built an Ubuntu environment on Windows 10 using WSL2.
Easily build Redmine on Windows using WSL2 and Docker
I tried using YOLO v4 on Ubuntu and ROS
I tried using Docker Desktop for Windows on Windows 10 Home
Ruby on Rails environment construction using VirtualBox, Vagrant, cyberduck
# Vagrant + VirtualBOx can't mount on the latest CentOS7 vbox (centos/7 2004.01)
I installed Squid on CentOS in my local environment
[Amateur remarks] CentOS 8 was installed on Raspberry Pi 4 8G, and Wordpress was built using Docker-Compose.
Install Apache on CentOS on VirtualBox
How to create an environment that uses Docker (WSL2) and Vagrant (VirtualBox) together on Windows
I installed TinyTinyRSS on Cent OS 8
Enable Openjdk10 and maven on CentOS
Install ngrok on ubuntu16.04 using Vagrant
Install Ruby 2.5 on CentOS 7 using SCL
Installed on Lombok Mac (using STS)
I tried installing CentOS 8 on ESXi 6.7
Using Docker on Windows10 Home WSL2
Installing and using Ansible on Ubuntu 16.04
Instructions for installing and using the AWS command line (awscli) on CentOS
Let's install Docker on Windows 10 and create a verification environment for CentOS 8!
STS installation and Japanese localization on Windows 10
I tried running Docker on Windows Server 2019
Using JupyterLab + Java with WSL on Windows 10
I installed Docker on my Raspberry Pi 3
I tried to build AdoptOpenjdk 11 on CentOS 7
Installing and configuring ClipBucket and Nginx on CentOS 7
Switch between GUI and CUI on CentOS6.
I tried using "nifty cloud mobile backend" and "Firebase" Authentication on Kotlin + Android
I was addicted to using RXTX on Sierra
Until Docker Desktop is installed and started (Windows10)
I tried using Junit on Mac VScode Maven
Install java and android-sdk on Mac using homebrew
HelloWorld using OpenJDK on CentOS8 after brain death
[Android] I quit SQLite and tried using Realm
Try local file search using Fess on CentOS7
Try local file search using Fess on CentOS8
I tried OmniSci on CentOS 7 + GeForce RTX 2080 Ti.
[Solution] Java cannot be installed on Windows 10 + ATOK 2017
A memorandum when CentOS is installed in VirtualBox and basic settings are made [macOS]
Eh !? Run Linux on Windows? I can do it! !! (I set WSL2 and put Ubuntu)