2012-11-03 17:06:32 +0000 2012-11-03 17:06:32 +0000
38
38
Advertisement

Nie można zainstalować VIrtualboxa, `"Specify KERN_DIR="` -- instalując Virtual Boxa na Debianie?

Advertisement

Otrzymuję ten błąd:

Makefile:181: *** Błąd: nie można znaleźć źródeł twojego bieżącego jądra Linuksa. Określ KERN_DIR= i uruchom Make ponownie. Stop.

W zasadzie robię:

$ sudo /etc/init.d/vboxdrv setup
Removing existing VirtualBox non-DKMS kernel modules [OK]
Building the VirtualBox Guest Additions kernel modules
The headers for the current running kernel were not found. If the following
module compilation fails then this could be the reason.
The missing package can be probably installed with
yum install kernel-devel-2.6.32-573.18.1.el6.x86_64

Building the main Guest Additions module [FAILED]
(Look at /var/log/vboxadd-install.log to find out what went wrong)

A błąd jest następujący:

Makefile:181: *** Błąd: nie można znaleźć źródeł twojego aktualnego jądra Linuksa. Określ KERN_DIR= i uruchom Make ponownie. Stop

Czym jest ten błąd i jak go naprawić?

Advertisement
Advertisement

Odpowiedzi (7)

34
34
34
2012-11-03 17:38:30 +0000

Upewnij się, że zainstalowałeś Kernel Headers Package. http://www.cyberciti.biz/faq/howto-install-kernel-headers-package

Make sure you have updated version

Type the following command
$ sudo apt-get update

OR as root user enter:
# apt-get update

Search for kernel version (optional)

Type the following command:
$ apt-cache search linux-headers-$(uname -r)

Install linux-header package under Debina or Ubuntu Linux

Type the following command:
$ sudo apt-get install linux-headers-$(uname -r)

OR as root user:
# apt-get install linux-headers-$(uname -r)

EDIT:

Tak się składa, że muszę go zainstalować również na moim własnym serwerze i dostałem ten sam błąd podczas próby użycia virtualboxa w debianowych repozytoriach. Poszedłem dalej i dodałem VirtualBox repo i zainstalowałem stamtąd. Jest to lepsze rozwiązanie, ponieważ są one bardziej aktualne.

Jako root

$ nano /etc/apt/sources.list

Dodaj poniższą linię dla squeeze

deb http://download.virtualbox.org/virtualbox/debian squeeze contrib non-free

Następnie dodaj The Oracle public key dla apt-secure

$ wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -

następnie uruchom update i zainstaluj najnowszy 4. 2

apt-get update
apt-get install virtualbox-4.2

Zainstaluj pakiet dkms, aby upewnić się, że moduły jądra hosta VirtualBox są aktualne

apt-get install dkms

Powinno być dobrze. Mam te instrukcje ze strony VirtualBoxa dla Linuksa, która wydaje się być w tej chwili niedostępna, ale link jest https://www.virtualbox.org/wiki/Linux_Downloads

29
29
29
2014-07-19 12:20:11 +0000

How to fix this for Fedora/CentOS

Najpierw upewnij się, że zainstalowane pakiety (zwłaszcza kernel) są aktualne:

$ sudo yum update

Jeśli zaktualizuje wersję kernela, będziesz musiał zrestartować system, aby uname -r pasowało do nazwy katalogu w /usr/src/kernels/. Następnie

$ sudo yum install kernel-devel gcc
$ echo export KERN_DIR=/usr/src/kernels/`uname -r` >> ~/.bashrc
$ source ~/.bashrc # to set the variable in your current shell
$ sudo echo $KERN_DIR # verify the value is set
$ sudo ls $KERN_DIR # verify the directory exists

Po tym kompilacja modułów jądra VirtualBoxa powinna działać bez problemów.

Źródła:

2
Advertisement
2
2
2015-10-23 02:03:00 +0000
Advertisement

Miałem błąd KERN_DIR w CentOS. Przejrzałem skrypt instalacyjny powłoki i odkryłem, że ustawia on KERN_DIR na /usr/src/kernels. Następnie wykonałem “uname -r” i okazało się, że uruchomiłem niższą wersję jądra … niż kod źródłowy pod /usr/src/kernels.

Spojrzałem na /boot/grub/menu.lst … i potwierdziłem niedopasowanie jądra. Dziwne.

Więc poprawka była … “yum -y update kernel”, a następnie ponowne uruchomienie. Następnie zainstalowały się narzędzia VMWare.

2
2
2
2013-05-28 18:05:47 +0000

@hh Powinieneś szukać tylko dla linux-headers i znaleźć dobry dla twojej architektury. W moim przypadku:

# aptitude search linux-headers      
v linux-headers -                                                                              
p linux-headers-2.6-amd64 - Header files for Linux amd64 configuration (dummy package)                   
p linux-headers-3.2.0-4-all - All header files for Linux 3.2 (meta-package)                                
p linux-headers-3.2.0-4-all-amd64 - All header files for Linux 3.2 (meta-package)                                
i A linux-headers-3.2.0-4-amd64 - Header files for Linux 3.2.0-4-amd64                                         
i A linux-headers-3.2.0-4-common - Common header files for Linux 3.2.0-4                                        
p linux-headers-3.2.0-4-common-rt - Common header files for Linux 3.2.0-4-rt                                     
p linux-headers-3.2.0-4-rt-amd64 - Header files for Linux 3.2.0-4-rt-amd64                                      
i linux-headers-amd64 - Header files for Linux amd64 configuration (meta-package)                    
p linux-headers-rt-amd64 - Header files for Linux rt-amd64 configuration (meta-package)

Więc w moim przypadku, mam 64-bitową architekturę, muszę zainstalować linux-headers-amd64.

Kolejną rzeczą jest to, że apt-get add nie istnieje. Zamień apt-get na apt-key.

1
Advertisement
1
1
2014-06-08 02:10:33 +0000
Advertisement

Spróbuj:

yum install kernel* dkms gcc

Następnie

yum install kernel-uek-devel

Następnie zrestartuj komputer.

0
0
0
2016-06-08 16:03:37 +0000

Błąd oznacza, że vboxdrv/vboxadd nie może znaleźć źródeł twojego kernela.

Skrypt oczekuje, że folder /lib/modules/$(uname -r)/build wskazuje na /usr/src/kernels/$(uname -r), który powinien mieć plik Makefile, gdzie może wykonać zadanie kernelrelease, więc może porównać z aktualnie zainstalowaną wersją jądra (uname -r).

Więc jeśli ta komenda się nie powiedzie:

make -C /usr/src/kernels/$(uname -r)/build kernelrelease

powinieneś zainstalować nagłówki Linuksa przez:

sudo apt-get install linux-headers-$(uname -r)

Aby uzyskać więcej szczegółów, sprawdź ten post .

0
Advertisement
0
0
2016-06-22 11:47:51 +0000
Advertisement

Dla każdego systemu operacyjnego musisz się upewnić, że wszystkie potrzebne pakiety są zainstalowane. W moim przypadku na Debianie brakowało mi pakietów dkms i linux-headers-generic.

#apt-get install dkms build-essential linux-headers-generic linux-headers-$(uname -r)

Dla pełnych instrukcji zobacz ten post na forum VirtualBox .

Advertisement

Pytania pokrewne

12
11
8
5
15
Advertisement