BlackArch Linux on Vagrant

User root and vagrant use vagrant as password

Windows 10 のコマンドプロンプトを開きます。

Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\green>

C:\Users\green>cd C:\Vagrant\blackarch_linux

C:\Vagrant\blackarch_linux>vagrant init ph20/blackarch-core-x86_64

こちらを参照しました。
https://app.vagrantup.com/ph20/boxes/blackarch-core-x86_64

C:\Vagrant\blackarch_linux>cd ..

C:\Vagrant>vagrant plugin install vagrant-hostaupdater

Vagrantfile(C:\Vagrant\blackarch_linux)を下記のとおり編集しました。

# -*- 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 = "ph20/blackarch-core-x86_64"

  # 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 "forwarded_port", guest: 80, host: 8080, host_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 "../data", "/vagrant_data"

  # 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 = "1024"
  # 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
  # Puppet, Chef, Ansible, Salt, and Docker 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


C:\Vagrant>cd blackarch_linux

C:\Vagrant\blackarch_linux>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Box 'ph20/blackarch-core-x86_64' could not be found. Attempting to find and install...
    default: Box Provider: virtualbox
    default: Box Version: >= 0
==> default: Loading metadata for box 'ph20/blackarch-core-x86_64'
    default: URL: https://vagrantcloud.com/ph20/blackarch-core-x86_64
==> default: Adding box 'ph20/blackarch-core-x86_64' (v2017.05.13) for provider: virtualbox
    default: Downloading: https://vagrantcloud.com/ph20/boxes/blackarch-core-x86_64/versions/2017.05.13/providers/virtualbox.box
    default: Progress: 100% (Rate: 2093k/s, Estimated time remaining: --:--:--)
==> default: Successfully added box 'ph20/blackarch-core-x86_64' (v2017.05.13) for 'virtualbox'!
==> default: Importing base box 'ph20/blackarch-core-x86_64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ph20/blackarch-core-x86_64' is up to date...
==> default: Setting the name of the VM: blackarch_linux_default_1501818426850_5599
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
==> default: Forwarding ports...
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
    default:
    default: Vagrant insecure key detected. Vagrant will automatically replace
    default: this with a newly generated keypair for better security.
    default:
    default: Inserting generated public key within guest...
    default: Removing insecure key from the guest if it's present...
    default: Key inserted! Disconnecting and reconnecting using new SSH key...
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/Vagrant/blackarch_linux

C:\Vagrant\blackarch_linux>vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

C:\Vagrant\blackarch_linux>vagrant halt
==> default: Attempting graceful shutdown of VM...

C:\Vagrant\blackarch_linux>vagrant status
Current machine states:

default                   poweroff (virtualbox)

The VM is powered off. To restart the VM, simply run `vagrant up`

C:\Vagrant\blackarch_linux>

名前 blackarch_linux_default_1501818426850_5599
メインメモリー 512MB
プロセッサー 1
ビデオメモリー 8M

Oracle VM VirtualBoxスクリーンショットです。

https://cdn.scrot.moe/images/2017/08/04/2017-08-04_12h58_40.png

Vagrantfile(C:\Vagrant\blackarch_linux)を下記のとおり編集しました。

# -*- 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 = "ph20/blackarch-core-x86_64"

  # 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 "forwarded_port", guest: 80, host: 8080, host_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 "../data", "/vagrant_data"

  # 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 |v|
  #   # Display the VirtualBox GUI when booting the machine
    v.gui = true
  #
  #   # Customize the amount of memory on the VM:
    v.memory = 2048
    v.cpus = 2
    v.customize ["modifyvm", :id, "--vram", "128"]
  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
  # Puppet, Chef, Ansible, Salt, and Docker 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


Microsoft Windows [Version 10.0.15063]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\green>cd C:\Vagrant\blackarch_linux

C:\Vagrant\blackarch_linux>vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ph20/blackarch-core-x86_64' is up to date...
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
    default: Adapter 1: nat
    default: Adapter 2: hostonly
    default: Adapter 3: bridged
==> default: Forwarding ports...
    default: 80 (guest) => 8080 (host) (adapter 1)
    default: 80 (guest) => 8080 (host) (adapter 1)
    default: 22 (guest) => 2222 (host) (adapter 1)
==> default: Running 'pre-boot' VM customizations...
==> default: Booting VM...
==> default: Waiting for machine to boot. This may take a few minutes...
    default: SSH address: 127.0.0.1:2222
    default: SSH username: vagrant
    default: SSH auth method: private key
==> default: Machine booted and ready!
==> default: Checking for guest additions in VM...
==> default: Configuring and enabling network interfaces...
==> default: Mounting shared folders...
    default: /vagrant => C:/Vagrant/blackarch_linux
==> default: Machine already provisioned. Run `vagrant provision` or use the `--provision`
==> default: flag to force provisioning. Provisioners marked to run always will still run.

C:\Vagrant\blackarch_linux>vagrant provision

C:\Vagrant\blackarch_linux>vagrant status
Current machine states:

default                   running (virtualbox)

The VM is running. To stop this VM, you can run `vagrant halt` to
shut it down forcefully, or you can run `vagrant suspend` to simply
suspend the virtual machine. In either case, to restart it again,
simply run `vagrant up`.

C:\Vagrant\blackarch_linux>vagrant halt
==> default: Attempting graceful shutdown of VM...

C:\Vagrant\blackarch_linux>vagrant status
Current machine states:

default                   poweroff (virtualbox)

The VM is powered off. To restart the VM, simply run `vagrant up`

C:\Vagrant\blackarch_linux>

名前 BlackArch Linux  //編集しました
メインメモリー 2048MB
プロセッサー 2
ビデオメモリー 128M

Oracle VM VirtualBoxスクリーンショットです。

https://cdn.scrot.moe/images/2017/08/04/2017-08-04_13h23_03.png

Mutt & ttf-hanazonoのインストールについて

C:\Users\green>cd C:\Vagrant\blackarch_linux
C:\Vagrant\blackarch_linux>vagrant up
C:\Vagrant\blackarch_linux>vagrant ssh //ログインしました

[vagrant@blackarch-box ~]$ sudo pacman -Syy

[vagrant@blackarch-box ~]$ sudo pacman -S mutt
[vagrant@blackarch-box ~]$ sudo pacman -S ttf-hanazono

[vagrant@blackarch-box ~]$ cd ..
[vagrant@blackarch-box home]$ cd ..
[vagrant@blackarch-box /]$ ls -l
合計 52
lrwxrwxrwx  1 root    root        7  3月 26 21:57 bin -> usr/bin
drwxr-xr-x  3 root    root     4096  5月 13 13:19 boot
drwxr-xr-x 16 root    root     2860  8月  4 14:44 dev
drwxr-xr-x 47 root    root     4096  8月  4 14:12 etc
drwxr-xr-x  3 root    root     4096  5月 13 13:20 home
lrwxrwxrwx  1 root    root        7  3月 26 21:57 lib -> usr/lib
lrwxrwxrwx  1 root    root        7  3月 26 21:57 lib64 -> usr/lib
drwx------  2 root    root    16384  5月 13 13:16 lost+found
drwxr-xr-x  2 root    root     4096  3月 26 21:57 mnt
drwxr-xr-x  2 root    root     4096  3月 26 21:57 opt
dr-xr-xr-x 93 root    root        0  8月  4 14:44 proc
drwxr-x---  2 root    root     4096  3月 26 21:57 root
drwxr-xr-x 15 root    root      520  8月  4 14:45 run
lrwxrwxrwx  1 root    root        7  3月 26 21:57 sbin -> usr/bin
drwxr-xr-x  4 root    root     4096  3月 26 21:57 srv
dr-xr-xr-x 13 root    root        0  8月  4 14:44 sys
drwxrwxrwt  7 root    root      140  8月  4 14:44 tmp
drwxr-xr-x  8 root    root     4096  8月  4 13:38 usr
drwxrwxrwx  1 vagrant vagrant     0  8月  4 03:39 vagrant
drwxr-xr-x 12 root    root     4096  5月 13 13:20 var

[vagrant@blackarch-box /]$

Muttの設定について
[vagrant@blackarch-box ~]$ sudo mkdir -p /home/vagrant/.mutt/cache/headers
[vagrant@blackarch-box ~]$ sudo mkdir /home/vagrant/.mutt/cache/bodies
[vagrant@blackarch-box ~]$ sudo touch /home/vahrant/.mutt/certificates
[vagrant@blackarch-box ~]$ sudo touch /home/vagrant/.mutt/muttrc
[vagrant@blackarch-box ~]$ sudo nano /home/vagrant/.mutt/muttrc

下記のとおり編集しました。
set ssl_starttls = yes
set ssl_force_tls = yes
set imap_user = 'user_name@gmail.com'
set imap_pass = 'password'
set from = 'user_name@gmail.com'
set realname = 'Full Name'
set folder = 'imaps://imap.gmail.com/'
set spoolfile = 'imaps://imap.gmail.com/INBOX'
set postponed = 'imaps://imap.gmail.com/[Gmail]/Drafts'
set header_cache = '~/.mutt/cache/headers'
set message_cachedir = '~/.mutt/cache/bodies'
set certificate_file = '~/.mutt/certificates'
set smtp_url = 'smtps://user_name@gmail.com@smtp.gmail.com:465/'
set smtp_pass = 'password'
set move = no
set imap_keepalive = 900

タイムゾーンの設定について
[vagrant@blackarch-box ~]$ sudo bash
[root@blackarch-box vagrant]# whoami
root
[root@blackarch-box vagrant]# ln -sf /usr/share/zoneinfo/Asia/Tokyo /etc/localtime
[root@blackarch-box vagrant]# hwclock --systohc --utc

[vagrant@blackarch-box ~]$ sudo nano /etc/vconsole.conf
KEYMAP=jp106

ロケールの変更について
[vagrant@blackarch-box ~]$ sudo nano /etc/locale.gen
「en_US.UTF-8 UTF-8 & ja_JP.UTF-8 UTF-8」をアンコメントします。

[vagrant@blackarch-box ~]$ sudo locale-gen
Generating locales...
  en_US.UTF-8... done
  ja_JP.UTF-8... done
Generation complete.

[vagrant@blackarch-box ~]$ sudo nano /etc/locale.conf
下記のとおり編集しました。
LANG=ja_JP.UTF-8

[vagrant@blackarch-box ~]$ sudo localectl set-locale LANG=ja_JP.UTF-8

[vagrant@blackarch-box ~]$ localectl status
   System Locale: LANG=ja_JP.UTF-8
       VC Keymap: jp106
      X11 Layout: n/a
[vagrant@blackarch-box ~]$

[vagrant@blackarch-box ~]$ logout //ログアウトしました
Connection to 127.0.0.1 closed.

C:\Vagrant\blackarch_linux>vagrant halt

C:\Vagrant\blackarch_linux>vagrant status
Current machine states:
default                   poweroff (virtualbox)
The VM is powered off. To restart the VM, simply run `vagrant up`

C:\Vagrant\blackarch_linux>
C:\Vagrant\blackarch_linux>vagrant up
C:\Vagrant\blackarch_linux>vagrant ssh //ログインしました

[vagrant@blackarch-box ~]$ mutt
Muttスクリーンショットです。

https://cdn.scrot.moe/images/2017/08/05/2017-08-04_23h25_22.png

[vagrant@blackarch-box ~]$ logout //ログアウトしました
C:\Vagrant\blackarch_linux>vagrant halt
C:\Vagrant\blackarch_linux>vagrant status
Current machine states:
default                   poweroff (virtualbox)
The VM is powered off. To restart the VM, simply run `vagrant up`