如果是Centos請安裝以下兩個套件再進行下面的動作
yum update
yum install gcc
yum install gcc make
yum install kernel
yum install kernel-devel
root@server:/# mount /dev/cdrom /media
mount:區塊裝置 /dev/sr0 為防寫,即將以唯讀方式掛載
root@server:/# cd media
root@server:/media# ls
32Bit autorun.sh runasroot.sh VBoxWindowsAdditions-amd64.exe
64Bit cert VBoxLinuxAdditions.run VBoxWindowsAdditions.exe
AUTORUN.INF OS2 VBoxSolarisAdditions.pkg VBoxWindowsAdditions-x86.exe
root@server:/media# sh /mnt/media/VBoxLinuxAdditions.run
Verifying archive integrity... All good.
Uncompressing VirtualBox 4.2.6 Guest Additions for Linux..........
VirtualBox Guest Additions installer
Removing installed version 4.1.6 of VirtualBox Guest Additions...
Removing existing VirtualBox DKMS kernel modules ...done.
Removing existing VirtualBox non-DKMS kernel modules ...done.
Building the VirtualBox Guest Additions kernel modules ...done.
Doing non-kernel setup of the Guest Additions ...done.
Starting the VirtualBox Guest Additions ...done.
Installing the Window System drivers
Installing X.Org Server 1.11 modules ...done.
Setting up the Window System to use the Guest Additions ...done.
You may need to restart the hal service and the Window System (or just restart
the guest system) to enable the Guest Additions.
Installing graphics libraries and desktop services components ...done. →看到這行就安裝完畢了
重啟系統就完成安裝了
如果有出現下面的錯誤通常是沒有安裝x-window出現的問題