VirtualBox

위키 | 한국 데비안 사용자 모임
이동: 둘러보기, 검색

80x15.png 이 문서는 크리에이티브 커먼즈 저작자표시-동일조건변경허락 4.0 국제 라이선스에 따라 이용할 수 있습니다.

요약

리눅스(데비안 9.5 · 64비트)에서 버추얼박스(VirtualBox)를 설치하는 방법.

내려받기

버추얼박스

리눅스용 버추얼박스는 아래 주소에서 내려받을 수 있습니다.


버추얼박스의 최신 버전(2018년 10월 기준)은 5.2.18입니다. 테스트용 컴퓨터(64비트)에 데비안 9.5를 설치했으므로 virtualbox-5.2_5.2.18-124319~Debian~stretch_amd64.deb를 내려받았습니다.

westporch@host:~/다운로드$ wget https://download.virtualbox.org/virtualbox/5.2.18/virtualbox-5.2_5.2.18-124319~Debian~stretch_amd64.deb


버추얼박스 확장팩(Extension Pack)

버추얼박스 확장팩을 설치하면 USB 2.0, USB 3.0, 버추얼박스 원격 데스크톱 프로토콜(VirtualBox Remote Desktop Protocol, VRDP) 등의 기능을 사용할 수 있습니다. 자세한 사항은 아래 매뉴얼을 참고해주세요.


버추얼박스 확장팩을 설치할 때 주의할 점은 버추얼박스와 동일한 버전으로 설치해야 한다는 것입니다. 저는 버추얼박스와 동일한 5.2.18 버전으로 내려받았습니다.

westporch@host:~/다운로드$ wget https://download.virtualbox.org/virtualbox/5.2.18/Oracle_VM_VirtualBox_Extension_Pack-5.2.18.vbox-extpack


설치

버추얼박스

의존성 패키지 설치

버추얼박스(v5.2.18)를 설치하려면 우선 아래의 패키지(라이브러리)들을 설치해야 합니다. 사용 환경에 따라서 일부 패키지들은 이미 시스템에 설치되었을 수도 있습니다. 이럴 경우에는 아래 목록에서 설치되지 않은 패키지만 설치하면 됩니다.

  • libcurl3
  • libqt5core5a
  • libqt5gui5
  • libqt5opengl5
  • libqt5printsupport5
  • libqt5widgets5
  • libqt5x11extras5


의존성 패키지가 모두 설치되지 않았다는 가정하에, apt-get install 명령을 이용하여 위 패키지들을 설치합니다.

westporch@host:~$ sudo apt-get install libcurl3 libqt5core5a libqt5gui5 libqt5opengl5 libqt5printsupport5 libqt5widgets5 libqt5x11extras5


만약 시스템에 위 패키지들을 설치하지 않은채 virtualbox-5.2_5.2.18-124319~Debian~stretch_amd64.deb를 설치할 때 아래처럼 의존성 문제가 발생합니다.

westporch@host:~/다운로드$ sudo dpkg -i virtualbox-5.2_5.2.18-124319~Debian~stretch_amd64.deb 
Selecting previously unselected package virtualbox-5.2.
(데이터베이스 읽는중 ...현재 174324개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack virtualbox-5.2_5.2.18-124319~Debian~stretch_amd64.deb ...
Unpacking virtualbox-5.2 (5.2.18-124319~Debian~stretch) ...
dpkg: dependency problems prevent configuration of virtualbox-5.2:
 virtualbox-5.2 패키지는 다음 패키지에 의존: libcurl3 (>= 7.16.2): 하지만:
  libcurl3 패키지는 설치하지 않았습니다.
 virtualbox-5.2 패키지는 다음 패키지에 의존: libqt5core5a (>= 5.7.0): 하지만:
  libqt5core5a 패키지는 설치하지 않았습니다.
 virtualbox-5.2 패키지는 다음 패키지에 의존: libqt5gui5 (>= 5.4.0): 하지만:
  libqt5gui5 패키지는 설치하지 않았습니다.
 virtualbox-5.2 패키지는 다음 패키지에 의존: libqt5opengl5 (>= 5.0.2): 하지만:
  libqt5opengl5 패키지는 설치하지 않았습니다.
 virtualbox-5.2 패키지는 다음 패키지에 의존: libqt5printsupport5 (>= 5.0.2): 하지만:
  libqt5printsupport5 패키지는 설치하지 않았습니다.
 virtualbox-5.2 패키지는 다음 패키지에 의존: libqt5widgets5 (>= 5.7.0): 하지만:
  libqt5widgets5 패키지는 설치하지 않았습니다.
 virtualbox-5.2 패키지는 다음 패키지에 의존: libqt5x11extras5 (>= 5.6.0): 하지만:
  libqt5x11extras5 패키지는 설치하지 않았습니다.

dpkg: error processing package virtualbox-5.2 (--install):
 의존성 문제 - 설정하지 않고 남겨둠
Processing triggers for systemd (232-25+deb9u4) ...
Processing triggers for desktop-file-utils (0.23-1) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for hicolor-icon-theme (0.15-1) ...
Processing triggers for shared-mime-info (1.8-1+deb9u1) ...
처리하는데 오류가 발생했습니다:
 virtualbox-5.2


의존성 문제가 발생했지만 시스템의 패키지 목록에는 버추얼박스가 존재합니다.

westporch@host:~/다운로드$ dpkg -l | grep virtualbox
ii  virtualbox-5.2                        5.2.18-124319~Debian~stretch      amd64        Oracle VM VirtualBox


위와 같이 의존성 문제가 발생할 경우에는 버추얼박스를 삭제하고 의존성 패키지들을 설치한 후에, 다시 버추얼박스를 설치하면 됩니다.

버추얼박스는 아래 명령으로 삭제할 수 있습니다.

westporch@host:~/다운로드$ sudo dpkg --purge remove virtualbox-5.2


버추얼박스 설치

버추얼박스 확장팩 설치

westporch@host:~/다운로드$ ls
Oracle_VM_VirtualBox_Extension_Pack-5.2.18.vbox-extpack
debian-9.5.0-amd64-netinst.iso
virtualbox-5.2_5.2.18-124319~Debian~stretch_amd64.deb


리눅스용 버추얼박스에서는 VBoxManage extpack install[1] 명령을 이용하여 버추얼박스 확장팩을 설치합니다. 라이선스에 동의하는지 물어보는데 'y'를 입력한 후 엔터키를 누르면 됩니다.

westporch@host:~/다운로드$ VBoxManage extpack install Oracle_VM_VirtualBox_Extension_Pack-5.2.18.vbox-extpack 
VirtualBox Extension Pack Personal Use and Evaluation License (PUEL)

License version 10, 20 July 2017

PLEASE READ THE FOLLOWING ORACLE VM VIRTUALBOX EXTENSION PACK PERSONAL
USE AND EVALUATION LICENSE CAREFULLY BEFORE DOWNLOADING OR USING THE
ORACLE SOFTWARE. THESE TERMS AND CONDITIONS CONSTITUTE A LEGAL AGREEMENT
BETWEEN YOU AND ORACLE.

ORACLE AMERICA, INC. ("ORACLE") IS WILLING TO LICENSE THE PRODUCT DEFINED
IN SECTION 1 BELOW ONLY ON THE CONDITION THAT YOU ACCEPT ALL OF THE TERMS
CONTAINED IN THIS VIRTUALBOX EXTENSION PACK PERSONAL USE AND EVALUATION
LICENSE AGREEMENT ("AGREEMENT").

IF YOU ARE AGREEING TO THIS LICENSE ON BEHALF OF AN ENTITY (RATHER THAN
AS AN INDIVIDUAL HUMAN BEING), YOU REPRESENT THAT YOU HAVE THE APPROPRIATE
AUTHORITY TO ACCEPT THESE TERMS AND CONDITIONS ON BEHALF OF SUCH ENTITY.

1 SUBJECT OF AGREEMENT. This Agreement governs your use of the binary
software package called "Oracle VM VirtualBox Extension Pack" (the
"Product"), which contains a set of additional features for "Oracle
VM VirtualBox" that enhance the operation of multiple virtual machines
("Guest Computers") on a single physical computer ("Host Computer"). The
Product consists of executable files in machine code, script files,
data files, and all documentation and updates provided to You by Oracle.

2 GRANT OF LICENSE. Oracle grants you a personal, non-exclusive,
non-transferable, limited license without fees to reproduce, install,
execute, and use internally the Product on Host Computers for
your Personal Use, Educational Use, or Evaluation. "Personal Use"
is noncommercial use solely by the person downloading the Product
from Oracle on a single Host Computer, provided that no more than one
client or remote computer is connected to that Host Computer and that
client or remote computer is used solely to remotely view the Guest
Computer(s). "Educational Use" is any use by teachers or students in
an academic institution (schools, colleges and universities) as part of
the institution's educational curriculum. "Evaluation" means testing the
Product for up to thirty (30) days; after expiry of that term, you are
no longer permitted to use the Product. Personal Use and/or Educational
Use expressly exclude any use of the Product for commercial purposes or
to operate, run, or act on behalf of or for the benefit of a business,
organization, governmental organization, or educational institution.

Oracle reserves all rights not expressly granted in this license.

3 RESTRICTIONS AND RESERVATION OF RIGHTS.

(1) The Product and copies thereof provided to you under this Agreement
are copyrighted and licensed, not sold, to you by Oracle.

(2) You may not do any of the following: (a) modify any part of the
Product, except to the extent allowed in the documentation accompanying
the Product; (b) rent, lease, lend, re-distribute, or encumber the
Product; (c) remove or alter any proprietary legends or notices contained
in the Product; or (d) decompile, or reverse engineer the Product
(except to the extent permitted by applicable law).

(3) The Product is not designed, licensed or intended for use in the
design, construction, operation or maintenance of any nuclear facility
and Oracle and its licensors disclaim any express or implied warranty
of fitness for such uses.

(4) No right, title or interest in or to any trademark, service mark, logo
or trade name of Oracle or its licensors is granted under this Agreement.

4 TERMINATION. The Agreement is effective on the date you receive the
Product and remains effective until terminated. Your rights under this
Agreement will terminate immediately without notice from Oracle if
you materially breach it or take any action in derogation of Oracle's
and/or its licensors' rights to the Product. Oracle may terminate this
Agreement immediately should any part of the Product become or in Oracle's
reasonable opinion likely to become the subject of a claim of intellectual
property infringement or trade secret misappropriation. Upon termination,
you will cease use of and destroy all copies of the Product under your
control and confirm compliance in writing to Oracle. Sections 3-9,
inclusive, will survive termination of the Agreement.

5 DISCLAIMER OF WARRANTY. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW,
ORACLE PROVIDES THE PRODUCT "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
EXPRESS OR IMPLIED. WITHOUT LIMITING THE FOREGOING, ORACLE SPECIFICALLY
DISCLAIMS ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT. The entire risk as
to the quality and performance of the Product is with you. Should it
prove defective, you assume the cost of all necessary servicing, repair,
or correction.

6 LIMITATION OF LIABILITY. TO THE EXTENT NOT PROHIBITED BY APPLICABLE LAW,
IN NO EVENT WILL ORACLE OR ITS LICENSORS BE LIABLE FOR ANY LOST REVENUE,
PROFIT, DATA, OR DATA USE, OR FOR SPECIAL, INDIRECT, CONSEQUENTIAL,
INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER CAUSED REGARDLESS OF THE THEORY
OF LIABILITY, ARISING OUT OF OR RELATED TO THE USE OF OR INABILITY TO
USE THE PRODUCT, EVEN IF ORACLE HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES. In no event will Oracle's liability to you, whether in
contract, tort (including negligence), or otherwise, exceed the amount
paid by you for the Product under this Agreement.

7 SEPARATELY LICENSED THIRD PARTY TECHNOLOGY. The Product may contain
or require the use of third party technology that is provided with
the Product. Oracle may provide certain notices to you in the Product's
documentation, readmes or notice files in connection with such third party
technology. Third party technology will be licensed to you either under
the terms of this Agreement or, if specified in the documentation, readmes
or notice files, under Separate Terms. Your rights to use Separately
Licensed Third Party Technology under Separate Terms are not restricted
in any way by this Agreement. However, for clarity, notwithstanding the
existence of a notice, third party technology that is not Separately
Licensed Third Party Technology shall be deemed part of the Product and
is licensed to You under the terms of this Agreement. "Separate Terms"
refers to separate license terms that are specified in the Product's
documentation, readmes or notice files and that apply to Separately
Licensed Third Party Technology. "Separately Licensed Third Party
Technology" refers to third party technology that is licensed under
Separate Terms and not under the terms of this Agreement.

8 EXPORT. Export laws and regulations of the United States and any other
relevant local export laws and regulations apply to the Product. You
agree that such export laws govern your use of the Product (including
technical data) provided under this Agreement, and you agree to comply
with all such export laws and regulations (including "deemed export" and
"deemed re-export" regulations). You agree that no data, information,
and/or Product (or direct product thereof) will be exported, directly or
indirectly, in violation of these laws, or will be used for any purpose
prohibited by these laws including, without limitation, nuclear, chemical,
or biological weapons proliferation, or development of missile technology.

9 U.S. GOVERNMENT END USERS. Oracle programs, including the Product,
any operating system, integrated software, any programs installed on
hardware, and/or documentation, delivered to U.S. Government end users
are "commercial computer software" pursuant to the applicable Federal
Acquisition Regulation and agency-specific supplemental regulations. As
such, use, duplication, disclosure, modification, and adaptation of
the programs, including any operating system, integrated software,
any programs installed on the hardware, and/or documentation, shall
be subject to license terms and license restrictions applicable to the
programs. No other rights are granted to the U.S. Government.

10 MISCELLANEOUS. This Agreement is the entire agreement between you
and Oracle relating to its subject matter. It supersedes all prior or
contemporaneous oral or written communications, proposals, representations
and warranties and prevails over any conflicting or additional terms
of any quote, order, acknowledgment, or other communication between
the parties relating to its subject matter during the term of this
Agreement. No modification of this Agreement will be binding, unless in
writing and signed by an authorized representative of each party. If any
provision of this Agreement is held to be unenforceable, this Agreement
will remain in effect with the provision omitted, unless omission would
frustrate the intent of the parties, in which case this Agreement will
immediately terminate. This Agreement is governed by the laws of the
State of California, USA, and you and Oracle agree to submit to the
exclusive jurisdiction of, and venue in, the courts of San Francisco
or Santa Clara counties in California in any dispute arising out of or
relating to this Agreement.

Do you agree to these license terms and conditions (y/n)? y

License accepted. For batch installaltion add
--accept-license=56be48f923303c8cababb0bb4c478284b688ed23f16d775d729b89a2e8e5f9eb
to the VBoxManage command line.

0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100%
Successfully installed "Oracle VM VirtualBox Extension Pack".


게스트 확장

가상 머신을 생성한 후에 해당 가상 머신에 게스트 확장을 설치하면, 가상머신을 좀 더 효율적으로 사용할 수 있습니다. 편의상 설치 절에 배치하였습니다.

아직 가상 머신을 생성하지 않았다면 우선 이 절은 건너 뛰어도 괜찮습니다.


게스트 확장은 다음과 같은 기능을 제공합니다.

  • 호스트 머신과 가상 머신 간의 클립보드 공유
  • 가상 머신의 창 크기를 조절했을 때, 창의 크기에 맞게 화면의 비율이 조절됨.


게스트 확장의 자세한 기능은 아래 매뉴얼을 참고해주세요.


의존성 패키지 설치

게스트 확장을 설치하려면 우선 아래 패키지들을 설치해야 합니다. 사용 환경에 따라서 일부 패키지들은 이미 시스템에 설치되었을 수도 있습니다. 이럴 경우에는 아래 목록에서 설치되지 않은 패키지만 설치하면 됩니다.

  • linux-headers-amd64
  • linux-headers-4.9.0-7-amd64
  • gcc
  • make
  • perl


의존성 패키지가 모두 설치되지 않았다는 가정하에, apt-get install 명령을 이용하여 위 패키지들을 설치합니다.

westporch@vm:/~$ sudo apt-get install linux-headers-amd64 linux-headers-4.9.0-7-amd64 gcc make perl

게스트 확장 설치

게스트 확장을 설치할 가상 머신을 실행한 후에, 버추얼박스의 상단에 있는 메뉴에서 '장치'를 클릭한 후에 '게스트 확장 CD 이미지 삽입'을 클릭합니다. 이때 '게스트 확장 CD 이미지'가 자동으로 마운트 됩니다. 데비안은 /media/cdrom에 마운트 되며, 윈도우는 주로 D 드라이브에 마운트 됩니다.

만약 데비안에서 /mdedia/cdrom 디렉터리에 '게스트 확장 CD 이미지'가 마운트 되지 않았다면, 아래 명령을 사용하여 수동으로 마운트 해야 합니다.[2]

westporch@vm:/~$ sudo mount /dev/sr0 /media/cdrom


이제 /media/cdrom 디렉터리에 가면 마운트 된 디렉터리 및 파일들을 확인할 수 있습니다.

westporch@vm:~$ cd /media/cdrom
westporch@vm:/media/cdrom$ ls
32Bit			OS2						VBoxSolarisAdditions.pkg		VBoxWindowsAdditions.exe	runasroot.shall
64Bit			TRANS.TBL				VBoxWindowsAdditions-amd64.exe	autorun.sh
AUTORUN.INF		VBoxLinuxAdditions.run	VBoxWindowsAdditions-x86.exe	cert


우리가 실행할 프로그램은 VBoxLinuxAdditions.run입니다. /meda/cdrom 디렉터리에서는 설치할 수 없으므로 VBoxLinuxAdditions.run 파일을 적당한 곳으로 복사한 후에 설치를 해야 합니다. 저는 홈 디렉토리(~)로 복사하겠습니다.

westporch@vm:/media/cdrom$ sudo cp VBoxLinuxAdditions.run ~


홈 디렉토리로 이동한 후에 VBoxLinuxAdditions.run 파일을 실행합니다.

westporch@vm:/media/cdrom$ ~
westporch@vm:/~$ sudo ./VBoxLinuxAdditions.run
Uncompressing VirtualBox 5.2.10 Guest Additions for Linux........
VirtualBox Guest Additions installer
Removing installed version 5.2.10 of VirtualBox Guest Additions...
Copying additional installer modules ...
Installing additional modules ...
VirtualBox Guest Additions: Building the VirtualBox Guest Additions kernel modules.
VirtualBox Guest Additions: Starting.


이제 시스템을 다시 시작하면 게스트 확장 기능을 사용할 수 있습니다.

westporch@vm:/~$ sudo reboot

버추얼박스 실행

virtualbox 명령을 실행하면 버추얼박스가 실행됩니다.

westporch@host:~$ virtualbox 


GUI에 익숙한 사용자라면 위 방법은 불편할 수도 있습니다. 데비안 9.5(데스크톱 환경으로 MATE를 사용)에서 버추얼박스를 설치했지만 패널의 프로그램 목록에 버추얼박스는 보이지 않습니다. 이럴 경우에는 아래와 같은 과정으로 패널에 수동으로 실행 아이콘을 추가하면, 클릭만으로 버추얼박스를 간단하게 실행할 수 있습니다.

① MATE 패널에 마우스 포인터를 놓고 오른쪽을 클릭
② '패널에 추가'를 클릭
③ '사용자 지정 프로그램 실행 아이콘'을 클릭 
④ '추가' 클릭
⑤  이름과 명령어 입력
   이름: VirtualBox 
   명령어: /usr/bin/virtualbox
⑥ '확인' 클릭


부록

버추얼박스 버전

버전 5.2.18 r124319 (Qt5.7.1)


라이선스

버추얼박스

GPLv2[3]


버추얼박스 확장팩

VirtualBox Personal Use and Evaluation License (PUEL)


각주