Linux/Kali_Linux

칼리 리눅스 virtual box 설치 및 Centos 7 설치 ① / Install virtual box and install Centos 7 on Kali Linux ①

옥뀨 2020. 7. 2. 18:00

필자는 칼리 리눅스는 디버깅이나 툴을 이용하기 위한 목적으로 사용할 예정이고 추후 블로그에 올라올

프로그래밍 연습 및 해킹툴 만들기는 가상머신에서 할 예정이다.

I plan to use Kali Linux for debugging or to use tools.

on virtual machines,

I will making hacking tools and do programming exercises that will be posted on the blog later.

 

본 포스팅에서 가상머신을 구체적으로 설명하지는 않겠다.

In this post, I will not describe the virtual machine in detail.

 

가상머신이란 컴퓨터 환경을 소프트웨어로 구현해 놓은 것이라고 간단하게 이해하고 넘어가자.

Let's simply understand that a virtual machine is a computer environment implemented in software.

 

가상머신과 도커는 추후에 따로 정리해서 자세하게 올려놓을 예정이니 일단 설치를 진행해보자.

The virtual machine and docker will be posted separately in detail later, so let's proceed with the installation.

 

본 포스팅은 "centos 7" 설치를 위해 가상머신을 설치하는 과정을 다룬다.

This post covers the process of installing a virtual machine to install "centos 7".

 

먼저 centos 7 ISO 파일을 다운로드 받아보자.

First, let's download the centos 7 ISO file.

 

인터넷에서 "centos 7" 을 검색해보고 바로 "Download - CentOS"를 선택해서 사이트에 들어가보자.

Search for "centos 7" on the Internet and immediately select "Download-CentOS" to enter the site.

centos 7 다운로드(1) /centos 7 download(1)

7 버전을 다운받을 예정이므로 "7 (1908)" 을 선택하고 ISO란 바로 밑에 "x86_64" 를 선택하자.

Since version 7 is going to be downloaded, select "7 (1908)" and select "x86_64" directly under the ISO field.

 

64비트 운영체제를 다운로드 받겠다는 뜻이다.

This means that we will download a 64-bit operating system.

centos 7 다운로드(2) / centos 7 download(2)

그러면 어느 서버를 이용해 다운로드 받을 것인지 선택하는 창이 뜰 것이다.

This will open a window to choose which server to download.

 

필자는 카카오 서버를 이용해서 다운로드 받도록 하겠다.

I will download it using Kakao Server.

centos 7 download(3) / centos 7 download(3)

여기서 어떤 파일을 설치할 것인지 선택해야 한다.

Here we have to choose which files to install.

 

여러분은 입맛에 맞게 선택해서 설치해도 괜찮다.

You can choose and install according to your taste.

 

필자는 centos를 프로그래밍과 웹서버 용으로 사용할 예정이기에 제일 간소화된 파일을 받아 설치해보겠다.

I'm going to use centos for programming and web server, so I'm going to download and install the simplest file.

centos 7 다운로드(4) / centos 7 download(4)

다운로드 받은 파일을 확인해보자.

Let's check the downloaded file.

centos 7 이미지 파일 설치 완료 / Installation of centos 7 image file completed

이제 본격적으로 virtual box를 설치해보도록 하자.

Now let's install the virtualbox in earnest.

 

먼저 패키지 업데이트를 해주도록 하겠다.

First, we will update the package.

 

필자와 같이 "upgrade, dist-upgrade, autoremove, clean" 을 같이 해주어도 괜찮다. 

You can do "upgrade, dist-upgrade, autoremove, clean" together like I do.

 

$ sudo apt-get update

패키지 업데이트 / Package Update

"wget" 으로 먼저 키 값을 가져 오겠다.

we will get the key value first with "wget".

 

여기에 나오는 "-q" 옵션은 "quit"의 약자로 내용을 보여주지 않는다는 뜻이다.

The "-q" option here stands for "quit", which means it doesn't show anything.

 

뒤에 오는 "-O" 옵션은 파일을 다운로드하고 파일을 STDOUT에 출력한다는 뜻이고 뒤에 오는 "-" 는 버린다는 뜻이다.

The trailing "-O" option means to download the file and output the file to STDOUT,

and the trailing "-" to discard it.

 

그리고 "파이프"로 불리는 이 연산자 "|"는 앞에 나온 결과를 뒤의 입력값으로 바꾸는 연산자이다.

And the operator "|", called "pipe", is an operator that replaces the preceding result with the input after it.

 

결국 이 문구의 대략적인 뜻은 "https://www.virtualbox.org/download" 사이트에서 "oracle_vbox_2016.asc" 파일을 다운로드 받아 "key"를 키 리스트에 저장하고 버린다는 뜻이다.

After all, the approximate meaning of this phrase is to download the "oracle_vbox_2016.asc"  file from the

"www.virtualbox.org/download" site and save the "key" in the key list and discard it.

 

명령어를 입력하고 "OK" 표시가 나오면 정상적으로 등록되었다는 뜻이다.

If the command is entered and "OK" is displayed, it means that registration was successful.

 

$ wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -

키 리스트에 키 저장 / Save key to key list

"ls" 명령어를 쳐서 확인해보면 아마 ~.asc 파일은 없을 것이다. 키 값을 등록하고 버렸기 때문이다.

If we check it by typing "ls", there will probably be no ~.asc file.

This is because the key value is registered and discarded.

 

이젠 패키지 인덱스를 저장소에 추가할 차례이다.

Now it's time to add the package index to the repository.

 

지속적인 업데이트와 업그레이드를 하고 싶다면 저장소에 등록해야 한다.

If you want to keep updating and upgrading, you need to register in the repository.

 

이제 저장소에 등록해보자.

Now let's register in the repository.

 

여기 나오는 "echo" 명령어는 "메아리"라는 뜻과 같이 화면에 출력해준다는 뜻이고 "tee" 는 출력과 동시에

파일에 저장하는 명령어이다.

The "echo" command here means that it prints to the screen as if it means echoing,

and "tee" is a command that saves it to a file at the same time as the output.

 

$ echo "deb [arch=amd64] http://download.virtualbox.org/virtualbox/debian buster contrib" | sudo tee etc/apt/sources.list.d/virtualbox.list

저장소에 등록 / Register in the repository

저장소에 등록했으니 이제 저장소를 다시 업데이트해주자.

Now that we have registered in the repository, let's update the repository again.

 

업데이트를 했을 때 밑에 virtualbox에 대한 내용이 저장되어 업데이트되었음을 확인할 수 있다.

When updating, you can see that the contents of the virtualbox are saved and updated.

 

$ sudo apt-get update

저장소 추가 후 업데이트 / Update after adding to repository

아까 가상머신이란 컴퓨터 환경을 소프트웨어로 구현해 놓은 것이라고 얘기했었는데

가상머신에 운영체제를 설치한다는 것은 커널 외부에 또 다른 커널이 존재한다는 것이고 서로 상호작용을 해야 한다.

I mentioned earlier that a virtual machine is a software implementation of a computer environment,

and installing an operating system on a virtual machine means that another kernel exists outside the kernel,

and needs to interact with each other.

 

그러기에 일반 커널 소스 외부에 있는 커널 모듈을 업데이트해줘야 하는데 그 상호작용 역할을 해주는 것이 바로 DKMS이다.

Therefore, it is necessary to update the kernel module that is existing outside the normal kernel source,

and it is DKMS that serves as the interaction.

 

DKMS를 설치해주자.

Let's install DKMS.

 

$ sudo apt install -y dkms

dkms 설치 / dkms installation

virtualbox를 설치할 사전 준비는 다 끝났다.

The preliminary preparation to install the virtualbox is done.

 

이제 virtualbox를 설치해보자.

Now let's install virtualbox.

 

$ sudo apt install -y virtualbox virtualbox-ext-pack

virtualbox 설치 / virtualbox installation

설치하는 도중에 라이센스 메시지가 표시되는데 "tab 키" 를 눌른 후 "확인" 항목에서 "Enter 키" 를 눌러주자.

During installation, a license message is displayed. Press "Tab key", and then "Enter" in the "OK" item.

라이센스 확인 / Check license

라이센스에 동의하냐고 물어보는 문구가 나오면 "tab 키" 를 누른 후 "" 에서 "Enter 키" 를 눌러주자.

When asked if you want to accept the license, press "Tab key" and then "Enter" in "yes".

라이센스 동의 / License Agreement

그러면 설치가 이어서 진행된다.

The installation then continues.

나머지 설치 / Install the rest

설치가 완료되면 잘 설치되었는지 확인하기 위해 메뉴에 들어가서 "virtualbox"를 검색해보자.

When the installation is complete,

go to the menu and search for "virtualbox" to see if the installation was successful.

virtualbox 설치 확인 / Verify virtualbox installation

잘 설치되었다. 파일을 클릭하여 구동도 잘 되는지 확인해보자.

Well installed. Let's check if it works well by clicking the file.

virtualbox 구동 / virtualbox powered

문제 없이 구동하는 것을 확인했다.

We confirmed that it ran without any problems.

 

다음 포스팅에선 virtualbox에 centos 7 을 설치해보도록 하겠다.

In the next post, we will install centos 7 on the virtualbox.