kali-rolling dist(Linux kali 4.12.0-kali1-amd64 #1 SMP Debian 4.12.6-1kali6 (2017-08-30) x86_64 GNU/Linux)에 virtualbox를 설치하는 데 문제가 있습니다.
내 주요 목표는 Metasploitable3(https://github.com/rapid7/metasploitable3).
나는 packer와 vagrant를 설치했습니다.
root@kali:~/Desktop/metasploitable3# packer -v
1.1.3
root@kali:~/Desktop/metasploitable3# vagrant -v
Vagrant 2.0.1
시연하기 위해 Visualbox를 지우고 다시 설치했습니다.
root@kali:~/Desktop/metasploitable3# sudo apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,') virtualbox dkms virtualbox-dkms
Reading package lists... Done
Building dependency tree
Reading state information... Done
linux-headers-amd64 is already the newest version (4.14+89+kali1).
Suggested packages:
python3-apport vde2 virtualbox-guest-additions-iso
The following NEW packages will be installed:
dkms virtualbox virtualbox-dkms virtualbox-qt
0 upgraded, 4 newly installed, 0 to remove and 273 not upgraded.
Need to get 0 B/26.2 MB of archives.
After this operation, 111 MB of additional disk space will be used.
Selecting previously unselected package dkms.
(Reading database ... 343278 files and directories currently installed.)
Preparing to unpack .../archives/dkms_2.3-3_all.deb ...
Unpacking dkms (2.3-3) ...
Selecting previously unselected package virtualbox-dkms.
Preparing to unpack .../virtualbox-dkms_5.2.6-dfsg-2_all.deb ...
Unpacking virtualbox-dkms (5.2.6-dfsg-2) ...
Selecting previously unselected package virtualbox.
Preparing to unpack .../virtualbox_5.2.6-dfsg-2_amd64.deb ...
Unpacking virtualbox (5.2.6-dfsg-2) ...
Selecting previously unselected package virtualbox-qt.
Preparing to unpack .../virtualbox-qt_5.2.6-dfsg-2_amd64.deb ...
Unpacking virtualbox-qt (5.2.6-dfsg-2) ...
Processing triggers for mime-support (3.60) ...
Processing triggers for desktop-file-utils (0.23-2) ...
Processing triggers for menu (2.1.47+b1) ...
Setting up dkms (2.3-3) ...
Processing triggers for systemd (236-3) ...
Processing triggers for man-db (2.7.6.1-4) ...
Processing triggers for shared-mime-info (1.9-2) ...
Processing triggers for gnome-menus (3.13.3-11) ...
Processing triggers for hicolor-icon-theme (0.17-1) ...
Setting up virtualbox-dkms (5.2.6-dfsg-2) ...
Loading new virtualbox-5.2.6 DKMS files...
Building for 4.12.0-kali1-amd64
Module build for kernel 4.12.0-kali1-amd64 was skipped since the
kernel headers for this kernel does not seem to be installed.
Setting up virtualbox (5.2.6-dfsg-2) ...
vboxweb.service is a disabled or a static unit, not starting it.
Job for virtualbox.service failed because the control process exited with error code.
See "systemctl status virtualbox.service" and "journalctl -xe" for details.
invoke-rc.d: initscript virtualbox, action "restart" failed.
● virtualbox.service - LSB: VirtualBox Linux kernel module
Loaded: loaded (/etc/init.d/virtualbox; generated; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2018-01-31 10:15:25 CST; 7ms ago
Docs: man:systemd-sysv-generator(8)
Process: 22278 ExecStart=/etc/init.d/virtualbox start (code=exited, status=1/FAILURE)
Jan 31 10:15:25 kali systemd[1]: Starting LSB: VirtualBox Linux kernel module...
Jan 31 10:15:25 kali virtualbox[22278]: Loading VirtualBox kernel modules...No suitable module for running kernel found ... failed!
Jan 31 10:15:25 kali virtualbox[22278]: failed!
Jan 31 10:15:25 kali systemd[1]: virtualbox.service: Control process exited, code=exited status=1
Jan 31 10:15:25 kali systemd[1]: virtualbox.service: Failed with result 'exit-code'.
Jan 31 10:15:25 kali systemd[1]: Failed to start LSB: VirtualBox Linux kernel module.
Setting up virtualbox-qt (5.2.6-dfsg-2) ...
Processing triggers for systemd (236-3) ...
Processing triggers for menu (2.1.47+b1) ...
그런 다음 virtualbox GUI를 실행할 수 있습니다. 하지만 Metasploitable3 빌드 스크립트를 실행하려고 하면 다음 오류가 발생합니다.
root@kali:~/Desktop/metasploitable3# ./build_win2008.sh
./build_win2008.sh: line 14: cha: command not found
./build_win2008.sh: line 27: [[: WARNING:: syntax error in expression (error token is ":")
./build_win2008.sh: line 31: [[: WARNING:: syntax error in expression (error token is ":")
Compatible version of VirtualBox found.
Compatible version of packer was found.
Correct version of vagrant was found.
Compatible version of vagrant-reload plugin was found.
All requirements found. Proceeding...
Building the Vagrant box...
virtualbox-iso output will be in this color.
Build 'virtualbox-iso' errored: Error reading version for guest additions download: VirtualBox is not properly setup: WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-amd64.
You will not be able to start VMs until this problem is fixed.
5.2.6_Debianr120293
==> Some builds didn't complete successfully and had errors:
--> virtualbox-iso: Error reading version for guest additions download: VirtualBox is not properly setup: WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-amd64.
You will not be able to start VMs until this problem is fixed.
5.2.6_Debianr120293
==> Builds finished but no artifacts were created.
Error building the Vagrant box using Packer. Please check the output above for any error messages.Error reading version for guest additions download: VirtualBox is not properly setup: WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-amd64.
You will not be able to start VMs until this problem is fixed. 5.2.6_Debianr120293
뿐만 아니라:
Error reading version for guest additions download: VirtualBox is not properly setup: WARNING: The character device /dev/vboxdrv does not exist.
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-amd64.
You will not be able to start VMs until this problem is fixed.
5.2.6_Debianr120293
설치 실수로 인해 나중에 virtualbox-dkms 오류가 발생한 것 같습니다. 이와 비슷한 다른 질문을 찾았지만 문제가 해결되지 않았습니다.
감사해요.
답변1
Loading new virtualbox-5.2.6 DKMS files...
Building for 4.12.0-kali1-amd64
Module build for kernel 4.12.0-kali1-amd64 was skipped since the
kernel headers for this kernel does not seem to be installed.
그 다음에:
Please install the virtualbox-dkms package and the appropriate
headers, most likely linux-headers-amd64.
설치 virtualbox-dkms
되어 있지만linux-headers-amd64
버전 번호가 실행 중인 커널 패키지와 정확히 일치합니다.아니요. 이 문제를 해결한 후 이 dkms
명령을 사용하여 virtualbox 커널 모듈을 빌드하십시오.
답변2
방금 내 컴퓨터에서 이것을 시도했습니다.
다운로드하여 설치해야 합니다.
virtual-guest-add 5.2.6-1 (current version in the rolling repo)
packer
찾을 것으로 예상
/usr/share/virtualbox/VBoxGuestAdditions.iso
스크립트를 기다리는 시간을 절약하려면 다음에서 ISO를 다운로드할 수도 있습니다.
http://download.microsoft.com/download/7/5/E/75EC4E54-5B02-42D6-8879-D8D3A25FBEF7/7601.17514.101119-1850_x64fre_server_eval_en-us-GRMSXEVAL_EN_DVD.iso
그것은 packer
에서 찾는다
whereverYouPutIt/metasploitable3/iso/
...그것이 지금까지 얻은 것입니다(ISO를 기다리는 중). 하지만 게스트를 추가하면 즉각적인 문제가 해결될 것입니다.
편집하다
당신이 달릴 때, virtualbox 5.2
당신은 할 수 있습니다이것구성 파일을 조정합니다.
어제 만든 빌드에서 나도 만들어야 했어요이것wamp.bat
저장소에서 복제된 현재 스크립트가 git
데드 Wamp 링크를 가리키고 빌드가 실패하기 때문에 조정되었습니다 .
.box
또한 vagrant에 파일을 명시적으로 추가해야 했습니다.
vagrant box add -f metasploitable3 /path/to/build/metasploitable3/windows_2008_r2_virtualbox.box
vagrant up
이게 효과가 있어
virtualbox 5.2.6
$packer -v
1.0.4
$vagrant -v
Vagrant 1.9.1
$ uname -a
Linux kali 4.13.0-kali1-amd64 #1 SMP Debian 4.13.13-1kali1 (2017-11-17) x86_64 GNU/Linux