본문 바로가기

Technical/Cloud, Virtualization, Containers

OpenSuse 12.x host에서 virtualbox 설치 사용시 주의


Linux host에서 가상화 지원 솔루션 중 VirtualBox를 설치하고 사용하는 경우에, 특히 OpenSuse 12.x 환경에서 virtualbox 를 설치하고, VM을 사용하고자 할 경우(ubuntu 등 기타 linux에서도 비슷하게 적용될 듯)에 주의 사항이 있다.


virtualbox를 https://www.virtualbox.org/wiki/Downloads 에서 다운로드 받고 설치, VirtualBox 기동 후 extpack 까지 설치하고 난 후, virtualbox 메뉴에서 vm을 생성하고 머신을 시작하려고 하면 "virtualbox kernel driver not installed (rc=-1908)" 라는 메시지 창이 뜨고 '/etc/init.d/vboxdrv setup' 을 실행하라고 경고창이 뜨게 된다. 이제 터미널 창에서 '/etc/init.d/vboxdrv setup' 이라고 실행하게 되는데......


이 때, 만약 커널 소스가 linux 에 설치되어 있지 않다면

/etc/init.d/vboxdrv setup

Stopping VirtualBox kernel modules          done

Recompiling VirtualBox kernel modules     failed

라고 오류가 발생되고 더 이상 진행이 되지 않는다. 또 경고창에 나타난 대로 아래와 같이 log를 조회해 보면 오류가 나타남을 알 수 있다.

# cat /var/log/vbox-install.log

Makefile: 181:  *** Error: unable to find the source of your current linux kernel. Specify KERN_DIR=<directorty> and run Make again. Stop.

...

 

이는, virtualbox가 설치되면 kernel module을 로드하기 위해서 해당 커널모듈을 컴파일하게 되는데, 커널 소스가 설치되지 않은 경우에 만날 수 있는 에러 상황이다.


터미널 명령으로 아래와 같이 실행하면 문제를 해결할 수 있다(root 권한으로 실행, 아래는 Suse 계열의 linux에 대한 명령이며, OS에 맞춰 yum, apt-get 과 같은 패키지 설치 명령을 사용하면 된다)

# zypper search kernel-source (=> OS에 따라 kernel-sources 로 나타나는 경우도 있음)

# zypper refresh

# zypper in -y kernel-source

# /etc/init.d/vboxdrv restart

# /etc/init.d/vboxdrv setup

Stopping VirtualBox kernel modules            done

Recompiling VirtualBox kernel modules       done

Starting VirtualBox kernel modules              done