4
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Kali LinuxをVagrantで構築

Posted at

概要

以前から興味のあったKali LinuxをVagrantで入れてみました。
基本的には公式の通りです。

環境

macOS Mojabe
Vagrant 2.2.3

作業

$ vagrant box add kalilinux/rolling

時間帯によって遅いかもしれません。
ボックスがダウンロード出来たら環境を作りたいディレクトリにて

$ vagrant init kalilinux/rolling

これでVagrantfileが作成されます。

$ vagrant up

この時点で上記コマンドを打つとVirtualBoxのUIがポップアップしKali Linuxの画面が表示されます。
なんでもKali toolsをGUIで使うことが多いためデフォルトはGUI表示するとのこと。

今回はheadlessで起動したいので、Vagrantfileを書き換えます。

Vagrantfile(公式より)
# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant.configure("2") do |config|
  config.vm.box = "kalilinux/rolling"

  # Create a forwarded port
  config.vm.network "forwarded_port", guest: 80, host: 8080

  # Create a private network. In VirtualBox, this is a Host-Only network
  config.vm.network "private_network", ip: "192.168.33.10"

  # VirtualBox specific settings
  config.vm.provider "virtualbox" do |vb|
    # Hide the VirtualBox GUI when booting the machine
    vb.gui = false

    # Customize the amount of memory on the VM:
    vb.memory = "4096"
  end

  # Provision the machine with a shell script
  config.vm.provision "shell", inline: <<-SHELL
    apt-get update
    apt-get install -y crowbar
  SHELL
end

リロードで読み直すと入れました。

$ vagrant reload
  
$ vagrant ssh
Linux kali 5.3.0-kali2-amd64 #1 SMP Debian 5.3.9-3kali1 (2019-11-20) x86_64

The programs included with the Kali GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Kali GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
vagrant@kali:~$

参考

4
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?