然后做一些准备工作:
ben@vbox:~> sudo zypper refresh Repository '163/NON-Oss' is up to date. Repository '163/Oss' is up to date. Repository '163/Update' is up to date. Repository 'Updates for openSUSE 12.1 12.1-1.4' is up to date. Repository 'openSUSE-12.1-Non-Oss' is up to date. Repository 'openSUSE-12.1-Oss' is up to date. All repositories have been refreshed. ben@vbox:~> sudo zypper update Loading repository data... Reading installed packages... Nothing to do. ben@vbox:~> sudo zypper install make gcc Loading repository data... Reading installed packages... 'gcc' is already installed. No update candidate for 'gcc-4.6-15.1.3.x86_64'. The highest available version is already installed. 'make' is already installed. No update candidate for 'make-3.82-147.1.2.x86_64'. The highest available version is already installed. Resolving package dependencies... Nothing to do. ben@vbox:~> uname -a Linux vbox 3.1.9-1.4-desktop #1 SMP PREEMPT Fri Jan 27 08:55:10 UTC 2012 (efb5ff4) x86_64 x86_64 x86_64 GNU/Linux ben@vbox:~> sudo zypper install kernel-desktop-devel Loading repository data... Reading installed packages... 'kernel-desktop-devel' is already installed. No update candidate for 'kernel-desktop-devel-3.1.9-1.4.1.x86_64'. The highest available version is already installed. Resolving package dependencies... Nothing to do.也就是说要先安装好 make、gcc 和 kernel-desktop-devel 软件包,从上面可以看出,我的机器上以前已经安装过这些软件包了。
另外,需要先安装好 dkms 软件包:
Be sure to install DKMS before installing the Linux Guest Additions. If DKMS is not available or not installed, the guest kernel modules will need to be recreated manually whenever the guest kernel is updated using the command /etc/init.d/vboxadd setup as root.但是 openSUSE 操作系统不支持 dkms,而其他主流的 Linux 操作系统基本上都支持 dkms。这是很糟糕的,如上所述,以后 openSUSE 操作系统的内核 kernel 有升级的话,每次都要手动运行一次 sudo /etc/init.d/vboxadd setup 命令了。
开始安装现在,把 VirtualBox 软件安装目录下的 VBoxGuestAdditions.iso 文件拷贝到 openSUSE 操作系统中,然后:
ben@vbox:~/repo/VBoxGuestAdditions> 7z x VBoxGuestAdditions.iso 7-Zip [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18 p7zip Version 9.20 (locale=en_US.UTF-8,Utf16=on,HugeFiles=on,1 CPU) Processing archive: VBoxGuestAdditions.iso Extracting 32Bit Extracting 32Bit/OS2 Extracting 32Bit/OS2/VBoxGuest.sys Extracting 32Bit/OS2/VBoxService.exe Extracting 32Bit/OS2/gengradd.dll Extracting 32Bit/OS2/libc063.dll Extracting 32Bit/OS2/readme.txt Extracting 32Bit/OS2/vboxmouse.sys Extracting 32Bit/Readme.txt Extracting 64Bit Extracting 64Bit/Readme.txt Extracting AUTORUN.INF Extracting VBoxLinuxAdditions.run Extracting VBoxSolarisAdditions.pkg Extracting VBoxWindowsAdditions-amd64.exe Extracting VBoxWindowsAdditions-x86.exe Extracting VBoxWindowsAdditions.exe Extracting autorun.sh Extracting runasroot.sh Everything is Ok Folders: 3 Files: 16 Size: 50349560 Compressed: 50751488 ben@vbox:~/repo/VBoxGuestAdditions> sudo ./VBoxLinuxAdditions.run Verifying archive integrity... All good. Uncompressing VirtualBox 4.1.10 Guest Additions for Linux......... VirtualBox Guest Additions installer insserv: warning: script 'S01atop' missing LSB tags and overrides insserv: warning: script 'atop' missing LSB tags and overrides insserv: warning: script 'S01atop' missing LSB tags and overrides insserv: warning: script 'atop' missing LSB tags and overrides Removing existing VirtualBox DKMS kernel modules done Removing existing VirtualBox non-DKMS kernel modules done Building the VirtualBox Guest Additions kernel modules Building the main Guest Additions module done Building the shared folder support module done Building the OpenGL support module done Doing non-kernel setup of the Guest Additions done You should restart your guest to make sure the new modules are actually used insserv: warning: script 'S01atop' missing LSB tags and overrides insserv: warning: script 'atop' missing LSB tags and overrides insserv: warning: script 'S01atop' missing LSB tags and overrides insserv: warning: script 'atop' missing LSB tags and overrides insserv: warning: script 'S01atop' missing LSB tags and overrides insserv: warning: script 'atop' missing LSB tags and overrides insserv: warning: script 'S01atop' missing LSB tags and overrides insserv: warning: script 'atop' missing LSB tags and overrides Installing the Window System drivers failed (Could not find the X.Org or XFree86 Window System.)