VirtualBox에 CentOS 7 설치 (enp0s3)

  다른 뜻에 대해서는 VirtualBox에 CentOS 7 설치 문서를 참조하십시오.
VirtualBox에 CentOS 7 설치하기

1 사전 작업[ | ]

2 VM 생성[ | ]

  • VirtualBox 실행
  • [새로 만들기(N)] 클릭
  • (가상 머신 만들기)[1] --- 이름: CentOS7[2] --- [다음(N)]
  • 메모리 크기[3] --- [다음(N)]
  • 하드 디스크[4] --- [만들기]
  • (가상 하드 디스크 만들기) 하드 디스크 파일 종류[5] --- [다음(N)]
  • (O) 동적 할당(D) --- [다음(N)]
  • (파일 위치 및 크기)[6] --- [만들기]

이제 CentOS7 이라는 VM이 보인다.

3 VM 시작, iso 마운트[ | ]

  • [시작(T)] 버튼 클릭하여 VM 시작
  • (시동 디스크 선택 창) iso 파일(예: CentOS-7-x86_64-DVD-1503-01.iso) 선택 --- [시작]

4 CentOS 7 설치[ | ]

  • 키를 눌러 Install CentOS 7 선택 Enter

(텍스트 모드에서 그래픽 모드로 전환됨)

  • (기본값) English --- [Continue]
  • [INSTALLATION DESTINATION] 클릭
  • 좌상단 [Done] 클릭
  • [Begin Installation] 클릭

(인스톨은 곧바로 시작되며, 진행과정 중에 ROOT PASSWORD 등 설정 가능함)

  • [ROOT PASSWORD] 클릭
  • Root Password: P@ssw0rd --- Confirm: P@ssw0rd --- [Done] 클릭

(... 계속 설치진행)

  • [Reboot] 클릭

5 리눅스 시작[ | ]

재부팅이 끝나면 리눅스 콘솔이 뜬다.

CentOS release 7 (Core)
Kernel 3.10.0-229.el7.x86_64 on an x86_64

localhost login:

root와 패스워드를 입력하여 로그인하자.

localhost login: root
Password: P@ssw0rd
[root@localhost ~]#

6 인터넷 연결[ | ]

[root@localhost ~]# ping 8.8.8.8
connect: Network is unreachable
[root@localhost ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:2a:8b:80 brd ff:ff:ff:ff:ff:ff
[root@localhost ~]# ifup enp0s3
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/0)
[root@localhost ~]# ping 8.8.8.8 -c2
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_req=13 ttl=29 time=323 ms
64 bytes from 8.8.8.8: icmp_req=14 ttl=29 time=339 ms
 
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1447ms
rtt min/avg/max/mdev = 323.499/331.351/339.204/7.873 ms

7 브리지, SSH 연결[ | ]

인터넷 공유기[7]를 사용하는 경우

  • (Oracle VM VirtualBox 관리자) CentOS7 우클릭 --- 설정(S)...
  • (CentOS7 - 설정) 네트워크 --- 다음에 연결됨(A): 브리지 어댑터 --- [확인]
  • (CentOS7 [실행중] - Oracle VM VirtualBox) 리눅스 쉘
ifcfg-enp0s3 파일이름을 ifcfg-enp0s3.orig로 변경 (비활성화, 보존)
ifcfg-eth0을 생성
[root@localhost ~]# cd /etc/sysconfig/network-scripts/
[root@localhost network-scripts]# ll ifcfg*
-rw-r--r--. 1 root root 277 Oct  5 22:34 ifcfg-enp0s3
-rw-r--r--. 1 root root 277 Oct  5 22:34 ifcfg-lo
[root@localhost ~]# mv /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s3.orig
[root@localhost ~]# vi /etc/sysconfig/network-scripts/ifcfg-eth0
TYPE=Ethernet
BOOTPROTO=dhcp
NAME=eth0
ONBOOT=yes
  • 네트워크 재시작
[root@localhost network-scripts]# service network restart
Restarting network (via systemctl):                        [   OK   ]
[root@localhost network-scripts]# ip addr | grep 'inet '
    inet 127.0.0.1/8 scope host lo
    inet 192.168.0.131/24 brd 192.168.0.255 scope global dynamic enp0s3
→ 공유기로부터 192.168.0.131라는 IP주소를 받았다.
  • 윈도우 cmd
C:\Users\jmnote>tcping -n 2 192.168.0.131 22

Probing 192.168.0.131:22/tcp - Port is open - time=12.070ms
Probing 192.168.0.131:22/tcp - Port is open - time=0.986ms

Ping statistics for 192.168.0.131:22
     2 probes sent.
     2 successful, 0 failed.
Approximate trip times in milli-seconds:
     Minimum = 0.986ms, Maximum = 12.070ms, Average = 6.528ms
→ 윈도우에서 VM의 22포트를 직접 접근할 수 있다.
→ PuTTY 등을 이용하여 리눅스 쉘에 접속해보자.
Connecting to 192.168.0.131:22...
Connection established.
To escape to local shell, press 'Ctrl+Alt+]'.

Last login: Mon Oct  5 22:57:02 2015
[root@localhost ~]# hostname
localhost.localdomain

8 사후 작업[ | ]

9 같이 보기[ | ]

10 주석[ | ]

  1. 가이드 모드... 그대로
  2. 자동으로... 종류(T): Linux, 버전(V): Red Hat (64-bit)가 됨
  3. 컴퓨터 사양에 따라 다를 것 같은데... 필자의 경우는 768 MB. 메모리가 부족하다면 512MB정도로 하자.
  4. 8.00 GB
  5. VDI
  6. 8.00 GB
  7. DHCP 기능 필수(대부분 있음)
문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}